# Matlab数学代写 | Assignment Sheet 4 of MTH2051/3051

### Matlab数学代写 | Assignment Sheet 4 of MTH2051/3051

Please read the following instructions carefully. If in doubt, please raise
issues in the discussion forum.

i) The submission deadline is 6pm on Tuesday of week 12.
ii) Please complete the template les provided through Moodle. Do not
change lenames or headers.
iii) Your code is not required to check whether a hypothetical user of your
code provides reasonable inputs.
iv) Symbolic computation and high-level Matlab commands are prohib-
ited and result in zero marks for the task in which they were used.
v) The marking scheme is full marks for a correct implementation and
no marks for an incorrect implementation.
vi) Submit a zip-le called firstname_surname_assignment_4.zip con-
taining all your Matlab les through Moodle.

## Assignment 4.1. (explicit and implicit Euler scheme, 10 marks)

In this exercise, you will see the explicit and the implicit Euler scheme in
action. In both parts a) and b), the required output is the temporal grid

ofthe iterates of the numerical scheme.
Please ensure that the outputs are returned in the correct format. Your
code must be able to solve dierential equations for any spatial dimension d.

a) Complete the le myExplicitEuler.m by implementing Euler’s scheme
as in Denition 9.1 for multivariable vector elds f.

b) Complete the le myImplicitEuler.m by implementing the implicit
Euler scheme as in Denition 9.7 for multivariable vector elds f. For
solving the system of nonlinear equations, you may use the Matlab
command fsolve, which is running an algorithm remotely similar to
Newton’s method. Use the i-th iterate yi as an initial guess for the
computation of yi+1 via fsolve.

c) Run the script wrapper_4_1.m and connect the output with facts you
know about the explicit and the implicit Euler schemes. (nothing to
submit, not marked)