Skip to content

Commit 3d932af

Browse files
committed
docs for Ascher linear DAE
1 parent cd53d2b commit 3d932af

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
classdef Canonical < otp.ascherlineardae.AscherLinearDAEProblem
2-
%CANONICAL The problem formulation of the linear DAE from the literature
3-
%
4-
% See
5-
% Ascher, Uri. "On symmetric schemes and differential-algebraic equations."
6-
% SIAM journal on scientific and statistical computing 10.5 (1989): 937-949.
7-
2+
% The original problem defined by Uri Ascher in :cite:p:`Asc89` with
3+
% $\beta = 0.5$
4+
%
85
methods
96
function obj = Canonical(beta)
107
tspan = [0.0; 1];
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
classdef AscherLinearDAEParameters
2-
%ASCHERLINEARDAEPARAMETERS
2+
% Parameters for Ascher Linear DAE problem
33
properties
4-
%Beta is an arbitrary scalar parameter
4+
% Beta is a scalar parameter in the linear model. It also affects the initial condition
5+
% of the algebraic variable.
56
Beta %MATLAB ONLY: (1,1) {mustBeNumeric} = 0.5
67
end
78
end

toolbox/+otp/+ascherlineardae/AscherLinearDAEProblem.m

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
classdef AscherLinearDAEProblem < otp.Problem
22
% A simple linear differential algebraic problem.
33
%
4-
% The Ascher linear DAE Problem :cite:p:`Asc89` is given by $M(t) y' = A(t) y + q(t) $ with
4+
% The Ascher linear DAE Problem :cite:p:`Asc89` is an index-1 differential agebraic
5+
% equation given by $M(t) y' = A(t) y + q(t) $ where
56
%
67
% $$
78
% M=\left(\begin{array}{cc}
@@ -16,7 +17,7 @@
1617
% \end{array}\right),
1718
% $$
1819
%
19-
% with $t \in [0,1]$, and $y_0 = [1, \beta]^T$. The exact solution
20+
% defined on timespan $t \in [0,1]$, and initial condition $y_0 = [1, \beta]^T$. The exact solution
2021
% is given by
2122
%
2223
% $$
@@ -27,9 +28,9 @@
2728
% $$
2829
%
2930
% Due to its stiffness and time-dependant mass
30-
% matrix and righ-hand-side function, this simple DAE problem can
31-
% become challenging to solve. This problem is used in :cite:p:`Asc89`
32-
% to study convergence of implcit solvers.
31+
% matrix, this simple DAE problem can
32+
% become challenging to solve. This problem is introduced in :cite:p:`Asc89`
33+
% to study the convergence of implcit solvers applied to DAEs.
3334
%
3435
% Notes
3536
% -----
@@ -43,10 +44,15 @@
4344
%
4445
% Example
4546
% -------
46-
% >>> problem = otp.ascherlineardae.presets.Canonical;
47-
% >>> sol = problem.solve();
47+
% >>> problem = otp.ascherlineardae.presets.Canonical(0.1);
48+
% >>> sol = problem.solve('MaxStep',1e-5);
4849
% >>> problem.plotPhaseSpace(sol);
49-
%
50+
51+
properties (Access = private, Constant)
52+
NumComps = 2
53+
VarNames = 'yz'
54+
end
55+
5056
methods
5157
function obj = AscherLinearDAEProblem(timeSpan, y0, parameters)
5258
% Create an Ascher linear DAE problem object.
@@ -57,12 +63,12 @@
5763
% The start and final time.
5864
% y0 : numeric(2, 1)
5965
% The initial conditions.
60-
% parameters : BrusselatorParameters
66+
% parameters : AscherLinearDAEParameters
6167
% The parameters.
6268
%
6369
% Returns
6470
% -------
65-
% obj : BrusselatorProblem
71+
% obj : AscherLinearDAEProblem
6672
% The constructed problem.
6773
obj@otp.Problem('Ascher Linear DAE', 2, timeSpan, y0, parameters);
6874
end

0 commit comments

Comments
 (0)