# solutions1.3 - Math 307 Problems for section 1.3 1 Write...

• Homework Help
• 12
• 100% (28) 28 out of 28 people found this document helpful

This preview shows page 1 - 5 out of 12 pages.

Math 307: Problems for section 1.31.Write down the vector approximatingf′′(x)at interior points, the vector approximatingxf(x)at interior points, and the finite difference matrix equation for the finite differenceapproximation withN= 4for the differential equation
1
2.Write down the matrix equation to solve in order to find the finite difference approxima-tion withN= 4for the same differential equation
3.Use MATLAB/Octave to solve the matrix equations you derived in the last two prob-lems for the vector F that approximates the solution (i.e., withN= 4).Then redo thecalculation withN= 50and plot the resulting functions.For defineNand ΔxN=4;DX=2/N;Define the matrixLwhereLFcorresponds tof′′(x)L=diag(-2*ones(1,N+1))+diag(ones(1,N),1)+diag(ones(1,N),-1);L(1,1)=1;L(1,2)=0;L(N+1,N)=0;L(N+1,N+1)=1;Define the matrixQwhereQFcorresponds toxf(x)X=linspace(1,3,N+1);Q=DX^2*diag(X);Q(1,1)=0;Q(N+1,N+1)=0;Define the right side of the equation for the boundary conditions of the first problem.
• • • 