1########################################################################
2##
3## Copyright (C) 2002-2021 The Octave Project Developers
4##
5## See the file COPYRIGHT.md in the top-level directory of this
6## distribution or <https://octave.org/copyright/>.
7##
8## This file is part of Octave.
9##
10## Octave is free software: you can redistribute it and/or modify it
11## under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14##
15## Octave is distributed in the hope that it will be useful, but
16## WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18## GNU General Public License for more details.
19##
20## You should have received a copy of the GNU General Public License
21## along with Octave; see the file COPYING.  If not, see
22## <https://www.gnu.org/licenses/>.
23##
24########################################################################
25
26CLASS = "DASRT"
27
28INCLUDE = "DAERT.h"
29
30OPTION
31  NAME = "absolute tolerance"
32  DOC_ITEM
33Absolute tolerance.  May be either vector or scalar.  If a vector, it
34must match the dimension of the state vector, and the relative
35tolerance must also be a vector of the same length.
36
37  END_DOC_ITEM
38  TYPE = "Array<double>"
39  SET_ARG_TYPE = "const $TYPE&"
40  INIT_BODY
41    $OPTVAR.resize (dim_vector (1, 1));
42    $OPTVAR(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
43  END_INIT_BODY
44  SET_CODE
45    void set_$OPT (double val)
46      {
47        $OPTVAR.resize (dim_vector (1, 1));
48        $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
49        reset = true;
50      }
51
52    void set_$OPT (const $TYPE& val)
53      { $OPTVAR = val; reset = true; }
54  END_SET_CODE
55END_OPTION
56
57OPTION
58  NAME = "relative tolerance"
59  DOC_ITEM
60Relative tolerance.  May be either vector or scalar.  If a vector, it
61must match the dimension of the state vector, and the absolute
62tolerance must also be a vector of the same length.
63
64The local error test applied at each integration step is
65
66@example
67@group
68  abs (local error in x(i)) <= ...
69      rtol(i) * abs (Y(i)) + atol(i)
70@end group
71@end example
72
73  END_DOC_ITEM
74  TYPE = "Array<double>"
75  SET_ARG_TYPE = "const $TYPE&"
76  INIT_BODY
77    $OPTVAR.resize (dim_vector (1, 1));
78    $OPTVAR(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
79  END_INIT_BODY
80  SET_CODE
81    void set_$OPT (double val)
82      {
83        $OPTVAR.resize (dim_vector (1, 1));
84        $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
85        reset = true;
86      }
87
88    void set_$OPT (const $TYPE& val)
89      { $OPTVAR = val; reset = true; }
90  END_SET_CODE
91END_OPTION
92
93OPTION
94  NAME = "initial step size"
95  DOC_ITEM
96Differential-algebraic problems may occasionally suffer from severe
97scaling difficulties on the first step.  If you know a great deal
98about the scaling of your problem, you can help to alleviate this
99problem by specifying an initial stepsize.
100
101  END_DOC_ITEM
102  TYPE = "double"
103  INIT_VALUE = "-1.0"
104  SET_EXPR = "(val >= 0.0) ? val : -1.0"
105END_OPTION
106
107OPTION
108  NAME = "maximum order"
109  DOC_ITEM
110Restrict the maximum order of the solution method.  This option must
111be between 1 and 5, inclusive.
112
113  END_DOC_ITEM
114  TYPE = "octave_idx_type"
115  INIT_VALUE = "-1"
116  SET_EXPR = "val"
117END_OPTION
118
119OPTION
120  NAME = "maximum step size"
121  DOC_ITEM
122Setting the maximum stepsize will avoid passing over very large
123regions.
124
125  END_DOC_ITEM
126  TYPE = "double"
127  INIT_VALUE = "-1.0"
128  SET_EXPR = "(val >= 0.0) ? val : -1.0"
129END_OPTION
130
131OPTION
132  NAME = "step limit"
133  DOC_ITEM
134Maximum number of integration steps to attempt on a single call to the
135underlying Fortran code.
136  END_DOC_ITEM
137  TYPE = "octave_idx_type"
138  INIT_VALUE = "-1"
139  SET_EXPR = "(val >= 0) ? val : -1"
140END_OPTION
141