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