Mercurial > octave
annotate liboctave/numeric/DASPK-opts.in @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
1 # Copyright (C) 2002-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
2 # |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
3 # See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 # or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 # |
7017 | 6 # |
7 # This file is part of Octave. | |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
8 # |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 # Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
10 # under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
11 # the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
12 # (at your option) any later version. |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
13 # |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
14 # Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
15 # WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 # GNU General Public License for more details. |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
18 # |
7017 | 19 # You should have received a copy of the GNU General Public License |
20 # along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
21 # <https://www.gnu.org/licenses/>. |
7017 | 22 |
3998 | 23 CLASS = "DASPK" |
24 | |
4044 | 25 INCLUDE = "DAE.h" |
26 | |
3998 | 27 OPTION |
28 NAME = "absolute tolerance" | |
4050 | 29 DOC_ITEM |
30 Absolute tolerance. May be either vector or scalar. If a vector, it | |
31 must match the dimension of the state vector, and the relative | |
32 tolerance must also be a vector of the same length. | |
10840 | 33 |
4050 | 34 END_DOC_ITEM |
3998 | 35 TYPE = "Array<double>" |
36 SET_ARG_TYPE = "const $TYPE&" | |
37 INIT_BODY | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
38 $OPTVAR.resize (dim_vector (1, 1)); |
15220
61822c866ba1
use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
39 $OPTVAR(0) = ::sqrt (std::numeric_limits<double>::epsilon ()); |
3998 | 40 END_INIT_BODY |
41 SET_CODE | |
42 void set_$OPT (double val) | |
43 { | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
44 $OPTVAR.resize (dim_vector (1, 1)); |
15220
61822c866ba1
use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
45 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ()); |
4049 | 46 reset = true; |
3998 | 47 } |
48 | |
49 void set_$OPT (const $TYPE& val) | |
4049 | 50 { $OPTVAR = val; reset = true; } |
3998 | 51 END_SET_CODE |
52 END_OPTION | |
53 | |
54 OPTION | |
55 NAME = "relative tolerance" | |
4050 | 56 DOC_ITEM |
57 Relative tolerance. May be either vector or scalar. If a vector, it | |
58 must match the dimension of the state vector, and the absolute | |
59 tolerance must also be a vector of the same length. | |
60 | |
61 The local error test applied at each integration step is | |
62 | |
63 @example | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7096
diff
changeset
|
64 @group |
5016 | 65 abs (local error in x(i)) |
66 <= 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
|
67 @end group |
4050 | 68 @end example |
10840 | 69 |
4050 | 70 END_DOC_ITEM |
3998 | 71 TYPE = "Array<double>" |
72 SET_ARG_TYPE = "const $TYPE&" | |
73 INIT_BODY | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
74 $OPTVAR.resize (dim_vector (1, 1)); |
15220
61822c866ba1
use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
75 $OPTVAR(0) = ::sqrt (std::numeric_limits<double>::epsilon ()); |
3998 | 76 END_INIT_BODY |
77 SET_CODE | |
78 void set_$OPT (double val) | |
79 { | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
80 $OPTVAR.resize (dim_vector (1, 1)); |
15220
61822c866ba1
use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
81 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ()); |
4049 | 82 reset = true; |
3998 | 83 } |
84 | |
85 void set_$OPT (const $TYPE& val) | |
4049 | 86 { $OPTVAR = val; reset = true; } |
3998 | 87 END_SET_CODE |
88 END_OPTION | |
89 | |
90 OPTION | |
4044 | 91 NAME = "compute consistent initial condition" |
4050 | 92 DOC_ITEM |
93 Denoting the differential variables in the state vector by @samp{Y_d} | |
94 and the algebraic variables by @samp{Y_a}, @code{ddaspk} can solve | |
95 one of two initialization problems: | |
96 | |
97 @enumerate | |
98 @item Given Y_d, calculate Y_a and Y'_d | |
10840 | 99 |
4050 | 100 @item Given Y', calculate Y. |
101 @end enumerate | |
102 | |
103 In either case, initial values for the given components are input, and | |
104 initial guesses for the unknown components must also be provided as | |
105 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
|
106 the second (the default is 0, so you must provide a set of |
4050 | 107 initial conditions that are consistent). |
108 | |
109 If this option is set to a nonzero value, you must also set the | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
110 @qcode{"algebraic variables"} option to declare which variables in the |
4050 | 111 problem are algebraic. |
10840 | 112 |
4050 | 113 END_DOC_ITEM |
5275 | 114 TYPE = "octave_idx_type" |
4050 | 115 INIT_VALUE = "0" |
116 SET_EXPR = "val" | |
117 END_OPTION | |
118 | |
119 OPTION | |
120 NAME = "use initial condition heuristics" | |
121 DOC_ITEM | |
122 Set to a nonzero value to use the initial condition heuristics options | |
123 described below. | |
10840 | 124 |
4050 | 125 END_DOC_ITEM |
5275 | 126 TYPE = "octave_idx_type" |
4050 | 127 INIT_VALUE = "0" |
128 SET_EXPR = "val" | |
129 END_OPTION | |
130 | |
131 OPTION | |
132 NAME = "initial condition heuristics" | |
133 DOC_ITEM | |
134 A vector of the following parameters that can be used to control the | |
135 initial condition calculation. | |
136 | |
137 @table @code | |
138 @item MXNIT | |
139 Maximum number of Newton iterations (default is 5). | |
10840 | 140 |
4050 | 141 @item MXNJ |
142 Maximum number of Jacobian evaluations (default is 6). | |
10840 | 143 |
4050 | 144 @item MXNH |
145 Maximum number of values of the artificial stepsize parameter to be | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
146 tried if the @qcode{"compute consistent initial condition"} option has |
4050 | 147 been set to 1 (default is 5). |
148 | |
7096 | 149 Note that the maximum total number of Newton iterations allowed is |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
150 @code{MXNIT*MXNJ*MXNH} if the @qcode{"compute consistent initial |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
151 condition"} option has been set to 1 and @code{MXNIT*MXNJ} if it is |
4050 | 152 set to 2. |
10840 | 153 |
4050 | 154 @item LSOFF |
155 Set to a nonzero value to disable the linesearch algorithm (default is | |
156 0). | |
10840 | 157 |
4050 | 158 @item STPTOL |
159 Minimum scaled step in linesearch algorithm (default is eps^(2/3)). | |
10840 | 160 |
4050 | 161 @item EPINIT |
162 Swing factor in the Newton iteration convergence test. The test is | |
163 applied to the residual vector, premultiplied by the approximate | |
164 Jacobian. For convergence, the weighted RMS norm of this vector | |
165 (scaled by the error weights) must be less than @code{EPINIT*EPCON}, | |
166 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
|
167 time steps. The default is @code{EPINIT} = 0.01. |
4050 | 168 @end table |
10840 | 169 |
4050 | 170 END_DOC_ITEM |
171 TYPE = "Array<double>" | |
172 SET_ARG_TYPE = "const $TYPE&" | |
173 INIT_BODY | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
174 $OPTVAR.resize (dim_vector (6, 1)); |
4050 | 175 $OPTVAR(0) = 5.0; |
176 $OPTVAR(1) = 6.0; | |
177 $OPTVAR(2) = 5.0; | |
178 $OPTVAR(3) = 0.0; | |
15220
61822c866ba1
use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
179 $OPTVAR(4) = ::pow (std::numeric_limits<double>::epsilon (), 2.0/3.0); |
4050 | 180 $OPTVAR(5) = 0.01; |
181 END_INIT_BODY | |
182 SET_EXPR = "val" | |
183 END_OPTION | |
184 | |
185 OPTION | |
186 NAME = "print initial condition info" | |
187 DOC_ITEM | |
188 Set this option to a nonzero value to display detailed information | |
189 about the initial condition calculation (default is 0). | |
10840 | 190 |
4050 | 191 END_DOC_ITEM |
5275 | 192 TYPE = "octave_idx_type" |
4050 | 193 INIT_VALUE = "0" |
194 SET_EXPR = "val" | |
195 END_OPTION | |
196 | |
197 OPTION | |
198 NAME = "exclude algebraic variables from error test" | |
199 DOC_ITEM | |
200 Set to a nonzero value to exclude algebraic variables from the error | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
201 test. You must also set the @qcode{"algebraic variables"} option to |
4050 | 202 declare which variables in the problem are algebraic (default is 0). |
10840 | 203 |
4050 | 204 END_DOC_ITEM |
5275 | 205 TYPE = "octave_idx_type" |
4044 | 206 INIT_VALUE = "0" |
207 SET_EXPR = "val" | |
208 END_OPTION | |
209 | |
210 OPTION | |
4047 | 211 NAME = "algebraic variables" |
4050 | 212 DOC_ITEM |
213 A vector of the same length as the state vector. A nonzero element | |
214 indicates that the corresponding element of the state vector is an | |
215 algebraic variable (i.e., its derivative does not appear explicitly | |
18679
a142f35f3cb6
doc: Fix unbalanced parentheses in documentation.
Rik <rik@octave.org>
parents:
18473
diff
changeset
|
216 in the equation set). |
4050 | 217 |
218 This option is required by the | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
219 @qcode{"compute consistent initial condition"} and |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
220 @qcode{"exclude algebraic variables from error test"} options. |
10840 | 221 |
4050 | 222 END_DOC_ITEM |
5275 | 223 TYPE = "Array<octave_idx_type>" |
4047 | 224 SET_ARG_TYPE = const $TYPE& |
225 INIT_BODY | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
226 $OPTVAR.resize (dim_vector (1, 1)); |
4047 | 227 $OPTVAR(0) = 0; |
228 END_INIT_BODY | |
229 SET_CODE | |
230 void set_$OPT (int val) | |
231 { | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
232 $OPTVAR.resize (dim_vector (1, 1)); |
4047 | 233 $OPTVAR(0) = val; |
4049 | 234 reset = true; |
4047 | 235 } |
236 | |
237 void set_$OPT (const $TYPE& val) | |
4049 | 238 { $OPTVAR = val; reset = true; } |
4047 | 239 END_SET_CODE |
240 END_OPTION | |
241 | |
242 OPTION | |
4044 | 243 NAME = "enforce inequality constraints" |
4050 | 244 DOC_ITEM |
245 Set to one of the following values to enforce the inequality | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
246 constraints specified by the @qcode{"inequality constraint types"} |
4050 | 247 option (default is 0). |
248 | |
249 @enumerate | |
250 @item To have constraint checking only in the initial condition calculation. | |
10840 | 251 |
4050 | 252 @item To enforce constraint checking during the integration. |
10840 | 253 |
4050 | 254 @item To enforce both options 1 and 2. |
255 @end enumerate | |
10840 | 256 |
4050 | 257 END_DOC_ITEM |
5275 | 258 TYPE = "octave_idx_type" |
4044 | 259 INIT_VALUE = "0" |
260 SET_EXPR = "val" | |
261 END_OPTION | |
262 | |
263 OPTION | |
264 NAME = "inequality constraint types" | |
4050 | 265 DOC_ITEM |
266 A vector of the same length as the state specifying the type of | |
267 inequality constraint. Each element of the vector corresponds to an | |
268 element of the state and should be assigned one of the following | |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
269 codes |
4050 | 270 |
271 @table @asis | |
272 @item -2 | |
273 Less than zero. | |
10840 | 274 |
4050 | 275 @item -1 |
276 Less than or equal to zero. | |
10840 | 277 |
4050 | 278 @item 0 |
279 Not constrained. | |
10840 | 280 |
4050 | 281 @item 1 |
282 Greater than or equal to zero. | |
10840 | 283 |
4050 | 284 @item 2 |
285 Greater than zero. | |
286 @end table | |
287 | |
288 This option only has an effect if the | |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
289 @qcode{"enforce inequality constraints"} option is nonzero. |
10840 | 290 |
4050 | 291 END_DOC_ITEM |
5275 | 292 TYPE = "Array<octave_idx_type>" |
4044 | 293 SET_ARG_TYPE = const $TYPE& |
294 INIT_BODY | |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
295 $OPTVAR.resize (dim_vector (1, 1)); |
4044 | 296 $OPTVAR(0) = 0; |
297 END_INIT_BODY | |
298 SET_CODE | |
5275 | 299 void set_$OPT (octave_idx_type val) |
4044 | 300 { |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
301 $OPTVAR.resize (dim_vector (1, 1)); |
4047 | 302 $OPTVAR(0) = val; |
4049 | 303 reset = true; |
4044 | 304 } |
305 | |
306 void set_$OPT (const $TYPE& val) | |
4049 | 307 { $OPTVAR = val; reset = true; } |
4044 | 308 END_SET_CODE |
309 END_OPTION | |
310 | |
311 OPTION | |
3998 | 312 NAME = "initial step size" |
4050 | 313 DOC_ITEM |
7001 | 314 Differential-algebraic problems may occasionally suffer from severe |
4050 | 315 scaling difficulties on the first step. If you know a great deal |
316 about the scaling of your problem, you can help to alleviate this | |
317 problem by specifying an initial stepsize (default is computed | |
318 automatically). | |
10840 | 319 |
4050 | 320 END_DOC_ITEM |
3998 | 321 TYPE = "double" |
322 INIT_VALUE = "-1.0" | |
323 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
324 END_OPTION | |
325 | |
326 OPTION | |
4044 | 327 NAME = "maximum order" |
4050 | 328 DOC_ITEM |
329 Restrict the maximum order of the solution method. This option must | |
330 be between 1 and 5, inclusive (default is 5). | |
10840 | 331 |
4050 | 332 END_DOC_ITEM |
5275 | 333 TYPE = "octave_idx_type" |
4050 | 334 INIT_VALUE = "5" |
4044 | 335 SET_EXPR = "val" |
336 END_OPTION | |
337 | |
338 OPTION | |
3998 | 339 NAME = "maximum step size" |
4050 | 340 DOC_ITEM |
341 Setting the maximum stepsize will avoid passing over very large | |
342 regions (default is not specified). | |
343 END_DOC_ITEM | |
3998 | 344 TYPE = "double" |
345 INIT_VALUE = "-1.0" | |
346 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
347 END_OPTION |