Skip to content

Commit 86e0d2f

Browse files
authored
Merge pull request #116 from ComputationalScienceLaboratory/lorenz-96-documentation
Lorenz '96 documentation
2 parents 84e6d50 + 5923c8b commit 86e0d2f

File tree

9 files changed

+114
-32
lines changed

9 files changed

+114
-32
lines changed

docs/references.bib

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,18 @@ @inproceedings{Lor96
105105
volume={1},
106106
number={1},
107107
year={1996},
108-
organization={Reading}
108+
organization={Reading},
109+
doi={10.1017/CBO9780511617652.004}
110+
}
111+
112+
@article{PS19,
113+
title={A Bayesian approach to multivariate adaptive localization in ensemble-based data assimilation with time-dependent extensions},
114+
author={Popov, Andrey A and Sandu, Adrian},
115+
journal={Nonlinear Processes in Geophysics},
116+
volume={26},
117+
number={2},
118+
pages={109--122},
119+
year={2019},
120+
publisher={Copernicus Publications G{\"o}ttingen, Germany},
121+
doi={10.5194/npg-26-109-2019}
109122
}

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef Canonical < otp.lorenz63.Lorenz63Problem
22
% Original Lorenz '63 preset presented in :cite:p:`Lor63`
3-
% which uses time span $t \in [0, 60]$, $\sigma = 10$, $\rho = 28$,
4-
% $\beta = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
3+
% which uses time span $t \in [0, 60]$, $σ = 10$, $ρ = 28$,
4+
% $β = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
55

66
methods
77
function obj = Canonical(varargin)
@@ -12,14 +12,10 @@
1212
% varargin
1313
% A variable number of name-value pairs. The accepted names are
1414
%
15-
% - ``sigma`` – Value of $\sigma$.
16-
% - ``rho`` – Value of $\rho$.
17-
% - ``beta`` – Value of $\beta$.
15+
% - ``sigma`` – Value of $σ$.
16+
% - ``rho`` – Value of $ρ$.
17+
% - ``beta`` – Value of $β$.
1818
%
19-
% Returns
20-
% -------
21-
% obj : Lorenz63Problem
22-
% The constructed problem.
2319

2420
p = inputParser;
2521
p.addParameter('sigma', 10);

toolbox/+otp/+lorenz63/+presets/LimitCycle.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
classdef LimitCycle < otp.lorenz63.Lorenz63Problem
22
% Lorenz '63 preset limit cycle, a non-chaotic preset, from :cite:p:`Str18`
3-
% which uses time span $t \in [0, 60]$, $\sigma = 10$, $\rho = 350$,
4-
% $\beta = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
3+
% which uses time span $t \in [0, 60]$, $σ = 10$, $ρ = 350$,
4+
% $β = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
55

66
methods
77
function obj = LimitCycle
8+
% Create the LimitCycle Lorenz '63 problem object.
9+
%
10+
811
sigma = 10;
912
rho = 350;
1013
beta = 8/3;

toolbox/+otp/+lorenz63/+presets/Surprise.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
classdef Surprise < otp.lorenz63.Lorenz63Problem
22
% Lorenz '63 preset 'surprise' from :cite:p:`Str18` which uses time span $t \in [0, 60]$,
3-
% $\sigma = 10$, $\rho = 100$, $\beta = 8/3$, and intial conditions $y_0 = [2, 1, 1]^T$.
3+
% $σ = 10$, $ρ = 100$, $β = 8/3$, and intial conditions $y_0 = [2, 1, 1]^T$.
44

55
methods
66
function obj = Surprise
7+
% Create the Surprise Lorenz '63 problem object.
8+
%
79

810
sigma = 10;
911
rho = 100;

toolbox/+otp/+lorenz63/Lorenz63Problem.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
% The three variable Lorenz '63 problem :cite:p:`Lor63` of the form,
55
%
66
% $$
7-
% x' &= \sigma(y - x),\\
8-
% y' &= \rho x - y - xz,\\
9-
% z' &= xy - \beta z,
7+
% x' &= σ(y - x),\\
8+
% y' &= ρx - y - xz,\\
9+
% z' &= xy - βz,
1010
% $$
1111
%
1212
% exhibits chaotic behavior for certain values of the parameters.
@@ -23,7 +23,7 @@
2323
% +---------------------+-----------------------------------------------------------+
2424
% | Number of Variables | 3 |
2525
% +---------------------+-----------------------------------------------------------+
26-
% | Stiff | not typically, depending on $\sigma$, $\rho$, and $\beta$ |
26+
% | Stiff | not typically, depending on $σ$, $ρ$, and $β$ |
2727
% +---------------------+-----------------------------------------------------------+
2828
%
2929
% Example

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
classdef Canonical < otp.lorenz96.Lorenz96Problem
2-
%CANONICAL This is the original problem presented in the literature.
3-
% The initial condition is a slight perturbation of a critical point.
4-
%
5-
% See:
6-
% Lorenz, E. N. (1996, September). Predictability: A problem partly solved.
7-
% In Proc. Seminar on predictability (Vol. 1, No. 1).
2+
% Original Lorenz '96 preset presented in :cite:p:`Lor96`
3+
% 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_{\lfloor N/2 \rfloor}=8.008$.
5+
86
methods
97
function obj = Canonical(varargin)
8+
% Create a Canonial problem object.
9+
%
10+
% Parameters
11+
% ----------
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.
18+
%
1019

1120
p = inputParser;
1221
p.addParameter('Size', 40, @isscalar);

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
classdef PopovSandu < otp.lorenz96.Lorenz96Problem
2-
%POPOVSANDU
3-
% Used in https://doi.org/10.5194/npg-26-109-2019
2+
% A preset that has a cyclic forcing function that is different for
3+
% every variable. This preset was created for :cite:p:`PS19`.
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_{\lfloor N/2 \rfloor}=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.
414

515
methods
616
function obj = PopovSandu(varargin)
17+
% Create a PopovSandu problem object.
18+
%
19+
% Parameters
20+
% ----------
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.
27+
%
728

829
p = inputParser;
930

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
classdef Lorenz96Parameters
2-
%LORENZ96PARAMETERS User-configurable parameters for the Lorenz 96 problem
3-
%
4-
% See also otp.lorenz96.Lorenz96Problem
2+
% Parameters for the Lorenz '96 problem.
53

64
properties
7-
%F is a forcing function, scalar, or vector
5+
% A forcing function, scalar, or vector.
86
F %MATLAB ONLY: {mustBeA(F, {'numeric','function_handle'})}
97
end
108
end

toolbox/+otp/+lorenz96/Lorenz96Problem.m

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,54 @@
11
classdef Lorenz96Problem < otp.Problem
2-
%LORENZ96PROBLEM The Lorenz 96 model is a classic model for testing data assimilation techniques.
2+
% A chaotic system modeling nonlinear transfer of a dimensionless
3+
% quantity along a cyclic one dimensional domain.
34
%
4-
% See also otp.loren96.Lorenz96Parameters
5+
% The $N$ variable dynamics :cite:p:`Lor96` are represented by the equation,
6+
%
7+
% $$
8+
% y_i' = -y_{i-1}\left(y_{i-2} - y_{i+1}\right) - y_i + f(t), \quad i = 1, \dots, N,
9+
% $$
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$.
14+
%
15+
% Notes
16+
% -----
17+
% +---------------------+-----------------------------------------------------------+
18+
% | Type | ODE |
19+
% +---------------------+-----------------------------------------------------------+
20+
% | Number of Variables | $N$ for any postive integer four or greater |
21+
% +---------------------+-----------------------------------------------------------+
22+
% | Stiff | no |
23+
% +---------------------+-----------------------------------------------------------+
24+
%
25+
% Example
26+
% -------
27+
% >>> problem = otp.lorenz96.presets.Canonical('Forcing', @(t) 8 + 4*sin(t));
28+
% >>> sol = problem.solve();
29+
% >>> problem.movie(sol);
30+
%
31+
% See also
32+
% --------
33+
% :doc:`Lorenz '63 Problem </problems/Lorenz63Problem>`
534

635
properties (SetAccess = private)
736
DistanceFunction
837
end
938

1039
methods
1140
function obj = Lorenz96Problem(timeSpan, y0, parameters)
41+
% Create a Lorenz '96 problem object.
42+
%
43+
% Parameters
44+
% ----------
45+
% timeSpan : numeric(1, 2)
46+
% The start and final time.
47+
% y0 : numeric(:, 1)
48+
% The initial conditions.
49+
% parameters : Lorenz96Parameters
50+
% The parameters.
51+
%
1252
obj@otp.Problem('Lorenz 96', [], timeSpan, y0, parameters);
1353
end
1454
end
@@ -37,7 +77,7 @@
3777
'Vectorized', 'on');
3878

3979
% We also provide a canonical distance function as is standard for
40-
% localisation in Data Assimilation. This is heavily tied to this
80+
% localization in Data Assimilation. This is heavily tied to this
4181
% problem.
4282

4383
obj.DistanceFunction = @(t, y, i, j) otp.lorenz96.distanceFunction(t, y, i, j);

0 commit comments

Comments
 (0)