Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: ODE Test Problems
Version: 0.0.1
Date: May 10, 2023
Version: 0.2.0
Date: November 7, 2023
depends: octave (>= 6.4.0)
Author: Steven Roberts, Andrey A. Popov, Arash Sarshar, Adrian Sandu
Maintainer: Steven Roberts
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
primary_domain = 'mat'
matlab_src_dir = '../toolbox'
matlab_keep_package_prefix = False
matlab_auto_link = 'basic'

autodoc_default_options = {
'member-order': 'bysource',
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_problem_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.. automodule:: +otp.{problem.parent.name}.+presets
''')

for preset in problem.parent.glob('+presets/*.m'):
for preset in sorted(problem.parent.glob('+presets/*.m')):
stream.write(f'''
.. autoclass:: {preset.stem}
:members:
Expand Down
84 changes: 78 additions & 6 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,16 @@ @Article{PR74
}


@Article{Rob67,
@Article{Rob66,
title={The Solution of a Set of Reaction Rate Equations},
author={Robertson, H.H.},
journal={Walsh, J., Ed., Numerical Analysis, An introduction},
year={1967},
year={1966},
pages= {178--182},
publisher = "Academic Press",
address = "Cambridge, Massachusetts",
volume={178182},
publisher = {Academic Press}
}


@article{SLH70,
author = {Seinfeld, J. H. and Lapidus, Leon and Hwang, Myungkyu},
title = {Review of Numerical Integration Techniques for Stiff Ordinary Differential Equations},
Expand Down Expand Up @@ -105,5 +104,78 @@ @inproceedings{Lor96
volume={1},
number={1},
year={1996},
organization={Reading}
organization={Reading},
doi={10.1017/CBO9780511617652.004}
}

@article{PS19,
title={A Bayesian approach to multivariate adaptive localization in ensemble-based data assimilation with time-dependent extensions},
author={Popov, Andrey A and Sandu, Adrian},
journal={Nonlinear Processes in Geophysics},
volume={26},
number={2},
pages={109--122},
year={2019},
publisher={Copernicus Publications G{\"o}ttingen, Germany},
doi={10.5194/npg-26-109-2019}
}

@article{FN74,
author = {Field, Richard J. and Noyes, Richard M.},
title = "{Oscillations in chemical systems. {IV}. {L}imit cycle behavior in a model of a real chemical reaction}",
journal = {The Journal of Chemical Physics},
volume = {60},
number = {5},
pages = {1877-1884},
year = {1974},
issn = {0021-9606},
doi = {10.1063/1.1681288}
}

@incollection{EH76,
title = {Comparing Numerical Methods for the Solution of Stiff Systems of {ODE}s Arising in Chemistry},
editor = {L. LAPIDUS and W.E. SCHIESSER},
booktitle = {Numerical Methods for Differential Systems},
publisher = {Academic Press},
pages = {45-66},
year = {1976},
isbn = {978-0-12-436640-4},
doi = {10.1016/B978-0-12-436640-4.50008-3},
author = {W.H. Enright and T.E. Hull}
}

@article{GW82,
author = {Björn A. Gottwald and Gerhard Wanner},
title ={Comparison of Numerical Methods for Stiff Differential Equations in Biology and Chemistry},
journal = {SIMULATION},
volume = {38},
number = {2},
pages = {61-66},
year = {1982},
doi = {10.1177/003754978203800206}
}


@article{Asc89,
author = {Ascher, Uri},
title = {On Symmetric Schemes and Differential-Algebraic Equations},
journal = {SIAM Journal on Scientific and Statistical Computing},
volume = {10},
number = {5},
pages = {937-949},
year = {1989},
doi = {10.1137/0910054}
}

@article{Pet86,
author = {L. R. Petzold},
journal = {SIAM Journal on Numerical Analysis},
number = {4},
pages = {837--852},
publisher = {Society for Industrial and Applied Mathematics},
title = {Order Results for Implicit Runge-Kutta Methods Applied to Differential/ Algebraic Systems},
volume = {23},
year = {1986},
url = {https://www.jstor.org/stable/2157625}
}

8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sphinx==6.2.1
sphinx-autobuild==2021.3.14
sphinx_rtd_theme==1.2.0
sphinxcontrib-matlabdomain==0.18.0
sphinx_rtd_theme==1.3.0
sphinxcontrib-matlabdomain==0.20.2
sphinxcontrib-napoleon==0.7
sphinx-math-dollar==1.2.1
sphinxcontrib-bibtex==2.5.0
myst-parser==1.0.0
pyyaml==6.0
myst-parser==2.0.0
pyyaml==6.0.1
4 changes: 3 additions & 1 deletion docs/structure/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ TODO
:maxdepth: 1
:glob:

*
problem
rhs
parameters
6 changes: 6 additions & 0 deletions docs/structure/parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Parameters
================================================================================

.. automodule:: +otp
.. autoclass:: Parameters
:members:
62 changes: 58 additions & 4 deletions notebooks/quick-start.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 15 additions & 17 deletions toolbox/+otp/+ascherlineardae/+presets/Canonical.m
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
classdef Canonical < otp.ascherlineardae.AscherLinearDAEProblem
%CANONICAL The problem formulation of the linear DAE from the literature
%
% See
% Ascher, Uri. "On symmetric schemes and differential-algebraic equations."
% SIAM journal on scientific and statistical computing 10.5 (1989): 937-949.

% The problem defined by Uri Ascher in :cite:p:`Asc89` (sec. 2) which uses time span $t ∈ [0, 1]$ and intial
% condition $[y_0, z_0]^T = [1, β]^T$.

methods
function obj = Canonical(beta)
tspan = [0.0; 1];

if nargin < 1
beta = 0.5;
end

params = otp.ascherlineardae.AscherLinearDAEParameters;
params.Beta = beta;

y0 = [1; beta];
function obj = Canonical(varargin)
% Create the Canonical Ascher Linear DAE problem object.
%
% Parameters
% ----------
% varargin
% A variable number of name-value pairs. The accepted names are
%
% - ``Beta`` – Value of $β$.

params = otp.ascherlineardae.AscherLinearDAEParameters('Beta', 1, varargin{:});
y0 = [1; params.Beta];
tspan = [0.0; 1.0];
obj = obj@otp.ascherlineardae.AscherLinearDAEProblem(tspan, y0, params);
end
end
Expand Down
15 changes: 15 additions & 0 deletions toolbox/+otp/+ascherlineardae/+presets/Petzold.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
classdef Petzold < otp.ascherlineardae.AscherLinearDAEProblem
% The Petzold DAE example :cite:p:`Pet86` as a special case of the Ascher linear DAE problem. This preset uses time
% span $t ∈ [0, 1]$ and $β = 0 $ with the initial condition $[y_0, z_0]^T = [1, 0]^T$.

methods
function obj = Petzold()
% Create the Petzold Ascher Linear DAE problem object.

params = otp.ascherlineardae.AscherLinearDAEParameters('Beta', 0);
y0 = [1; params.Beta];
tspan = [0.0; 1.0];
obj = obj@otp.ascherlineardae.AscherLinearDAEProblem(tspan, y0, params);
end
end
end
15 changes: 15 additions & 0 deletions toolbox/+otp/+ascherlineardae/+presets/Stiff.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
classdef Stiff < otp.ascherlineardae.AscherLinearDAEProblem
% The Stiff example from :cite:p:`Asc89`. A variant of the Ascher linear DAE problem which uses time span
% $t ∈ [0, 1]$ and $β = 100$ with the initial condition $[y_0, z_0]^T = [1, 100]^T$.

methods
function obj = Stiff()
% Create the stiff Ascher Linear DAE problem object.

params = otp.ascherlineardae.AscherLinearDAEParameters('Beta', 100);
y0 = [1; params.Beta];
tspan = [0.0; 1.0];
obj = obj@otp.ascherlineardae.AscherLinearDAEProblem(tspan, y0, params);
end
end
end
22 changes: 18 additions & 4 deletions toolbox/+otp/+ascherlineardae/AscherLinearDAEParameters.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
classdef AscherLinearDAEParameters
%ASCHERLINEARDAEPARAMETERS
classdef AscherLinearDAEParameters < otp.Parameters
% Parameters for Ascher Linear DAE problem
properties
%Beta is an arbitrary scalar parameter
Beta %MATLAB ONLY: (1,1) {mustBeNumeric} = 0.5
% A scalar parameter $β$ in the linear model. It affects the stifness of the problem.
Beta %MATLAB ONLY: (1,1) {mustBeNumeric} = 1
end

methods
function obj = AscherLinearDAEParameters(varargin)
% Create a Ascher Linear DAE 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.

obj = obj@otp.Parameters(varargin{:});
end
end
end
Loading