36 {
"absolute tolerance",
37 {
"absolute",
"tolerance", 0, 0, },
38 { 1, 0, 0, 0, }, 1, },
40 {
"relative tolerance",
41 {
"relative",
"tolerance", 0, 0, },
42 { 1, 0, 0, 0, }, 1, },
44 {
"initial step size",
45 {
"initial",
"step",
"size", 0, },
46 { 1, 0, 0, 0, }, 1, },
49 {
"maximum",
"order", 0, 0, },
50 { 1, 1, 0, 0, }, 2, },
52 {
"maximum step size",
53 {
"maximum",
"step",
"size", 0, },
54 { 1, 1, 0, 0, }, 2, },
57 {
"step",
"limit", 0, 0, },
58 { 1, 0, 0, 0, }, 1, },
64 std::ostringstream buf;
67 <<
"Options for DASRT include:\n\n"
69 <<
" ------- -----\n";
106 os << val(0) <<
"\n";
174 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
182 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
190 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
198 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
206 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
214 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
223 warning (
"dasrt_options: no match for `%s'", keyword.c_str ());
235 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
249 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
263 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
270 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
274 retval =
static_cast<double> (val);
277 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
284 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
288 retval =
static_cast<double> (val);
292 warning (
"dasrt_options: no match for `%s'", keyword.c_str ());
298 DEFUN (dasrt_options, args, ,
300 @deftypefn {Built-in Function} {} dasrt_options ()\n\
301 @deftypefnx {Built-in Function} {val =} dasrt_options (@var{opt})\n\
302 @deftypefnx {Built-in Function} {} dasrt_options (@var{opt}, @var{val})\n\
303 Query or set options for the function @code{dasrt}.\n\
304 When called with no arguments, the names of all available options and\n\
305 their current values are displayed.\n\
306 Given one argument, return the value of the corresponding option.\n\
307 When called with two arguments, @code{dasrt_options} set the option\n\
308 @var{opt} to value @var{val}.\n\
313 @item @qcode{\"absolute tolerance\"}\n\
314 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
315 must match the dimension of the state vector, and the relative\n\
316 tolerance must also be a vector of the same length.\n\
318 @item @qcode{\"relative tolerance\"}\n\
319 Relative tolerance. May be either vector or scalar. If a vector, it\n\
320 must match the dimension of the state vector, and the absolute\n\
321 tolerance must also be a vector of the same length.\n\
323 The local error test applied at each integration step is\n\
327 abs (local error in x(i)) <= ...\n\
328 rtol(i) * abs (Y(i)) + atol(i)\n\
332 @item @qcode{\"initial step size\"}\n\
333 Differential-algebraic problems may occasionally suffer from severe\n\
334 scaling difficulties on the first step. If you know a great deal\n\
335 about the scaling of your problem, you can help to alleviate this\n\
336 problem by specifying an initial stepsize.\n\
338 @item @qcode{\"maximum order\"}\n\
339 Restrict the maximum order of the solution method. This option must\n\
340 be between 1 and 5, inclusive.\n\
342 @item @qcode{\"maximum step size\"}\n\
343 Setting the maximum stepsize will avoid passing over very large\n\
346 @item @qcode{\"step limit\"}\n\
347 Maximum number of integration steps to attempt on a single call to the\n\
348 underlying Fortran code.\n\
354 int nargin = args.
length ();
360 else if (nargin == 1 || nargin == 2)
362 std::string keyword = args(0).string_value ();
372 error (
"dasrt_options: expecting keyword as first argument");