MTH3007b Weekly Problems 1

Original Documents: Problem Sheet

Vibes: …

Used Techniques:

1.1. Definitions

Question

What is meant by the following:

  1. Local truncation error.
  2. Global truncation error.
  3. Order of an algorithm.
  4. Finite difference method.


1.2. Definition Comparison

Question

What is the difference between an implicit and explicit relation?


1.3. Formula Implementation (Explicit Euler Method)

Question

Implement the explicit Euler method in Python to solve the ODE .

Use variables for the coefficients, setting them to , , , , and integrate with:


1.4. Formula Implementation (Implicit Euler Method)

Question

Implement the implicit Euler method in Python to solve the ODE from the previous question.


1.5. Error Calculation Against Analytical Solution

Question

For the same ODE from the previous two questions, compare the errors between the implicit and explicit Euler methods and plot each solution against time, along with the analytical solution: