ΣνΜDr. Sharon's Math PlatformSyvara Learning
Question Bank › 📘 Undergraduate › Advanced Engineering Mathematics › Q40

Q40 · Explicit finite-difference method for u_t = u_xx, u(x,0) = sin(pi x)

Numerical Methods for PDEs 🟡 Intermediate Computation </> Python solution
Question

Use the explicit finite-difference method with $m = 5$ subintervals in $x$ and $n = 50$ subintervals in $t$ to approximate the solution of

$$\begin{aligned} &u_t = u_{xx}, && 0 < x < 1,\ 0 < t < 0.5, \\ &u(0,t) = 0, \quad u(1,t) = 0, && 0 < t < 0.5, \\ &u(x,0) = \sin\pi x, && 0 \le x \le 1. \end{aligned}$$

Compute the approximations at the interior grid points for the first two time levels ($t = 0.01$ and $t = 0.02$), and compare with the exact solution $u(x,t) = e^{-\pi^2t}\sin\pi x$.

🔒

Log in to see the worked solution

Enter your email to get started. Your first free solutions in every course unlock as soon as you verify.

Log in or sign up with email
</> Python code solution (Premium add-on)
NumPy
🔒 Upgrade to Premium or GQE to unlock Python solutions.
← Previous Next →
Working…