Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Coursework
Task
The numbered sections of this document describe problems which are modelled by partial differ-
ential equations. A numerical model is specified which leads to a nonlinear system of equations.
You will use one or more of the algorithms we have covered in the module to produce a numerical
solution.
Matlab scripts referred to in this document can be downloaded from Minerva under Learning
Resources / Coursework. Matlab implementations of some algorithms have been provided as
part of the module but you can implement your solutions in any other language if you prefer.
You should submit your answers as a single PDF document via Minerva before the stated
deadline. MATLAB code submitted as part of your answers should be included in the document.
MATLAB functions should include appropriate help information that describe the purpose and
use of that function.
Standard late penalties apply for work submitted after the deadline.
Disclaimer
This is intended as an individual piece of work and, while discussion of the work is
encouraged, plagiarism of writing or code in any form is strictly prohibited.
1. A one-dimensional PDE: Nonlinear parabolic equation
[10 marks total]
Consider the nonlinear parabolic PDE: find u(x, t) such that
(1)
in the spatial interval x ∈ (0, 1) and time domain t > 0.
Here and α are known, positive, constants.
Boundary conditions are specified as u(0) = 0 and u(1) = 1.
Initial conditions are specified at t = 0 as u(x, 0) = x.
We numerically approximate (1) using the method of lines on a uniform spatial grid with
m nodes on the interval [0, 1] with grid spacing h, and a fixed time step of ?t.
Code for this problem can be downloaded from Minerva and is in the Q1/ folder.
(a) Find the fully discrete formulation for (1) using the central finite difference formulas
h2
in space and the implicit Euler method in time.
Define the nonlinear system F(U) = 0 that needs to be solved at each time step to
obtain a numerical solution of the PDE (1).
(b) Derive the exact expression for each of the non-zero elements in row i of the Jacobian
for this problem.
(c) Solve the problem for different problem sizes: N = 81, 161, 321, 641, where N is the
number of unknowns to solve for (choose the grid size m appropriately to get the
correct N). Use NT = 40 time steps to solve from t0 = 0 to tf = 2. Create a
table that shows the total computational time taken T , the total number of Newton
iterations S, and the average number of Newton iterations per time step TS = T/S.