Skip to content

Commit de55bd1

Browse files
Add ROBER preset
1 parent dd3d7b3 commit de55bd1

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

toolbox/+otp/+robertson/+presets/Canonical.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
classdef Canonical < otp.robertson.RobertsonProblem
2-
% The Robertson problem with the classic coefficients $K_1 = 4\times 10^{-2}$, $K_2 = 3\times 10^7$, $K_3 = 10^4$ :cite:p:`Rob67`. This preset is
3-
% referred to as "ROBER" in :cite:p:`HW96` (pg 144).
2+
% The original configuration :cite:p:`Rob67` with $t \in [0, 40]$, $y_0 = [1, 0, 0]^T$, and parameters
3+
%
4+
% $$
5+
% K_1 &= 4\times 10^{-2}, \\
6+
% K_2 &= 3\times 10^7, \\
7+
% K_3 &= 10^4.
8+
% $$
49
methods
510
function obj = Canonical
611
% Create the Canonical Robertson problem object.
@@ -19,7 +24,7 @@
1924
params.K3 = 1e4;
2025

2126
y0 = [1; 0; 0];
22-
tspan = [0; 1e11];
27+
tspan = [0, 40];
2328

2429
obj = obj@otp.robertson.RobertsonProblem(tspan, y0, params);
2530
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
classdef ROBER < otp.robertson.RobertsonProblem
2+
% The Robertson configuration from :cite:p:`HW96` (p. 144). This differs from :class:`Canonical` only in the time
3+
% span which is extended to $[0, 10^{11}]$. This presents a challenge for numerical integrators to preserve solution
4+
% positivity.
5+
methods
6+
function obj = ROBER
7+
% Create the ROBER Robertson problem object.
8+
%
9+
% Parameters
10+
% ----------
11+
%
12+
% Returns
13+
% -------
14+
% obj : RobertsonProblem
15+
% The constructed problem.
16+
17+
params = otp.robertson.RobertsonParameters;
18+
params.K1 = 0.04;
19+
params.K2 = 3e7;
20+
params.K3 = 1e4;
21+
22+
y0 = [1; 0; 0];
23+
tspan = [0; 1e11];
24+
25+
obj = obj@otp.robertson.RobertsonProblem(tspan, y0, params);
26+
end
27+
28+
end
29+
end

0 commit comments

Comments
 (0)