Question 12.2.1: Use steps sizes (a) h = 0.1 and k = 0.0005 and (b) h = 0.1 a...
Use steps sizes (a) h = 0.1 and k = 0.0005 and (b) h = 0.1 and k = 0.01 to approximate the solution to the heat equation
\frac{\partial u}{\partial t}(x, t)-\frac{\partial^{2} u}{\partial x^{2}}(x, t)=0, \quad 0<x<1, \quad 0 \leq t ,
with boundary conditions
u(0, t) = u(1, t) = 0, 0 < t,
and initial conditions
u(x, 0) = sin(πx), 0 ≤ x ≤ 1.
Compare the results at t = 0.5 to the exact solution
u(x, t)=e^{-\pi^{2} t} \sin (\pi x)
Learn more on how we answer questions.
(a) Forward-Difference method with h = 0.1, k = 0.0005 and λ = (1)²(0.0005/(0.1)²) = 0.05 gives the results in the third column of Table 12.3. As can be seem from the fourth column, these results are quite accurate.
(b) Forward-Difference method with h = 0.1, k = 0.01 and λ = (1)²(0.01/(0.1)²) = 1 gives the results in the fifth column of Table 12.3. As can be seem from the sixth column, these results are worthless.
Table 12.3
x_{i} | u\left(x_{i}, 0.5\right) | \begin{gathered}w_{i, 1000} \\k=0.0005\end{gathered} | \left|u\left(x_{i}, 0.5\right)-w_{i, 1000}\right| | \begin{gathered}w_{i, 50} \\k=0.01\end{gathered} | \left|u\left(x_{i}, 0.5\right)-w_{i, 50}\right| |
0.0 | 0 | 0 | 0 | ||
0.1 | 0.00222241 | 0.00228652 | 6.411 × 10^{-5} | 8.19876 × 10^{7} | 8.199 × 10^{7} |
0.2 | 0.00422728 | 0.00434922 | 1.219 × 10^{-4} | −1.55719 × 10^{8} | 1.557 × 10^{8} |
0.3 | 0.00581836 | 0.00598619 | 1.678 × 10^{-4} | 2.13833 × 10^{8} | 2.138 × 10^{8} |
0.4 | 0.00683989 | 0.00703719 | 1.973 × 10^{-4} | −2.50642 × 10^{8} | 2.506 × 10^{8} |
0.5 | 0.00719188 | 0.00739934 | 2.075 × 10^{-4} | 2.62685 × 10^{8} | 2.627 × 10^{8} |
0.6 | 0.00683989 | 0.00703719 | 1.973 × 10^{-4} | −2.49015 × 10^{8} | 2.490 × 10^{8} |
0.7 | 0.00581836 | 0.00598619 | 1.678 × 10^{-4} | 2.11200 × 10^{8} | 2.112 × 10^{8} |
0.8 | 0.00422728 | 0.00434922 | 1.219 × 10^{-4} | −1.53086 × 10^{8} | 1.531 × 10^{8} |
0.9 | 0.00222241 | 0.00228652 | 6.511 × 10^{-5} | 8.03604 × 10^{7} | 8.036 × 10^{7} |
1.0 | 0 | 0 |