MTH3007B Weekly Problems 2

Original Documents: Problem Sheet

Vibes: Pretty chill, basically just the same as last week and scaling errors.

Used Techniques:

  • Scaling errors.
  • Implementing Euler methods.

2.1. Scaling Error in Different Methods

Question

Assume you solve a differential equation, , using the Explicit Euler method using a step size of . Also assume the (global) error is exactly as in the linear regime and the error in is .

  1. What would the error be if ?
  2. What would the error be if and Ralston is used, instead? Assume an error of for .

The global error scales with the timestep according to the order of the method…

  1. For Forward Euler, a first order method, then . Hence, halving the step size halves the error: .
  2. For Ralston, a second order method, then . Hence, halving the step size quarters the error: .

2.2. Numerical Solutions of an ODE

Question

Consider the ordinary differential equation, with , , and .

  1. By using a numerical algorithm, solve the ODE till , then compare with the analytical solution .
  2. What is for the Ralston method for ?
  1. Using the Explicit Euler method, the solution is . Analytically, the solution is approximately - a difference of about
  2. Instead, using the Ralston method, the solution is instead , giving a smaller max error of .

2.3. Finding Maximum Timestep for a Given Error in Euler

Question

Assume you want to have an accuracy in the final solution of , such that the numerical result of can deviate at most from the analytical solution.

What is the maximum timestep for the Explicit Euler method to achieve the accuracy in , with one significant figure accuracy?

Using the linear error scaling for Euler with the known error at


2.4. Finding Maximum Timestep for a Given Error in Ralston

Question

What is the maximum timestep for Ralston’s method to achieve the accuracy in , with one significant figure accuracy?

Using the quadratic error scaling of Ralston with the known error at

This is apparently incorrect - naive scaling?