7017
|
1 # Copyright (C) 2002, 2005, 2007 John W. Eaton |
|
2 # |
|
3 # This file is part of Octave. |
|
4 # |
|
5 # Octave is free software; you can redistribute it and/or modify it |
|
6 # under the terms of the GNU General Public License as published by the |
|
7 # Free Software Foundation; either version 3 of the License, or (at |
|
8 # your option) any later version. |
|
9 # |
|
10 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License |
|
16 # along with Octave; see the file COPYING. If not, see |
|
17 # <http://www.gnu.org/licenses/>. |
|
18 |
3998
|
19 CLASS = "LSODE" |
|
20 |
4044
|
21 INCLUDE = "ODE.h" |
|
22 |
3998
|
23 OPTION |
|
24 NAME = "absolute tolerance" |
4051
|
25 DOC_ITEM |
|
26 Absolute tolerance. May be either vector or scalar. If a vector, it |
|
27 must match the dimension of the state vector. |
|
28 END_DOC_ITEM |
3998
|
29 TYPE = "Array<double>" |
|
30 SET_ARG_TYPE = "const $TYPE&" |
|
31 INIT_BODY |
|
32 $OPTVAR.resize (1); |
|
33 $OPTVAR(0) = ::sqrt (DBL_EPSILON); |
|
34 END_INIT_BODY |
|
35 SET_CODE |
|
36 void set_$OPT (double val) |
|
37 { |
|
38 $OPTVAR.resize (1); |
|
39 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); |
4049
|
40 reset = true; |
3998
|
41 } |
|
42 |
|
43 void set_$OPT (const $TYPE& val) |
4049
|
44 { $OPTVAR = val; reset = true; } |
3998
|
45 END_SET_CODE |
|
46 END_OPTION |
|
47 |
|
48 OPTION |
4051
|
49 NAME = "relative tolerance" |
|
50 DOC_ITEM |
|
51 Relative tolerance parameter. Unlike the absolute tolerance, this |
|
52 parameter may only be a scalar. |
|
53 |
|
54 The local error test applied at each integration step is |
|
55 |
|
56 @example |
|
57 abs (local error in x(i)) <= rtol * abs (y(i)) + atol(i) |
|
58 @end example |
|
59 END_DOC_ITEM |
|
60 TYPE = "double" |
|
61 INIT_VALUE = "::sqrt (DBL_EPSILON)" |
|
62 SET_EXPR = "(val > 0.0) ? val : ::sqrt (DBL_EPSILON)" |
|
63 END_OPTION |
|
64 |
|
65 OPTION |
3998
|
66 NAME = "integration method" |
4231
|
67 DOC_ITEM |
7007
|
68 A string specifying the method of integration to use to solve the ODE |
4051
|
69 system. Valid values are |
|
70 |
|
71 @table @asis |
|
72 @item \"adams\" |
|
73 @itemx \"non-stiff\" |
|
74 No Jacobian used (even if it is available). |
|
75 @item \"bdf\" |
|
76 @item \"stiff\" |
|
77 Use stiff backward differentiation formula (BDF) method. If a |
|
78 function to compute the Jacobian is not supplied, @code{lsode} will |
|
79 compute a finite difference approximation of the Jacobian matrix. |
|
80 @end table |
|
81 END_DOC_ITEM |
3998
|
82 TYPE = "std::string" |
|
83 SET_ARG_TYPE = "const $TYPE&" |
|
84 INIT_VALUE = ""stiff"" |
|
85 SET_BODY |
|
86 if (val == "stiff" || val == "bdf") |
|
87 $OPTVAR = "stiff"; |
|
88 else if (val == "non-stiff" || val == "adams") |
|
89 $OPTVAR = "non-stiff"; |
|
90 else |
|
91 (*current_liboctave_error_handler) |
|
92 ("lsode_options: method must be \"stiff\", \"bdf\", \"non-stiff\", or \"adams\""); |
|
93 END_SET_BODY |
|
94 END_OPTION |
|
95 |
|
96 OPTION |
|
97 NAME = "initial step size" |
4051
|
98 DOC_ITEM |
|
99 The step size to be attempted on the first step (default is determined |
|
100 automatically). |
|
101 END_DOC_ITEM |
3998
|
102 TYPE = "double" |
|
103 INIT_VALUE = "-1.0" |
|
104 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
105 END_OPTION |
|
106 |
|
107 OPTION |
4231
|
108 NAME = "maximum order" |
|
109 DOC_ITEM |
|
110 Restrict the maximum order of the solution method. If using the Adams |
|
111 method, this option must be between 1 and 12. Otherwise, it must be |
|
112 between 1 and 5, inclusive. |
|
113 END_DOC_ITEM |
5275
|
114 TYPE = "octave_idx_type" |
4231
|
115 INIT_VALUE = "-1" |
|
116 SET_EXPR = "val" |
|
117 END_OPTION |
|
118 |
|
119 OPTION |
3998
|
120 NAME = "maximum step size" |
4051
|
121 DOC_ITEM |
|
122 Setting the maximum stepsize will avoid passing over very large |
|
123 regions (default is not specified). |
|
124 END_DOC_ITEM |
3998
|
125 TYPE = "double" |
|
126 INIT_VALUE = "-1.0" |
|
127 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
128 END_OPTION |
|
129 |
|
130 OPTION |
|
131 NAME = "minimum step size" |
4051
|
132 DOC_ITEM |
|
133 The minimum absolute step size allowed (default is 0). |
|
134 END_DOC_ITEM |
3998
|
135 TYPE = "double" |
|
136 INIT_VALUE = "0.0" |
|
137 SET_EXPR = "(val >= 0.0) ? val : 0.0" |
|
138 END_OPTION |
|
139 |
|
140 OPTION |
|
141 NAME = "step limit" |
4051
|
142 DOC_ITEM |
|
143 Maximum number of steps allowed (default is 100000). |
|
144 END_DOC_ITEM |
5275
|
145 TYPE = "octave_idx_type" |
3998
|
146 INIT_VALUE = "100000" |
|
147 SET_EXPR = "val" |
|
148 END_OPTION |