Coursework II for 2024-2025-S2 MTH419 Scientific Computing
Due on 26th May (Monday) 23:59
Notice: Your report in a single PDF file does not only include description of the problems, methods and results, but also the process of finding the solutions. That means, you need to record your input to AI (if used), output from AI, what you think, your input to Python, output from Python, what you think, and all that loop over and again. It is recommended to use figures and tables wherever suitable. The examiner will call for oral defense of your report. So you must establish your own understanding.
1 Part I. Viscous Burgers’ Equation in 1-dimensional space
We want to solve numerically the Burger’s equation
where ν > 0 is the physical constant corresponding to the viscousity. To this end, we discretise the space domain at the points xi = ih, i = 0, . . . , N with Nh = 1. We approximate u(xi
, t) by Ui(t) that satisfies
for i = 1, . . . , N − 1, and U0(t) = UN (t) ≡ 0. These correspond to a system of differential equations. Our goal is to use the 1 stage Gauss-Kuntzmann method with the Butcher table
to solve the system of differential equations.
Question 1 (10 marks)
Write down the time discretised system corresponding to the 1 stage Gauss-Kuntzmann method aforementioned. The time discretisation is implicit, and a nonlinear system of equations need to be solved at each time step.
Question 2 (10 marks)
Write down the Newton iteration formula for the nonlinear system of equations aforementioned. A linear system of equations will be solved in each Newton iteration. Write down the linear system of equations.
Question 3 (10 marks)
For the linear system of equations, choose an appropriate Krylov subspace method e.g. Conjugate Gradient or GMRES to solve. Describe your choice.
Question 4 (40 marks)
Combining the linear solver (Krylov method), nonlinear solver (Newton iteration) and the time stepping (1 stage Gauss-Kuntzmann), implement a numerical solver for the system of differential equations aforementioned.
The parameter ν can be taken as 0.1, 0.01, 0.001, ..., and u0(x) = sin(πx).
Plot the time dependent solution as an animation (e.g. using matplotlib.animation.FuncAnimation). That is, at time tk, plot the solution U
k = [U0
k
, . . . , UN
k
] as a function of the space points [x0, . . . , xN ].
Is the numerical solution correct?
Qualitatively, the solution as a function of the space x should start from the initial profile u0(x) and move to the right while the amplitude decays, as time grows; see e.g. https://visualpde.com/sim/?preset=BurgersEquation
Quantitatively, as ∆t → 0 and h → 0 simultaneously, does the solution converge? Does small value of ν require small h and ∆t?
How many iterations are used for the linear solver (Krylov subspace method) / nonlinar solver (Newtion itera-tion)?
2 Part II. Spectral Graph Drawing
Read the two slides about the spectral graph drawing.
Question 5 (30 marks)
Now there is a graph adjacency matrix stored as the sparse matrix ’a’ in the MATLAB file ‘yaleShield.mat’. Read in the sparse matrix using Python. Use Lanczos algorithm to carry out the spectral drawing of the graph.