Question: Using the Crank - Nicolson method and Letting = k h 2 , we need to solve - 2 U i - 1 j +

Using the Crank-Nicolson method and Letting =kh2, we need to solve
-2Ui-1j+1+(1+)Uij+1-2Ui+1j+1=2Ui-1j+(1-)Uij+2Ui+1j+v(xi,tj). To do this, we first need to rewrite Uij as a long, one-dimensional vector y of size n(m-1). Note that in this vector we do not include the known values, i.e., initial values {Ui0} and the boundary values {U0j},{Umj}. Using the enumeration
y(j-1)(m-1)+i=Uij,i=1,2,dots,m-1,j=1,2,dots,n-1and similarly
v(j-1)(m-1)+i=v(xi,tj),i=1,2,dots,m-1,j=1,2,dots,n-1. system (2) can be represented in a matrix equation
Ay=v where y=(y1,y2,dots,y(n-1)(m-1))t,v=(v1,v2,dots,v(n-1)(m-1))t, and A is the square matrix resulting from the equation. Example 1 We test the above discretization scheme (3) to find an approximate solution of (1) with
an input v(x,t)=2. Fix L=T=1 and m=10,n=20. The analytic solution can be found in this
case and is given by
hat(y)(x,t)=x(1-x)+n=1bne-n22tsinnx
where
bn=201x(x-1)sinnxdx
We compare the solution obtained from (3) and the analytic solution evaluated at m+1 mesh points
at time t=0.95.
Using the Crank - Nicolson method and Letting = k

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!