Prothero–Robinson

class otp.protherorobinson.ProtheroRobinsonProblem

Bases: otp.Problem

The prototypical test problem for analyzing order reduction due to stiffness.

The Prothero–Robinson problem [PR74] is the linear ODE

\[y' = λ (y - φ(t)) + φ'(t).\]

This simple problem is used to test for order reduction and S-stability of time-stepping schemes. With initial condition \(y(t_0) = φ(t_0)\), the exact solution is \(y(t) = φ(t)\) independent of \(λ\). Therefore, any errors introduced by the numerical scheme can be measured easily.

Notes

Type

ODE

Number of Variables

1

Stiff

typically, depending on \(λ\)

Example

>>> p = otp.protherorobinson.presets.Canonical(-10);
>>> sol = p.solve();
>>> norm(p.solveExactly(sol.x) - sol.y)
Constructor Summary
ProtheroRobinsonProblem(timeSpan, y0, parameters)

Create a Prothero–Robinson problem object.

Parameters:
  • timeSpan (numeric(1, 2)) – The start and final time.

  • y0 (numeric(:, 2)) – The initial conditions.

  • parameters (ProtheroRobinsonParameters) – The parameters.

Parameters

class otp.protherorobinson.ProtheroRobinsonParameters

Bases: otp.Parameters

Parameters for the Prothero–Robinson problem.

Constructor Summary
ProtheroRobinsonParameters(varargin)

Create a Prothero–Robinson parameters object.

Parameters:

varargin – A variable number of name-value pairs. A name can be any property of this class, and the subsequent value initializes that property.

Property Summary
Lambda

The stiffness parameter and eigenvalue of the Jacobian \(λ\).

Phi

The function \(φ(t)\).

DPhi

The time derivative of \(φ(t)\).

Presets

class otp.protherorobinson.presets.Canonical

Bases: otp.protherorobinson.ProtheroRobinsonProblem

The Prothero–Robinson configuration from [PR74] (p. 159) based on [SLH70] (p. 272). It uses time span \(t ∈ [0, 15]\), initial condition \(y(0) = φ(0)\), and parameters

\[\begin{split} λ &= -200, \\ φ(t) &= 10 - (10 + t) e^{-t}. \end{split}\]

Constructor Summary
Canonical(varargin)

Create the canonical Prothero–Robinson problem object.

Parameters:

varargin

A variable number of name-value pairs. The accepted names are

  • Lambda – The stiffness parameter and eigenvalue of the Jacobian \(λ\).

  • Phi – The exact solution.

  • DPhi – The time derivative of \(φ(t)\).