- #1
mathmari
Gold Member
MHB
- 5,049
- 7
Hey!
I have to solve the following initial and boundary value problem:
$$u_t=u_{xx}, 0<x<L, t>0 (1)$$
$$u_x(0,t)=u_x(L,t)=0, t>0$$
$$u(x,0)=H(x - \frac{L}{2} ), 0<x<L, \text{ where } H(x)=1 \text{ for } x>0 \text{ and } H(x)=0 \text{ for } x<0$$
I have done the following:
Using the method of Separation of Variables, the solution is of the form: $u(x,t)=X(x) \cdot T(t)$
Replacing this at $(1)$, we get the following two problems:
$$\left.\begin{matrix}
X''+\lambda X=0, 0<x<L\\
X'(0)=X'(L)=0
\end{matrix}\right\}(2)$$
and
$$\left.\begin{matrix}
T'+ \lambda T=0, t>0
\end{matrix}\right\}(3)$$
$$u(x,0)=X(x)T(0)=H(x - \frac{L}{2} )$$
Solving the problem $(2)$ we get that the eigenfunctions are:
$$X_n(x)= \left\{\begin{matrix}
1 & , n=0 \\
\cos{(\frac{n \pi x}{L})} & , n=1,2,3, \dots
\end{matrix}\right.$$
and solving the problem $(3)$ we get:
$$T_n(t)= \left\{\begin{matrix}
A_0 & , n=0 \\
e^{-(\frac{n \pi}{L})^2t} & , n=1,2,3, \dots
\end{matrix}\right.$$
So the solution of the initial problem is of the form
$$u(x,t)=A_0 + \sum_{n=1}^{\infty}{ A_n \cos{(\frac{n \pi x}{L})} e^{-(\frac{n \pi}{L})^2t}}$$
$$u(x,0)=H(x - \frac{L}{2} ) \Rightarrow H(x - \frac{L}{2} )=A_0+ \sum_{n=1}^{\infty}{A_n \cos{(\frac{n \pi x}{L})}}$$
We can write the function $H(x - \frac{L}{2} )$ as a Fourier series to calculate the coefficients $A_0$ and $A_n$.
$$H(x - \frac{L}{2} )=\frac{a_0}{2}+\sum_{n=1}^{\infty}{a_n \cos{(\frac{n \pi x}{L})}}$$
$$A_0=\frac{a_0}{2}=\frac{1}{2}$$
$$A_n=a_n=\frac{2}{L} \int_0^L{H(x - \frac{L}{2} ) \cos{(\frac{n \pi x}{L})}}dx=\frac{2}{L} \int_{\frac{L}{2}}^L{\cos{(\frac{n \pi x}{L})}}dx=-\frac{2}{n \pi} \sin{(\frac{n \pi}{2})}$$
Is this correct so far?? (Wondering)
Is there a general formula for $\sin{(\frac{n \pi}{2})}$? For even $n$ it's equal to $0$, but for odd $n$ it's equal to $1$ or $-1$.
I have to solve the following initial and boundary value problem:
$$u_t=u_{xx}, 0<x<L, t>0 (1)$$
$$u_x(0,t)=u_x(L,t)=0, t>0$$
$$u(x,0)=H(x - \frac{L}{2} ), 0<x<L, \text{ where } H(x)=1 \text{ for } x>0 \text{ and } H(x)=0 \text{ for } x<0$$
I have done the following:
Using the method of Separation of Variables, the solution is of the form: $u(x,t)=X(x) \cdot T(t)$
Replacing this at $(1)$, we get the following two problems:
$$\left.\begin{matrix}
X''+\lambda X=0, 0<x<L\\
X'(0)=X'(L)=0
\end{matrix}\right\}(2)$$
and
$$\left.\begin{matrix}
T'+ \lambda T=0, t>0
\end{matrix}\right\}(3)$$
$$u(x,0)=X(x)T(0)=H(x - \frac{L}{2} )$$
Solving the problem $(2)$ we get that the eigenfunctions are:
$$X_n(x)= \left\{\begin{matrix}
1 & , n=0 \\
\cos{(\frac{n \pi x}{L})} & , n=1,2,3, \dots
\end{matrix}\right.$$
and solving the problem $(3)$ we get:
$$T_n(t)= \left\{\begin{matrix}
A_0 & , n=0 \\
e^{-(\frac{n \pi}{L})^2t} & , n=1,2,3, \dots
\end{matrix}\right.$$
So the solution of the initial problem is of the form
$$u(x,t)=A_0 + \sum_{n=1}^{\infty}{ A_n \cos{(\frac{n \pi x}{L})} e^{-(\frac{n \pi}{L})^2t}}$$
$$u(x,0)=H(x - \frac{L}{2} ) \Rightarrow H(x - \frac{L}{2} )=A_0+ \sum_{n=1}^{\infty}{A_n \cos{(\frac{n \pi x}{L})}}$$
We can write the function $H(x - \frac{L}{2} )$ as a Fourier series to calculate the coefficients $A_0$ and $A_n$.
$$H(x - \frac{L}{2} )=\frac{a_0}{2}+\sum_{n=1}^{\infty}{a_n \cos{(\frac{n \pi x}{L})}}$$
$$A_0=\frac{a_0}{2}=\frac{1}{2}$$
$$A_n=a_n=\frac{2}{L} \int_0^L{H(x - \frac{L}{2} ) \cos{(\frac{n \pi x}{L})}}dx=\frac{2}{L} \int_{\frac{L}{2}}^L{\cos{(\frac{n \pi x}{L})}}dx=-\frac{2}{n \pi} \sin{(\frac{n \pi}{2})}$$
Is this correct so far?? (Wondering)
Is there a general formula for $\sin{(\frac{n \pi}{2})}$? For even $n$ it's equal to $0$, but for odd $n$ it's equal to $1$ or $-1$.