On Fri, 5 Apr 2013 15:30:30 -0700 (PDT), Mengqi Zhang <email@example.com> wrote: > Hi All, > > I know that in using spectral method to solve the eigenvalue > problem, if the boundary condition for eigenfunction is > homogeneous Dirichlet type (i.e., u(+1)=u(-1)=0), we will just > delete the first and last rows and columns. > > But what if the boundary condition is non-homogeneous Dirichlet > type? Say to solve the eigenfunction of D^2 with the boundary > condition u(+1)=1 and u(-1)=0. > > Remember that we are in a eigenvalue problem, which is here D^2 > u = lambda u. >
Decompose your problem into pair of functions: u=u0+v, where u0 is arbitrary and has to satisfy non-homogeneous b.c. and v is sought and has to satisfy homogeneous b.c.