Math 232: Numerical Solution of Differential Equations Homework 4

$30.00

Category: Tags: , , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

1. This problem allows you to code and compare several different methods we have discussed in
class.
Consider the following boundary value problem
u
00 = ex
in (0, 1), u(0) = 3, u0
(1) = −5.
It has a Dirichlet boundary condition on x = 0 and a Neumann boundary condition on x = 1.
(a) Solve this problem analytically.
(b) Implement a second-order finite difference method to solve this boundary value problem.
Verify that your code is second-order accurate.
(c) Use your second-order finite difference code from part (b) to compute the extrapolation
method. Verify that your extrapolation method is fourth-order accurate.
(d) Use your second-order finite difference code from part (b) to compute the deferred correction solution. Verify that your deferrred correction method is fourth-order accurate.
(e) Modify your code to implement a fourth-order finite difference method to solve this
boundary value problem (you may want to make extensive use of the Matlab code
fdcoeffF.m). Verify that your code is fourth-order accurate.
1
Math 232: Numerical Solution of Differential Equations Homework 4
(f) Implement the spectral collocation method on a Chebyshev grid to solve this boundary
value problem. You can modify the code SpectralMethod1.m which uses a uniform grid
to solve this boundary value problem. Observe that this method is not working well as
the number of points increases and then modify this code to use the Chebyshev grid.
Verify that your spectral collocation method is now spectrally accurate.
For this problem, plot all of your errors versus m, the number of grid points used, on a single
graph to compare them to one another. Then give a discussion on your results. For example,
what are the costs and benefits to using one method over another with regards to accuracy
and efficiency?
2