Question 16.18: Solve the wave equation ∂²u/∂t² = 4∂²u/∂x² with initial cond...
Solve the wave equation \frac{\partial^2 u}{\partial t^2}=4 \frac{\partial^2 u}{\partial x^2} with
initial conditions u(x, 0)=\left\{\begin{array}{ll} 0.1(x) & 0 \leq x \leq 1 / 2 \\ 0.1(1-x) & 1 / 2 \leq x \leq 1 \end{array} \text { and }\left.\frac{\partial u}{\partial t}\right|_{t=0}=0\right.
boundary conditions u(0, t) = u(1, t) = 0 t ≥ 0 .
Take the step size for t is 0.1, and step size for x is 0.25. Use explicit scheme to compute the solution up to time t = 0.3. Use central difference formula for the derivative term in the initial condition.
Learn more on how we answer questions.
It is given that step size for t is 0.1 (k = 0.1) and step size for x is 0.25 (h = 0.25). So, we have x = 0, 0.25, 0.5, 0.75, 1 and t = 0, 0.1, 0.2, 0.3.
Using the initial condition
u(x, 0)= \begin{cases}0.1(x) & 0 \leq x \leq 1 / 2 \\ 0.1(1-x) & 1 / 2 \leq x \leq 1\end{cases}
and boundary conditions
u(0, t) = u(1, t) = 0 t ≥ 0,
we have following table for values of u_{i, j}=u\left(x_i, t_j\right)
4(1) | 3(0.75) | 2(0.5) | 1(0.25) | 0 (0) | j(t) \ i(x) |
0 | 0.025 | 0.05 | 0.025 | 0 | 0 (0) |
0 | . | . | . | 0 | 1 (0.1) |
0 | . | . | . | 0 | 2 (0.2) |
0 | . | . | . | 0 | 3(0.3) |
0 | . | . | . | 0 | 4(0.4) |
The explicit scheme (16.88) for the solution of wave equation is as follows
u_{i, j+1}=r\left(u_{i+1, j}+u_{i-1, j}\right)+2(1-r) u_{i, j}-u_{i, j-1} (16.88)
Using r=\frac{c k^2}{h^2}=4 \frac{(0.1)^2}{(0.25)^2}=0.64 , we have
u_{i, j+1}=0.64\left(u_{i+1, j}+u_{i-1, j}\right)+0.72 u_{i, j}-u_{i, j-1} (16.91)
Equation (16.91) can be used to compute various nodal values for different j.
j = 1.
At time t = 0, the initial condition is \left.\frac{\partial u}{\partial t}\right|_{t=0}=0 . The central difference formula provides the following equation
\left.\frac{\partial u}{\partial t}\right|_{t=0}=\left.\frac{u_{i, j+1}-u_{i, j-1}}{2 k}\right|_{j=0}=\left.\frac{u_{i, 1}-u_{i,-1}}{2 k}\right|_{j=0}=0
\Rightarrow u_{i, 1}=u_{i,-1} (16.92)
The scheme (16.91) for j = 0 is given by
u_{i, 1}=0.64\left(u_{i+1,0}+u_{i-1,0}\right)+0.72 u_{i, 0}-u_{i,-1}
Using Eq. (16.92), we have
u_{i, 1}=0.32\left(u_{i+1,0}+u_{i-1,0}\right)+0.36 u_{i, 0}
For i = 1, 2, 3, we can easily obtain the following values
\begin{aligned} &u_{1,1}=0.32\left(u_{2,0}+u_{0,0}\right)+0.36 u_{1,0}=0.32(0.05+0)+0.36(0.025)=0.025 \\ &u_{2,1}=0.32\left(u_{3,0}+u_{1,0}\right)+0.36 u_{2,0}=0.32(0.025+0.025)+0.36(0.05)=0.034 \\ &u_{3,1}=0.32\left(u_{4,0}+u_{2,0}\right)+0.36 u_{3,0}=0.32(0+0.05)+0.36(0.025)=0.025 \end{aligned}
The following table shows these values in the second row.
4(1) | 3(0.75) | 2(0.5) | 1(0.25) | 0 (0) | j(t) \ i(x) |
0 | 0.025 | 0.05 | 0.025 | 0 | 0 (0) |
0 | 0.025 | 0.034 | 0.025 | 0 | 1 (0.1) |
0 | 0 | 2 (0.2) | |||
0 | 0 | 3(0.3) |
j = 2,
The explicit scheme (16.91) for j = 1 gives following equation
u_{i, 2}=0.64\left(u_{i+1,1}+u_{i-1,1}\right)+0.72 u_{i, 1}-u_{i, 0}
For i = 1, 2, 3 , we can easily obtain the following values
\begin{aligned} &u_{1,2}=0.64\left(u_{2,1}+u_{0,1}\right)+0.72 u_{1,1}-u_{1,0}=0.64(0.034+0)+0.72(0.025)-0.025=0.01476 \\ &u_{2,2}=0.64\left(u_{3,1}+u_{1,1}\right)+0.72 u_{2,1}-u_{2,0}=0.64(0.025+0.025)+0.72(0.034)-0.05=0.00648 \\ &u_{3,2}=0.64\left(u_{4,1}+u_{2,1}\right)+0.72 u_{3,1}-u_{3,0}=0.64(0+0.034)+0.72(0.025)-0.025=0.01476 \end{aligned}
4(1) | 3(0.75) | 2(0.5) | 1(0.25) | 0(0) | j(t) \ i(x) |
0 | 0.025 | 0.05 | 0.025 | 0 | 0 (0) |
0 | 0.025 | 0.034 | 0.025 | 0 | 1 (0.1) |
0 | 0.01476 | 0.00648 | 0.01476 | 0 | 2 (0.2) |
0 | 0 | 3(0.3) |
j = 3,
For j = 2, the explicit scheme (16.91) becomes
u_{i, 3}=0.64\left(u_{i+1,2}+u_{i-1,2}\right)+0.72 u_{i, 2}-u_{i, 1}
For i = 1, 2, 3 , the following values are obtained
\begin{aligned} u_{1,3} &=0.64\left(u_{2,2}+u_{0,2}\right)+0.72 u_{1,2}-u_{1,1}=0.64(0.00648+0)+0.72(0.01476)-0.025 \\ &=-0.0102256 \\ u_{2,3} &=0.64\left(u_{3,2}+u_{1,2}\right)+0.72 u_{2,2}-u_{2,1}=0.64(0.01476+0.01476)+0.72(0.00648)-0.034 \\ &=-0.0104416 \\ u_{3,3} &=0.64\left(u_{4,2}+u_{2,2}\right)+0.72 u_{3,2}-u_{3,1}=0.64(0+0.00648)+0.72(0.01476)-0.025 \\ &=-0.0102256 \end{aligned}
4(1) | 3(0.75) | 2(0.5) | 1(0.25) | 0(0) | j(t) \ i(x) |
0 | 0.025 | 0.05 | 0.025 | 0 | 0 (0) |
0 | 0.025 | 0.034 | 0.025 | 0 | 1 (0.1) |
0 | 0.01476 | 0.00648 | 0.01476 | 0 | 2 (0.2) |
0 | –0.0102256 | –0.0104416 | –0.0102256 | 0 | 3(0.3) |