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 |
7081
|
57 abs (local error in x(i)) <= ... |
|
58 rtol * abs (y(i)) + atol(i) |
4051
|
59 @end example |
|
60 END_DOC_ITEM |
|
61 TYPE = "double" |
|
62 INIT_VALUE = "::sqrt (DBL_EPSILON)" |
|
63 SET_EXPR = "(val > 0.0) ? val : ::sqrt (DBL_EPSILON)" |
|
64 END_OPTION |
|
65 |
|
66 OPTION |
3998
|
67 NAME = "integration method" |
4231
|
68 DOC_ITEM |
7007
|
69 A string specifying the method of integration to use to solve the ODE |
4051
|
70 system. Valid values are |
|
71 |
|
72 @table @asis |
|
73 @item \"adams\" |
|
74 @itemx \"non-stiff\" |
|
75 No Jacobian used (even if it is available). |
|
76 @item \"bdf\" |
|
77 @item \"stiff\" |
|
78 Use stiff backward differentiation formula (BDF) method. If a |
|
79 function to compute the Jacobian is not supplied, @code{lsode} will |
|
80 compute a finite difference approximation of the Jacobian matrix. |
|
81 @end table |
|
82 END_DOC_ITEM |
3998
|
83 TYPE = "std::string" |
|
84 SET_ARG_TYPE = "const $TYPE&" |
|
85 INIT_VALUE = ""stiff"" |
|
86 SET_BODY |
|
87 if (val == "stiff" || val == "bdf") |
|
88 $OPTVAR = "stiff"; |
|
89 else if (val == "non-stiff" || val == "adams") |
|
90 $OPTVAR = "non-stiff"; |
|
91 else |
|
92 (*current_liboctave_error_handler) |
|
93 ("lsode_options: method must be \"stiff\", \"bdf\", \"non-stiff\", or \"adams\""); |
|
94 END_SET_BODY |
|
95 END_OPTION |
|
96 |
|
97 OPTION |
|
98 NAME = "initial step size" |
4051
|
99 DOC_ITEM |
|
100 The step size to be attempted on the first step (default is determined |
|
101 automatically). |
|
102 END_DOC_ITEM |
3998
|
103 TYPE = "double" |
|
104 INIT_VALUE = "-1.0" |
|
105 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
106 END_OPTION |
|
107 |
|
108 OPTION |
4231
|
109 NAME = "maximum order" |
|
110 DOC_ITEM |
|
111 Restrict the maximum order of the solution method. If using the Adams |
|
112 method, this option must be between 1 and 12. Otherwise, it must be |
|
113 between 1 and 5, inclusive. |
|
114 END_DOC_ITEM |
5275
|
115 TYPE = "octave_idx_type" |
4231
|
116 INIT_VALUE = "-1" |
|
117 SET_EXPR = "val" |
|
118 END_OPTION |
|
119 |
|
120 OPTION |
3998
|
121 NAME = "maximum step size" |
4051
|
122 DOC_ITEM |
|
123 Setting the maximum stepsize will avoid passing over very large |
|
124 regions (default is not specified). |
|
125 END_DOC_ITEM |
3998
|
126 TYPE = "double" |
|
127 INIT_VALUE = "-1.0" |
|
128 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
129 END_OPTION |
|
130 |
|
131 OPTION |
|
132 NAME = "minimum step size" |
4051
|
133 DOC_ITEM |
|
134 The minimum absolute step size allowed (default is 0). |
|
135 END_DOC_ITEM |
3998
|
136 TYPE = "double" |
|
137 INIT_VALUE = "0.0" |
|
138 SET_EXPR = "(val >= 0.0) ? val : 0.0" |
|
139 END_OPTION |
|
140 |
|
141 OPTION |
|
142 NAME = "step limit" |
4051
|
143 DOC_ITEM |
|
144 Maximum number of steps allowed (default is 100000). |
|
145 END_DOC_ITEM |
5275
|
146 TYPE = "octave_idx_type" |
3998
|
147 INIT_VALUE = "100000" |
|
148 SET_EXPR = "val" |
|
149 END_OPTION |