Thursday, June 1, 2017

Use the method of separation of variables to solve non homogeneous initial-Neumann problem

Use the method of separation of variables to solve the following non homogeneous initial-Neumann problem: $$ \begin{cases} u_t − u_{xx} = tx& 0 < x < \pi, t >0\\ u (x, 0) = 1& 0 ≤ x ≤ \pi\\ u_x (0, t) = u_x (\pi, t) = 0 & t > 0. \end{cases} $$ We have homogeneous b.c., so using separation of variables, we can find the solution for $u$ in the form: $$u(x,t) = \sum_n u_n(t)X_n(x),$$ where u$_k$ are the eigenfunctions of the eigenvalue problem associated with the homogeneous equation.

To find the eigenfunctions $X_n$, substitute a trial solution $u=T(t)X(x)$ into the homogeneous part of the partial differential equation, $u_t = u_{xx} + xt$. Remember: ignore the inhomogeneous part $tx$ when finding the eigenfunctions. $$\frac{T'}{T} = \frac{X''}{X} = \mbox{constant} = \lambda.$$

We then get the following Sturm-Liouville problem for any eigenfunctions $X(x):$ $$\begin{equation}X''=\lambda X\label{x}\end{equation}$$ $$X(0)=X(L)=0.$$ Quickly go through three cases:
  1. $\lambda = 0:$ $$X''=0\Rightarrow X(x)=Ax+B\Rightarrow A=B=0.$$
  2. $\lambda = \mu^2 = > 0:$ $$X''=\mu^2X\Rightarrow X=Ae^{\mu x}+Be^{-\mu x}\Rightarrow A=B=0.$$
  3. $\lambda = -\mu^2 = < 0:$ $$X''=-\mu^2X\Rightarrow X=A\cos{\mu x}+B\sin{\mu x}.$$ From b.c. $A=0$ and either $B = 0$ or $\sin{\mu x} = 0.$ The first case isn't interesting for us, because we would get no eigenvalues from it. The second case requires $\mu_n \pi = n\pi,$ so $\mu_n = n,$ that yields: $$X_n = A_n\sin{n x}.$$
Now write the partial differential equation $u_t = u_{xx} + tx$ using the Fourier series: $$\sum_{n=0}^{\infty}\dot{u}_n(t)X_n(x)=\sum_{n=0}^{\infty}\lambda u_n(t)X_n(x) + tx,$$ here we've used $\ref{x}.$

To solve the equation we need to represent $x$ in terms of $X_n(x),$ which is as Fourier series on $[0,\pi]$ and then equate the coefficients on the right hand and the left hand sides.

References

5.6 Inhomogeneous boundary conditions

Wednesday, May 31, 2017

Use the method of separation of variables to solve initial-Neumann problem

2.1. Use the method of separation of variables to solve the following initial-Neumann problem:

$$ \begin{equation} \begin{cases} u_t-u_{xx} = 0 & 0 < x < L, t > 0\\ u(x,0) = x & 0 < x < L\\ u_x(0,t) = u_x(L,t) = 0 & t > 0. \end{cases} \end{equation} $$ Step 1. We look for non-trivial solutions of (2.12) of the form $$u(x,t)=w(t)v(x),$$ with $v'(0) = v'(L) = 0.$ $$\frac{w'(t)}{w(t)} = \frac{v''(x)}{v(x)}.$$ Now, the left hand side in is a function of $t$ only, while the right hand side is a function of $x$ only and the equality must hold for every $t > 0$ and every $x \in (0, L).$ This is possible only when both sides are equal to a common constant $\lambda,$ say. $$\begin{equation}v''(x) = \lambda v(x)\label{v}\end{equation}$$ with $$\begin{equation}v'(0) = v'(L) = 0\label{init_v}\end{equation}$$ and $$\begin{equation}w'(t) = \lambda w(t)\label{w}\end{equation}.$$ We first solve problem $\ref{v}.$
  1. $\lambda = 0.$ $$v''(x) = 0 \Rightarrow v(x) = Ax+B.$$ From $\ref{init_v}$ we have $A = 0$ and $B -$ any. Thus, if $\lambda=0$ any constant function $\boxed{v(x) = B}$ is an eigenfunction for the eigenvalue $\lambda = 0.$
  2. $\lambda = \mu^2 > 0.$ $$v(x) = Ae^{\mu x} + Be^{-\mu x}.$$ From $\ref{init_v}$ we have $$ \begin{cases} A\mu e^{1} - B\mu e^{-1} = 0\\ A\mu e^{\mu L} - B\mu e^{-\mu L} = 0 \end{cases} \Rightarrow \begin{cases} A\mu - B\mu = 0\\ Ae^{2\mu L} - B = 0 \end{cases} $$ so $A = B = 0.$
  3. $\lambda = -\mu^2 < 0.$ $$v(x) = A\cos{(\mu x)} + B\sin{(\mu x)}.$$ From $\ref{init_v}$ we have $$ \begin{cases} -A\mu \sin{0} + B\mu \cos{0} = 0\\ -A\mu \sin{L} + B\mu \cos{L} = 0\\ \end{cases} \Rightarrow \begin{cases} B = 0\\ A\mu\sin{\mu L} = 0 \end{cases} $$ To get nontrivial solution we require $\mu_n = \frac{n\pi}{L}.$ And, so $\lambda = -\frac{n^2\pi^2}{L^2}$ and $\boxed{v_n(x) = A\cos{\left(\frac{n\pi}{L}x\right)}}$ for $n \in {0,1,\dots}.$ Where $\mu_n - $ eigenvalues, $v_n - $ eigenfunctions.
Now let's solve $\ref{w}.$ We now that $\lambda = -\frac{n^2\pi^2}{L^2},$ so $\boxed{w(t) = Ce^{-\frac{n^2\pi^2}{L^2}t}}.$

Now we can state the big answer. It is $$\boxed{u(x,t) = A+\sum_{n=1}^{\infty}\left(A_n\cos{\left(\frac{n\pi}{L}x\right)}e^{-\frac{n^2\pi^2}{L^2}t}\right)}.$$

The initial condition requires $$u(x,0) = A_0+\sum_{n=1}^{\infty}A_n\cos{\left(\frac{n\pi}{L}x\right)} = x.$$ Cosines in the series correspond to the necessity of taking even extension of the Neumann data unlike Dirichlet data in which case we take odd extension as the reflection method precribes. That's not a particularly hard to find such coefficients using Fourier series expansion. $$ \begin{align*} A_n &= \frac{2}{L}\int_0^L x\cos{\frac{\pi n x}{L}} dx\\ &= \frac{2}{L}\frac{L}{\pi n}\left(x\sin{\frac{\pi n x}{L}}|_0^L-\int_0^L\sin\frac{\pi nx}{L}dx\right)\\ &= -\frac{2L}{\pi^2 n^2}\cos\frac{\pi nx}{L}|_0^L\\ &= \begin{cases} \frac{4L}{\pi^2 n^2}&n\ \mbox{is odd}\\ 0 &\mbox{otherwise.} \end{cases} \end{align*} $$

References