# Boundary conditions in the time evolution of Spectral Method in PDE

Summary:
I need some help to implement a boundary condition to a 1D heat equation when dealing with it using spectral expansion.
Hi everyone!

I am studying spectral methods to solve PDEs having in mind to solve a heat equation in 2D, but now i am struggling with the time evolution with boundary conditions even in 1D. For example,

$$u_t=k u_{xx},$$
$$u(t,-1)=\alpha,$$
$$u(t,1)=\beta,$$
$$u(0,x)=f(x),$$
$$u(t,x)=\sum^{N-1}_{n=0} a_n(t) T_{n}(x).$$

T(x) is for Chebyshev polynomials.

I can easily create through MMT or FFT the spectral expansion for u(0,x), including the boundaries, to initiate the time-stepping via the first equation as,

$$\sum^{N-1}_{n=0} \frac{da_n(t)}{dt} T_n(x)=\sum^{N-1}_{n=0} a^{(2)}_n(t) T_n(x).$$

which implies in

$$a_n(t+ \delta t)=k a_n(t)+a^{(2)}_n \delta t.$$

But the point is.. how do i use the boundary conditions in the time-step? I can't find it in the bibliography.

I think that the usual thing to do would be use the boundary conditions as

$$\sum^{N-1}_{n=0} a_n(t+\delta t) T_n(-1)=\sum^{N-1}_{n=0} a_n(t+\delta t)=\alpha,$$

$$\sum^{N-1}_{n=0} a_n(t+\delta t) T_n(1)=\sum^{N-1}_{n=0} a_n(t+\delta t)=\beta,$$

but i'm not sure how to implement it in the time-stepping... Any suggestions? I would love to know a book that deals with it!

PS: I had problems using the caption in the LaTeX, the idex runs for n instead of N and t_N should be T_n!!! I dont know why it became like this.

• Delta2

## Answers and Replies

Summary:: I need some help to implement a boundary condition to a 1D heat equation when dealing with it using spectral expansion.

Hi everyone!

I am studying spectral methods to solve PDEs having in mind to solve a heat equation in 2D, but now i am struggling with the time evolution with boundary conditions even in 1D. For example,

$$u_t=k u_{xx},$$
$$u(t,-1)=\alpha,$$
$$u(t,1)=\beta,$$
$$u(0,x)=f(x),$$
$$u(t,x)=\sum^{N-1}_{n=0} a_n(t) T_{n}(x).$$

T(x) is for Chebyshev polynomials.

I can easily create through MMT or FFT the spectral expansion for u(0,x), including the boundaries, to initiate the time-stepping via the first equation as,

$$\sum^{N-1}_{n=0} \frac{da_n(t)}{dt} T_n(x)=\sum^{N-1}_{n=0} a^{(2)}_n(t) T_n(x).$$

which implies in

$$a_n(t+ \delta t)=k a_n(t)+a^{(2)}_n \delta t.$$

But the point is.. how do i use the boundary conditions in the time-step? I can't find it in the bibliography.

I think that the usual thing to do would be use the boundary conditions as

$$\sum^{N-1}_{n=0} a_n(t+\delta t) T_n(-1)=\sum^{N-1}_{n=0} a_n(t+\delta t)=\alpha,$$

$$\sum^{N-1}_{n=0} a_n(t+\delta t) T_n(1)=\sum^{N-1}_{n=0} a_n(t+\delta t)=\beta,$$

but i'm not sure how to implement it in the time-stepping... Any suggestions? I would love to know a book that deals with it!

PS: I had problems using the caption in the LaTeX, the idex runs for n instead of N and t_N should be T_n!!! I dont know why it became like this.
Just a thought, but typically you'd want to make the spacial BCs homogenous, such as adding a linear solution to your guess. Know what I'm talking about?