Skip to content

Commit cce57cb

Browse files
committed
fixes based on past conversations
1 parent 500472e commit cce57cb

File tree

3 files changed

+34
-38
lines changed

3 files changed

+34
-38
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
classdef Canonical < otp.lorenz96.Lorenz96Problem
22
% Original Lorenz '96 preset presented in :cite:p:`Lor96`
33
% which uses time span $t \in [0, 720]$, $N = 40$, $F=8$, and initial
4-
% conditions of $y_i = 8$ for all $i$ except for $y_20=8.008$.
4+
% conditions of $y_i = 8$ for all $i$ except for $y_{20}=8.008$.
55

66
methods
77
function obj = Canonical(varargin)
88
% Create a Canonial problem object.
99
%
1010
% Parameters
1111
% ----------
12-
% Size : numeric(1, 1)
13-
% The size of the problem as a positive integer.
14-
% Forcing : numeric(N, 1)
15-
% The forcing as a vector of N constants.
12+
% varargin
13+
% A variable number of name-value pairs. The accepted names are
14+
%
15+
% - ``Size`` – The size of the problem as a positive integer.
16+
% - ``Forcing`` – The forcing as a scalar, vector of N constants, or as a
17+
% function.
1618
%
17-
% Returns
18-
% -------
19-
% obj : Canonial
20-
% The constructed problem.
2119

2220
p = inputParser;
2321
p.addParameter('Size', 40, @isscalar);

toolbox/+otp/+lorenz96/+presets/PopovSandu.m

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
classdef PopovSandu < otp.lorenz96.Lorenz96Problem
22
% A preset that has a cyclic forcing function that is different for
33
% every variable. This preset was created for :cite:p:`PS19`.
4-
% This preset uses time span $t \in [0, 720]$, $N = 40$, $F=8$,
5-
% four partitions, a forcing period of one time unit, and initial
6-
% conditions of $y_i = 8$ for all $i$ except for $y_20=8.008$.
4+
% This preset uses time span $t \in [0, 720]$, $N = 40$, and initial
5+
% conditions of $y_i = 8$ for all $i$ except for $y_{20}=8.008$.
6+
% The forcing, as a function of time is given by
7+
%
8+
% $$
9+
% f(t) = 8 + 4\cos(2 \pi \omega (t+\text{mod}(i - 1, q)/q))
10+
% $$
11+
%
12+
% where by default $q=4$ is the number of partitions, and $\omega = 1$
13+
% is a forcing period of one time unit.
714

815
methods
916
function obj = PopovSandu(varargin)
1017
% Create a PopovSandu problem object.
1118
%
1219
% Parameters
1320
% ----------
14-
% Size : numeric(1, 1)
15-
% The size of the problem as a positive integer.
16-
% Partitions : numeric(1, 1)
17-
% The number of partitions into which to divide the
18-
% variables.
19-
% ForcingPeriod : numeric(1, 1)
20-
% The period of the forcing function in radians per unit
21-
% time.
21+
% varargin
22+
% A variable number of name-value pairs. The accepted names are
23+
%
24+
% - ``Size`` – The size of the problem as a positive integer.
25+
% - ``Partitions`` – The number of partitions into which to divide the variables.
26+
% - ``ForcingPeriod`` – The period of the forcing function in radians per unit time.
2227
%
23-
% Returns
24-
% -------
25-
% obj : PopovSandu
26-
% The constructed problem.
2728

2829
p = inputParser;
2930

toolbox/+otp/+lorenz96/Lorenz96Problem.m

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
classdef Lorenz96Problem < otp.Problem
2-
% A chaotic system modeling the transfer of some quantity along some
3-
% longitude.
4-
%
5-
%
2+
% A chaotic system modeling nonlinear transfer of a dimensionless
3+
% qauntity along a cyclic one dimensional domain.
4+
%
65
% The $N$ variable dynamics :cite:p:`Lor96` are represented by the equation,
76
%
87
% $$
9-
% y_i' = -y_{i-1}\left(y_{i-2} - y_{i+1}\right) - y_i + f(t),\quad i \in \mathbb{Z}_N,
8+
% y_i' = -y_{i-1}\left(y_{i-2} - y_{i+1}\right) - y_i + f(t), \quad i = 1, \dots, N,
109
% $$
11-
%
12-
% that exhibits chaotic behavior for certain values of the forcing function $f$.
10+
%
11+
% where $y_0 = y_N$, $y_{-1} = y_{N - 1}$, and $y_{N + 1} = y_2$, exhibits
12+
% chaotic behavior for certain pairs of values of the dimension $N$ and
13+
% forcing function $f$.
1314
%
1415
% Notes
1516
% -----
1617
% +---------------------+-----------------------------------------------------------+
1718
% | Type | ODE |
1819
% +---------------------+-----------------------------------------------------------+
19-
% | Number of Variables | $N$ |
20+
% | Number of Variables | $N$ for any postive integer four or greater |
2021
% +---------------------+-----------------------------------------------------------+
2122
% | Stiff | no |
2223
% +---------------------+-----------------------------------------------------------+
@@ -25,7 +26,7 @@
2526
% -------
2627
% >>> problem = otp.lorenz96.presets.Canonical('Forcing', @(t) 8 + 4*sin(t));
2728
% >>> sol = problem.solve();
28-
% >>> problem.plotPhaseSpace(sol);
29+
% >>> problem.movie(sol);
2930
%
3031
% See also
3132
% --------
@@ -43,15 +44,11 @@
4344
% ----------
4445
% timeSpan : numeric(1, 2)
4546
% The start and final time.
46-
% y0 : numeric(N, 1)
47+
% y0 : numeric(:, 1)
4748
% The initial conditions.
4849
% parameters : Lorenz96Parameters
4950
% The parameters.
5051
%
51-
% Returns
52-
% -------
53-
% obj : Lorenz96Problem
54-
% The constructed problem.
5552
obj@otp.Problem('Lorenz 96', [], timeSpan, y0, parameters);
5653
end
5754
end

0 commit comments

Comments
 (0)