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

• Homework Help
• 12
• 100% (2) 2 out of 2 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)
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.
• • • 