Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Problems for chapter 10

10.1    Linear shooting Method for a Two-point Boundary value problem

consider the diferential equation

g、、= g+ 2g + cos(①),       for   O 三 ① 三  ,

with boundary conditions

g(O) = -O.3,       g  = -O.1.

(a). show that the exact solution is

g(①) = -(sin(①) + 3 cos(①))/1O.

 

(b).  Implement the shooting method for this problem in Matlab.  use Matlab solver ode45, with your choice of error tolerance. You can check your answer by comparing it with the exact solution. plot your solution, and also the error.

The problem must be solved with shooting method.  o credit will be given for any other methods.

10.2    More practice on Linear shooting Method

consider the two-point boundary value problem for the unknown u(①)

-u、、+ 3u = ① (1 - ①),        u(O) = O,    u(1) + u(1) = 1.

(a). Explain in detail how to solve this problem with the shooting method.

(b).  Implement your algorithm in Matlab.  use Matlab solver ode45, with your choice of error tolerance. plot the solution on O   三 1.

The problem must be solved with shooting method.  o credit will be given for any other methods.

10.3    More practice on Linear shooting Method

consider the two-point boundary value problem for the unknown u(①)

u、、+ 6u = 6①3,        u(O) = O,    u(1) + u(1) = 2.

(a). show that the exact solution is u(①) = ①3  - ① .

(b). Explain in detail how to solve this problem with the shooting method.

(c).  Implement your algorithm in Matlab.  use Matlab solver ode45, with your choice of error tolerance. plot the solution on O   三 1.

The problem must be solved with shooting method.  o credit will be given for any other methods.

10.4    Non-linear shooting Method for a Two-point Boundary value problem

g地地 = -(g )2  - g + ln(①))     1   三 2

with the boundary conditions

g(1) = O      g(2) = ln 2.

show that the exact solutions is

g(①) = ln ①.

Implement the shooting method for this problem in Matlab.  use Matlab solver ode45.  Note that this is a non-linear problem,  so you  need to use  a secant iteration.   since  the  secant  iteration converges quickly if the initial guess is good, it is crucial to get a good initial guess. Try the values 从1 = 1)从2 = O.5.

You may choose the tolerance to be 1O-9 , and maximum number of iterations for the secant method to be 5. plot the approximate solutions together with the exact solution. plot also the error.

The problem must be solved with shooting method.  o credit will be given for any other methods.

10.5    Non-linear shooting for a Two-point Boundary value problem

consider the diferential equation

g地地 = -(g )2  - g + cos2 ①)         O 三 ① 三 π

with the boundary conditions

g(O) = O      g(π) = O.

(a). show that the exact solutions is

g(①) = sin ①.

(b). Implement the shooting method for this problem in Matlab.  use Matlab solver ode45.  Note that this is a non-linear problem, so you need to use a secant iteration.  since the secant iteration converges quickly if the initial guess is good, it is crucial to get a good initial guess.  Try several initial guesses to ind one that works.

You may choose the tolerance to be 1O-9 , and maximum number of iterations for the secant method to be 5. plot the approximate solutions together with the exact solution. plot also the error.

The problem must be solved with shooting method.  o credit will be given for any other methods.

10.6    Finite Diference Method in 1D

consider the diferential equation

g  = g  + 2g + cos(①),          for    O 三 ①   2 ,

with boundary conditions

g(O) = -O.3,        g  = -O.1.

Note that the exact solution is

g(①) = -(sin(①) + 3 cos(①))/1O.

we will now compute approximate solutions with the inite diference method.

(a).   consider a uniform grid with mesh size h = (b - a)/N.  set up the inite diference method for the problem. write out this tri-diagonal system of linear equations for gi.

(b).   write a Matlab program that computes the approximate solution gi. You may either use the Matlab solver to solve the linear system, or use the code for tri-diagonal systems (you should ind it in a previous homework).  Test your program for N = 1O and N = 2O.  plot the approximate solutions together with the exact solution. plot also the errors.

The problem must be solved with inite diference method. o credit will be given for any other methods.

10.7    A Study on Accuracy and convergence of FDM in 1D

consider the Two point Boundary value problem with the unknown u(①) on ① E [O, π]:

u地地 (①)  = - sin(①),        u(O) = O,    u(π) = O.

(a). verify that the exact solution is u(①) = sin(①).

(b). solve this with inite diference method in Matlab, with uniform mesh h = π/N.  This means, write a Matlab function MYFDM网olver which takes N as input, and return the numerical solution in a vector.

(c). Run the Matlab function MYFDM网olver with N = 4, 8, 16.  use the exact solution to compute the error in max-norm.  plot the error against the mesh size h using loglog.  Estimate the rate of convergence.