Matrix representation of differential operators with neumann boundary conditions

32 views
Skip to first unread message

Jack Luong

unread,
May 1, 2023, 5:34:29 PM5/1/23
to chebfun-users
Hi everyone,

I want to acquire a matrix representation of a differential operator (for example, D^4 on domain [0,1]) with boundary conditions baked in (u(0,t) = 0, u_x(0,t) + u_xxx(0,t) = c, u_x(1,t) = 0, u_xxx(1,t) = 0)) using Chebychev interpolation.  Unfortunately, I need the actual matrix that defines this instead of using a chebop.  A few questions:

1. Is there a way to define a chebop and obtain the matrix representation of this chebop?

2. To construct the matrix representation of D^4 using chebfun matrix commands like diffmat and diffrow, my understanding is we have N points we should define a diffmat on N points but replace the first two and last two rows with specially defined rules to take care of the boundary conditions.  What rows should replace the lines that correspond to the Neumann boundary condition?

Thanks,
Jack 

Jack Luong

unread,
May 1, 2023, 6:58:34 PM5/1/23
to chebfun-users
I forgot to mention that I want to simulate the PDE u_t = u_xxxx via method of lines so I would like to define a matrix L such that I can solve u_t = Lu.  The matrix L should encode the boundary conditions such that I can implement any ODE solver directly to u_t = Lu.

Nick Trefethen

unread,
May 2, 2023, 2:44:55 AM5/2/23
to chebfun-users
Dear Jack -

Yes, you can do all this, and the details complete with Chebfun commands are explained in "Block operators and spectral discretizations", https://people.maths.ox.ac.uk/trefethen/blocks_final.pdf.  Chebfun doesn't remove the first two and last two rows, but rather uses a technology of "rectangular differentiation matrices" going back to Driscoll and Hale.

Jack Luong

unread,
May 2, 2023, 7:22:28 PM5/2/23
to chebfun-users
Hi Nick,

Thank you for directing me to this resource!  After reading through the paper though, I'm not sure that if we define L in the way done in Example 2 for instance and we solve u_t = Lu with an ODE scheme that the boundary conditions are necessarily enforced upon each consecutive timestep.  It seems to me the last two rows encoding the boundary conditions will deviate from the prescribed boundary values when solving the ODE.  

Thanks,
Jack

Nick Hale

unread,
May 3, 2023, 3:24:27 AM5/3/23
to Jack Luong, chebfun-users
Hi Jack


Best regards

Nick 

--
You received this message because you are subscribed to the Google Groups "chebfun-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chebfun-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/chebfun-users/19022168-bf7f-49a8-bc38-1a4b364bd9b9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages