Robertson

class otp.robertson.RobertsonProblem

Bases: otp.Problem

A simple, stiff chemical reaction.

The Robertson problem [Rob66] is a simple, stiff chemical reaction that models the concentrations of chemical species \(\ce{A}\), \(\ce{B}\), and \(\ce{C}\) involved in the reactions

\[\begin{split} \ce{ A &->[$k_1$] B \\ B + B &->[$k_2$] C + B \\ B + C &->[$k_3$] A + C } \end{split}\]

These correspond to the ODE system,

\[\begin{split} y_1' &= -k_1 y_1 + k_3 y_2 y_3, \\ y_2' &= k_1 y_1 - k_2 y_2^2 - k_3 y_2 y_3, \\ y_3' &= k_2 y_2^2. \end{split}\]

The reaction rates \(k_1\), \(k_2\), and \(k_3\) often range from slow to very fast which makes the problem challenging. This has made it a popular test for implicit time-stepping schemes.

Notes

Type

ODE

Number of Variables

3

Stiff

typically, depending on \(k_1\), \(k_2\), and \(k_3\)

Example

>>> problem = otp.robertson.presets.Canonical;
>>> problem.Parameters.K1 = 100;
>>> problem.Parameters.K2 = 1000;
>>> problem.Parameters.K3 = 1000;
>>> sol = problem.solve();
>>> problem.plot(sol)
Constructor Summary
RobertsonProblem(timeSpan, y0, parameters)

Create a Robertson problem object.

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

  • y0 (numeric(3, 1)) – The initial conditions.

  • parameters (RobertsonParameters) – The parameters.

Parameters

class otp.robertson.RobertsonParameters

Bases: otp.Parameters

Parameters for the Robertson problem.

Constructor Summary
RobertsonParameters(varargin)

Create a Robertson 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
K1

The reaction rate \(k_1\).

K2

The reaction rate \(k_2\).

K3

The reaction rate \(k_3\).

Presets

class otp.robertson.presets.Canonical

Bases: otp.robertson.RobertsonProblem

The original configuration [Rob66] with \(t ∈ [0, 40]\), \(y_0 = [1, 0, 0]^T\), and parameters

\[\begin{split} k_1 &= 4 \times 10^{-2}, \\ k_2 &= 3 \times 10^7, \\ k_3 &= 10^4. \end{split}\]

Constructor Summary
Canonical(varargin)

Create the canonical Robertson problem object.

Parameters:

varargin

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

  • K1 – Value of \(k_1\).

  • K2 – Value of \(k_2\).

  • K3 – Value of \(k_3\).

class otp.robertson.presets.ROBER

Bases: otp.robertson.RobertsonProblem

The Robertson configuration from [HW96] (p. 144). This differs from Canonical only in the time span which is extended to \([0, 10^{11}]\). This presents a challenge for numerical integrators to preserve solution positivity.

Constructor Summary
ROBER()

Create the ROBER Robertson problem object.