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

Maths 762

Assignment 1 part b

2022

5.  (20 marks)

For each of these problems, repeat (a)-(d) below

i)

ut + u  = −

10

with initial data u(0, x) = sech(x) and periodic boundary conditions in x.

ii)

ut + /1 + u  =

with initial data u(0, x) = sech(x) and periodic boundary conditions in x.

(a) Write down an upwind nite difference numerical scheme. Explain and justify your choices of finite difference stencils. Implement this scheme in Matlab (or similar) and solve up to t = 10. Explain your choices for time step, space step, and size of the spatial domain.

(b) Write down a Fourier (spectral) numerical scheme for this equation.  Implement this scheme in Matlab (or similar) and solve up to t = 10.

(c)  Compare your two numerical solutions (parts a and c) for equivalent discretizations. Comment on how these compare with your expectations.

(d) Adjust your choice of timestep so that the nite difference method follows the characteristics to eliminate numerical dispersion. What additional difficulties does this introduce?