7017
|
1 # Copyright (C) 2002, 2003, 2004, 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 = "DASSL" |
|
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. |
|
29 END_DOC_ITEM |
3998
|
30 TYPE = "Array<double>" |
|
31 SET_ARG_TYPE = "const $TYPE&" |
|
32 INIT_BODY |
|
33 $OPTVAR.resize (1); |
|
34 $OPTVAR(0) = ::sqrt (DBL_EPSILON); |
|
35 END_INIT_BODY |
|
36 SET_CODE |
|
37 void set_$OPT (double val) |
|
38 { |
|
39 $OPTVAR.resize (1); |
|
40 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); |
4049
|
41 reset = true; |
3998
|
42 } |
|
43 |
|
44 void set_$OPT (const $TYPE& val) |
4049
|
45 { $OPTVAR = val; reset = true; } |
3998
|
46 END_SET_CODE |
|
47 END_OPTION |
|
48 |
|
49 OPTION |
|
50 NAME = "relative tolerance" |
4050
|
51 DOC_ITEM |
|
52 Relative tolerance. May be either vector or scalar. If a vector, it |
|
53 must match the dimension of the state vector, and the absolute |
|
54 tolerance must also be a vector of the same length. |
|
55 |
|
56 The local error test applied at each integration step is |
4051
|
57 |
4050
|
58 @example |
5016
|
59 abs (local error in x(i)) |
|
60 <= rtol(i) * abs (Y(i)) + atol(i) |
4050
|
61 @end example |
|
62 END_DOC_ITEM |
3998
|
63 TYPE = "Array<double>" |
|
64 SET_ARG_TYPE = "const $TYPE&" |
|
65 INIT_BODY |
|
66 $OPTVAR.resize (1); |
|
67 $OPTVAR(0) = ::sqrt (DBL_EPSILON); |
|
68 END_INIT_BODY |
|
69 SET_CODE |
|
70 void set_$OPT (double val) |
|
71 { |
|
72 $OPTVAR.resize (1); |
|
73 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); |
4049
|
74 reset = true; |
3998
|
75 } |
|
76 |
|
77 void set_$OPT (const $TYPE& val) |
4049
|
78 { $OPTVAR = val; reset = true; } |
3998
|
79 END_SET_CODE |
|
80 END_OPTION |
|
81 |
|
82 OPTION |
4047
|
83 NAME = "compute consistent initial condition" |
4050
|
84 DOC_ITEM |
7007
|
85 If nonzero, @code{dassl} will attempt to compute a consistent set of initial |
4050
|
86 conditions. This is generally not reliable, so it is best to provide |
|
87 a consistent set and leave this option set to zero. |
|
88 END_DOC_ITEM |
5275
|
89 TYPE = "octave_idx_type" |
4047
|
90 INIT_VALUE = "0" |
|
91 SET_EXPR = "val" |
|
92 END_OPTION |
|
93 |
|
94 OPTION |
|
95 NAME = "enforce nonnegativity constraints" |
4050
|
96 DOC_ITEM |
|
97 If you know that the solutions to your equations will always be |
|
98 nonnegative, it may help to set this parameter to a nonzero |
|
99 value. However, it is probably best to try leaving this option set to |
|
100 zero first, and only setting it to a nonzero value if that doesn't |
|
101 work very well. |
|
102 END_DOC_ITEM |
5275
|
103 TYPE = "octave_idx_type" |
4047
|
104 INIT_VALUE = "0" |
|
105 SET_EXPR = "val" |
|
106 END_OPTION |
|
107 |
|
108 OPTION |
3998
|
109 NAME = "initial step size" |
4050
|
110 DOC_ITEM |
7001
|
111 Differential-algebraic problems may occasionally suffer from severe |
4050
|
112 scaling difficulties on the first step. If you know a great deal |
|
113 about the scaling of your problem, you can help to alleviate this |
|
114 problem by specifying an initial stepsize. |
|
115 END_DOC_ITEM |
3998
|
116 TYPE = "double" |
|
117 INIT_VALUE = "-1.0" |
|
118 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
119 END_OPTION |
|
120 |
|
121 OPTION |
4044
|
122 NAME = "maximum order" |
4050
|
123 DOC_ITEM |
|
124 Restrict the maximum order of the solution method. This option must |
|
125 be between 1 and 5, inclusive. |
|
126 END_DOC_ITEM |
5275
|
127 TYPE = "octave_idx_type" |
4044
|
128 INIT_VALUE = "-1" |
|
129 SET_EXPR = "val" |
|
130 END_OPTION |
|
131 |
|
132 OPTION |
3998
|
133 NAME = "maximum step size" |
4050
|
134 DOC_ITEM |
|
135 Setting the maximum stepsize will avoid passing over very large |
4051
|
136 regions (default is not specified). |
4050
|
137 END_DOC_ITEM |
3998
|
138 TYPE = "double" |
|
139 INIT_VALUE = "-1.0" |
|
140 SET_EXPR = "(val >= 0.0) ? val : -1.0" |
|
141 END_OPTION |
4429
|
142 |
|
143 OPTION |
|
144 NAME = "step limit" |
|
145 DOC_ITEM |
|
146 Maximum number of integration steps to attempt on a single call to the |
|
147 underlying Fortran code. |
|
148 END_DOC_ITEM |
5275
|
149 TYPE = "octave_idx_type" |
4429
|
150 INIT_VALUE = "-1" |
|
151 SET_EXPR = "(val >= 0) ? val : -1" |
|
152 END_OPTION |