Approximate the solution to the following partial differential equation using the Backward-Difference method. ∂u /∂t − ∂2u/ ∂x2 =0, 0 < x < 2, 0 < t; u(0,t) =u(2,t) =0, 0 < t, u(x,0) =sin( π /2) x,0 ≤x ≤2. Use m = 4, T = 0.1, and N = 2, and compare your results to the actual solution u(x,t) = e−((π2/4)t)* sin( π)
Solve this without MATLAB and need Step by step
"u_{t}-u_{xx}=0"
"u(0,t)=u(2,t)=0"
"u(x,0)=sin(\\dfrac{\\pi x}{2})"
We know that:
"f'(x)=\\lim\\limits_{\\Delta x\\rightarrow0}\\dfrac{f(x+\\Delta x)-f(x)}{\\Delta x}"
So, we instead use:
"\\dfrac{u_{i,j+1}-u_{i,j}}{\\Delta t}=\\dfrac{u_{i-1,j}-2u_{i.j}+u_{i+1,j}}{\\Delta x^2}"
Multiply both side by "\\Delta t:"
"u_{i,j+1}-u_{i,j}=\\dfrac{\\Delta t \\times (u_{i-1,j}-2u_{i.j}+u_{i+1,j})}{\\Delta x^2}"
Writing that "r=\\dfrac{\\Delta t}{\\Delta x^2}" , we can write:
"ru_{i-1,j}+(1-2r)u_{i,j}+ru_{i+1,j}=u_{i,j+1}"
Comments
Leave a comment