Mercurial > hg > octave-nkf
annotate liboctave/DASPK-opts.in @ 11542:695141f1c05c ss-3-3-55
snapshot 3.3.55
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 15 Jan 2011 04:53:04 -0500 |
parents | fd0a3ac60b0e |
children | a83bad07f7e3 |
rev | line source |
---|---|
11523 | 1 # Copyright (C) 2002-2011 John W. Eaton |
7017 | 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 = "DASPK" |
20 | |
4044 | 21 INCLUDE = "DAE.h" |
22 | |
3998 | 23 OPTION |
24 NAME = "absolute tolerance" | |
4050 | 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, and the relative | |
28 tolerance must also be a vector of the same length. | |
10840 | 29 |
4050 | 30 END_DOC_ITEM |
3998 | 31 TYPE = "Array<double>" |
32 SET_ARG_TYPE = "const $TYPE&" | |
33 INIT_BODY | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
34 $OPTVAR.resize (1, 1); |
3998 | 35 $OPTVAR(0) = ::sqrt (DBL_EPSILON); |
36 END_INIT_BODY | |
37 SET_CODE | |
38 void set_$OPT (double val) | |
39 { | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
40 $OPTVAR.resize (1, 1); |
3998 | 41 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); |
4049 | 42 reset = true; |
3998 | 43 } |
44 | |
45 void set_$OPT (const $TYPE& val) | |
4049 | 46 { $OPTVAR = val; reset = true; } |
3998 | 47 END_SET_CODE |
48 END_OPTION | |
49 | |
50 OPTION | |
51 NAME = "relative tolerance" | |
4050 | 52 DOC_ITEM |
53 Relative tolerance. May be either vector or scalar. If a vector, it | |
54 must match the dimension of the state vector, and the absolute | |
55 tolerance must also be a vector of the same length. | |
56 | |
57 The local error test applied at each integration step is | |
58 | |
59 @example | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7096
diff
changeset
|
60 @group |
5016 | 61 abs (local error in x(i)) |
62 <= rtol(i) * abs (Y(i)) + atol(i) | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7096
diff
changeset
|
63 @end group |
4050 | 64 @end example |
10840 | 65 |
4050 | 66 END_DOC_ITEM |
3998 | 67 TYPE = "Array<double>" |
68 SET_ARG_TYPE = "const $TYPE&" | |
69 INIT_BODY | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
70 $OPTVAR.resize (1, 1); |
3998 | 71 $OPTVAR(0) = ::sqrt (DBL_EPSILON); |
72 END_INIT_BODY | |
73 SET_CODE | |
74 void set_$OPT (double val) | |
75 { | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
76 $OPTVAR.resize (1, 1); |
3998 | 77 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); |
4049 | 78 reset = true; |
3998 | 79 } |
80 | |
81 void set_$OPT (const $TYPE& val) | |
4049 | 82 { $OPTVAR = val; reset = true; } |
3998 | 83 END_SET_CODE |
84 END_OPTION | |
85 | |
86 OPTION | |
4044 | 87 NAME = "compute consistent initial condition" |
4050 | 88 DOC_ITEM |
89 Denoting the differential variables in the state vector by @samp{Y_d} | |
90 and the algebraic variables by @samp{Y_a}, @code{ddaspk} can solve | |
91 one of two initialization problems: | |
92 | |
93 @enumerate | |
94 @item Given Y_d, calculate Y_a and Y'_d | |
10840 | 95 |
4050 | 96 @item Given Y', calculate Y. |
97 @end enumerate | |
98 | |
99 In either case, initial values for the given components are input, and | |
100 initial guesses for the unknown components must also be provided as | |
101 input. Set this option to 1 to solve the first problem, or 2 to solve | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7096
diff
changeset
|
102 the second (the default is 0, so you must provide a set of |
4050 | 103 initial conditions that are consistent). |
104 | |
105 If this option is set to a nonzero value, you must also set the | |
106 @code{\"algebraic variables\"} option to declare which variables in the | |
107 problem are algebraic. | |
10840 | 108 |
4050 | 109 END_DOC_ITEM |
5275 | 110 TYPE = "octave_idx_type" |
4050 | 111 INIT_VALUE = "0" |
112 SET_EXPR = "val" | |
113 END_OPTION | |
114 | |
115 OPTION | |
116 NAME = "use initial condition heuristics" | |
117 DOC_ITEM | |
118 Set to a nonzero value to use the initial condition heuristics options | |
119 described below. | |
10840 | 120 |
4050 | 121 END_DOC_ITEM |
5275 | 122 TYPE = "octave_idx_type" |
4050 | 123 INIT_VALUE = "0" |
124 SET_EXPR = "val" | |
125 END_OPTION | |
126 | |
127 OPTION | |
128 NAME = "initial condition heuristics" | |
129 DOC_ITEM | |
130 A vector of the following parameters that can be used to control the | |
131 initial condition calculation. | |
132 | |
133 @table @code | |
134 @item MXNIT | |
135 Maximum number of Newton iterations (default is 5). | |
10840 | 136 |
4050 | 137 @item MXNJ |
138 Maximum number of Jacobian evaluations (default is 6). | |
10840 | 139 |
4050 | 140 @item MXNH |
141 Maximum number of values of the artificial stepsize parameter to be | |
142 tried if the @code{\"compute consistent initial condition\"} option has | |
143 been set to 1 (default is 5). | |
144 | |
7096 | 145 Note that the maximum total number of Newton iterations allowed is |
4050 | 146 @code{MXNIT*MXNJ*MXNH} if the @code{\"compute consistent initial |
147 condition\"} option has been set to 1 and @code{MXNIT*MXNJ} if it is | |
148 set to 2. | |
10840 | 149 |
4050 | 150 @item LSOFF |
151 Set to a nonzero value to disable the linesearch algorithm (default is | |
152 0). | |
10840 | 153 |
4050 | 154 @item STPTOL |
155 Minimum scaled step in linesearch algorithm (default is eps^(2/3)). | |
10840 | 156 |
4050 | 157 @item EPINIT |
158 Swing factor in the Newton iteration convergence test. The test is | |
159 applied to the residual vector, premultiplied by the approximate | |
160 Jacobian. For convergence, the weighted RMS norm of this vector | |
161 (scaled by the error weights) must be less than @code{EPINIT*EPCON}, | |
162 where @code{EPCON} = 0.33 is the analogous test constant used in the | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7096
diff
changeset
|
163 time steps. The default is @code{EPINIT} = 0.01. |
4050 | 164 @end table |
10840 | 165 |
4050 | 166 END_DOC_ITEM |
167 TYPE = "Array<double>" | |
168 SET_ARG_TYPE = "const $TYPE&" | |
169 INIT_BODY | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
170 $OPTVAR.resize (6, 1); |
4050 | 171 $OPTVAR(0) = 5.0; |
172 $OPTVAR(1) = 6.0; | |
173 $OPTVAR(2) = 5.0; | |
174 $OPTVAR(3) = 0.0; | |
175 $OPTVAR(4) = ::pow (DBL_EPSILON, 2.0/3.0); | |
176 $OPTVAR(5) = 0.01; | |
177 END_INIT_BODY | |
178 SET_EXPR = "val" | |
179 END_OPTION | |
180 | |
181 OPTION | |
182 NAME = "print initial condition info" | |
183 DOC_ITEM | |
184 Set this option to a nonzero value to display detailed information | |
185 about the initial condition calculation (default is 0). | |
10840 | 186 |
4050 | 187 END_DOC_ITEM |
5275 | 188 TYPE = "octave_idx_type" |
4050 | 189 INIT_VALUE = "0" |
190 SET_EXPR = "val" | |
191 END_OPTION | |
192 | |
193 OPTION | |
194 NAME = "exclude algebraic variables from error test" | |
195 DOC_ITEM | |
196 Set to a nonzero value to exclude algebraic variables from the error | |
197 test. You must also set the @code{\"algebraic variables\"} option to | |
198 declare which variables in the problem are algebraic (default is 0). | |
10840 | 199 |
4050 | 200 END_DOC_ITEM |
5275 | 201 TYPE = "octave_idx_type" |
4044 | 202 INIT_VALUE = "0" |
203 SET_EXPR = "val" | |
204 END_OPTION | |
205 | |
206 OPTION | |
4047 | 207 NAME = "algebraic variables" |
4050 | 208 DOC_ITEM |
209 A vector of the same length as the state vector. A nonzero element | |
210 indicates that the corresponding element of the state vector is an | |
211 algebraic variable (i.e., its derivative does not appear explicitly | |
212 in the equation set. | |
213 | |
214 This option is required by the | |
215 @code{compute consistent initial condition\"} and | |
216 @code{\"exclude algebraic variables from error test\"} options. | |
10840 | 217 |
4050 | 218 END_DOC_ITEM |
5275 | 219 TYPE = "Array<octave_idx_type>" |
4047 | 220 SET_ARG_TYPE = const $TYPE& |
221 INIT_BODY | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
222 $OPTVAR.resize (1, 1); |
4047 | 223 $OPTVAR(0) = 0; |
224 END_INIT_BODY | |
225 SET_CODE | |
226 void set_$OPT (int val) | |
227 { | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
228 $OPTVAR.resize (1, 1); |
4047 | 229 $OPTVAR(0) = val; |
4049 | 230 reset = true; |
4047 | 231 } |
232 | |
233 void set_$OPT (const $TYPE& val) | |
4049 | 234 { $OPTVAR = val; reset = true; } |
4047 | 235 END_SET_CODE |
236 END_OPTION | |
237 | |
238 OPTION | |
4044 | 239 NAME = "enforce inequality constraints" |
4050 | 240 DOC_ITEM |
241 Set to one of the following values to enforce the inequality | |
242 constraints specified by the @code{\"inequality constraint types\"} | |
243 option (default is 0). | |
244 | |
245 @enumerate | |
246 @item To have constraint checking only in the initial condition calculation. | |
10840 | 247 |
4050 | 248 @item To enforce constraint checking during the integration. |
10840 | 249 |
4050 | 250 @item To enforce both options 1 and 2. |
251 @end enumerate | |
10840 | 252 |
4050 | 253 END_DOC_ITEM |
5275 | 254 TYPE = "octave_idx_type" |
4044 | 255 INIT_VALUE = "0" |
256 SET_EXPR = "val" | |
257 END_OPTION | |
258 | |
259 OPTION | |
260 NAME = "inequality constraint types" | |
4050 | 261 DOC_ITEM |
262 A vector of the same length as the state specifying the type of | |
263 inequality constraint. Each element of the vector corresponds to an | |
264 element of the state and should be assigned one of the following | |
265 codes | |
266 | |
267 @table @asis | |
268 @item -2 | |
269 Less than zero. | |
10840 | 270 |
4050 | 271 @item -1 |
272 Less than or equal to zero. | |
10840 | 273 |
4050 | 274 @item 0 |
275 Not constrained. | |
10840 | 276 |
4050 | 277 @item 1 |
278 Greater than or equal to zero. | |
10840 | 279 |
4050 | 280 @item 2 |
281 Greater than zero. | |
282 @end table | |
283 | |
284 This option only has an effect if the | |
285 @code{\"enforce inequality constraints\"} option is nonzero. | |
10840 | 286 |
4050 | 287 END_DOC_ITEM |
5275 | 288 TYPE = "Array<octave_idx_type>" |
4044 | 289 SET_ARG_TYPE = const $TYPE& |
290 INIT_BODY | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
291 $OPTVAR.resize (1, 1); |
4044 | 292 $OPTVAR(0) = 0; |
293 END_INIT_BODY | |
294 SET_CODE | |
5275 | 295 void set_$OPT (octave_idx_type val) |
4044 | 296 { |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
297 $OPTVAR.resize (1, 1); |
4047 | 298 $OPTVAR(0) = val; |
4049 | 299 reset = true; |
4044 | 300 } |
301 | |
302 void set_$OPT (const $TYPE& val) | |
4049 | 303 { $OPTVAR = val; reset = true; } |
4044 | 304 END_SET_CODE |
305 END_OPTION | |
306 | |
307 OPTION | |
3998 | 308 NAME = "initial step size" |
4050 | 309 DOC_ITEM |
7001 | 310 Differential-algebraic problems may occasionally suffer from severe |
4050 | 311 scaling difficulties on the first step. If you know a great deal |
312 about the scaling of your problem, you can help to alleviate this | |
313 problem by specifying an initial stepsize (default is computed | |
314 automatically). | |
10840 | 315 |
4050 | 316 END_DOC_ITEM |
3998 | 317 TYPE = "double" |
318 INIT_VALUE = "-1.0" | |
319 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
320 END_OPTION | |
321 | |
322 OPTION | |
4044 | 323 NAME = "maximum order" |
4050 | 324 DOC_ITEM |
325 Restrict the maximum order of the solution method. This option must | |
326 be between 1 and 5, inclusive (default is 5). | |
10840 | 327 |
4050 | 328 END_DOC_ITEM |
5275 | 329 TYPE = "octave_idx_type" |
4050 | 330 INIT_VALUE = "5" |
4044 | 331 SET_EXPR = "val" |
332 END_OPTION | |
333 | |
334 OPTION | |
3998 | 335 NAME = "maximum step size" |
4050 | 336 DOC_ITEM |
337 Setting the maximum stepsize will avoid passing over very large | |
338 regions (default is not specified). | |
339 END_DOC_ITEM | |
3998 | 340 TYPE = "double" |
341 INIT_VALUE = "-1.0" | |
342 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
343 END_OPTION |