Skip to content

Commit 500472e

Browse files
committed
First draft of lorenz 96 docs
1 parent dd3d7b3 commit 500472e

File tree

5 files changed

+102
-17
lines changed

5 files changed

+102
-17
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/+lorenz96/+presets/Canonical.m

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
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_20=8.008$.
5+
86
methods
97
function obj = Canonical(varargin)
8+
% Create a Canonial problem object.
9+
%
10+
% Parameters
11+
% ----------
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.
16+
%
17+
% Returns
18+
% -------
19+
% obj : Canonial
20+
% The constructed problem.
1021

1122
p = inputParser;
1223
p.addParameter('Size', 40, @isscalar);

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
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$, $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$.
47

58
methods
69
function obj = PopovSandu(varargin)
10+
% Create a PopovSandu problem object.
11+
%
12+
% Parameters
13+
% ----------
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.
22+
%
23+
% Returns
24+
% -------
25+
% obj : PopovSandu
26+
% The constructed problem.
727

828
p = inputParser;
929

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: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,57 @@
11
classdef Lorenz96Problem < otp.Problem
2-
%LORENZ96PROBLEM The Lorenz 96 model is a classic model for testing data assimilation techniques.
3-
%
4-
% See also otp.loren96.Lorenz96Parameters
2+
% A chaotic system modeling the transfer of some quantity along some
3+
% longitude.
4+
%
5+
%
6+
% The $N$ variable dynamics :cite:p:`Lor96` are represented by the equation,
7+
%
8+
% $$
9+
% y_i' = -y_{i-1}\left(y_{i-2} - y_{i+1}\right) - y_i + f(t),\quad i \in \mathbb{Z}_N,
10+
% $$
11+
%
12+
% that exhibits chaotic behavior for certain values of the forcing function $f$.
13+
%
14+
% Notes
15+
% -----
16+
% +---------------------+-----------------------------------------------------------+
17+
% | Type | ODE |
18+
% +---------------------+-----------------------------------------------------------+
19+
% | Number of Variables | $N$ |
20+
% +---------------------+-----------------------------------------------------------+
21+
% | Stiff | no |
22+
% +---------------------+-----------------------------------------------------------+
23+
%
24+
% Example
25+
% -------
26+
% >>> problem = otp.lorenz96.presets.Canonical('Forcing', @(t) 8 + 4*sin(t));
27+
% >>> sol = problem.solve();
28+
% >>> problem.plotPhaseSpace(sol);
29+
%
30+
% See also
31+
% --------
32+
% :doc:`Lorenz '63 Problem </problems/Lorenz63Problem>`
533

634
properties (SetAccess = private)
735
DistanceFunction
836
end
937

1038
methods
1139
function obj = Lorenz96Problem(timeSpan, y0, parameters)
40+
% Create a Lorenz '96 problem object.
41+
%
42+
% Parameters
43+
% ----------
44+
% timeSpan : numeric(1, 2)
45+
% The start and final time.
46+
% y0 : numeric(N, 1)
47+
% The initial conditions.
48+
% parameters : Lorenz96Parameters
49+
% The parameters.
50+
%
51+
% Returns
52+
% -------
53+
% obj : Lorenz96Problem
54+
% The constructed problem.
1255
obj@otp.Problem('Lorenz 96', [], timeSpan, y0, parameters);
1356
end
1457
end
@@ -37,7 +80,7 @@
3780
'Vectorized', 'on');
3881

3982
% We also provide a canonical distance function as is standard for
40-
% localisation in Data Assimilation. This is heavily tied to this
83+
% localization in Data Assimilation. This is heavily tied to this
4184
% problem.
4285

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

0 commit comments

Comments
 (0)