36 {
"absolute tolerance",
37 {
"absolute",
"tolerance", 0, 0, 0, },
38 { 1, 0, 0, 0, 0, }, 1, },
40 {
"relative tolerance",
41 {
"relative",
"tolerance", 0, 0, 0, },
42 { 1, 0, 0, 0, 0, }, 1, },
44 {
"compute consistent initial condition",
45 {
"compute",
"consistent",
"initial",
"condition", 0, },
46 { 1, 0, 0, 0, 0, }, 1, },
48 {
"enforce nonnegativity constraints",
49 {
"enforce",
"nonnegativity",
"constraints", 0, 0, },
50 { 1, 0, 0, 0, 0, }, 1, },
52 {
"initial step size",
53 {
"initial",
"step",
"size", 0, 0, },
54 { 1, 0, 0, 0, 0, }, 1, },
57 {
"maximum",
"order", 0, 0, 0, },
58 { 1, 1, 0, 0, 0, }, 2, },
60 {
"maximum step size",
61 {
"maximum",
"step",
"size", 0, 0, },
62 { 1, 1, 0, 0, 0, }, 2, },
65 {
"step",
"limit", 0, 0, 0, },
66 { 1, 0, 0, 0, 0, }, 1, },
72 std::ostringstream buf;
75 <<
"Options for DASSL include:\n\n"
77 <<
" ------- -----\n";
114 os << val(0) <<
"\n";
206 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
214 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
222 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
230 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
238 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
246 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
254 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
262 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
271 warning (
"dassl_options: no match for `%s'", keyword.c_str ());
283 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
297 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
311 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
315 retval =
static_cast<double> (val);
318 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
322 retval =
static_cast<double> (val);
325 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
332 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
336 retval =
static_cast<double> (val);
339 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
346 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
350 retval =
static_cast<double> (val);
354 warning (
"dassl_options: no match for `%s'", keyword.c_str ());
360 DEFUN (dassl_options, args, ,
362 @deftypefn {Built-in Function} {} dassl_options ()\n\
363 @deftypefnx {Built-in Function} {val =} dassl_options (@var{opt})\n\
364 @deftypefnx {Built-in Function} {} dassl_options (@var{opt}, @var{val})\n\
365 Query or set options for the function @code{dassl}.\n\
366 When called with no arguments, the names of all available options and\n\
367 their current values are displayed.\n\
368 Given one argument, return the value of the corresponding option.\n\
369 When called with two arguments, @code{dassl_options} set the option\n\
370 @var{opt} to value @var{val}.\n\
375 @item @qcode{\"absolute tolerance\"}\n\
376 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
377 must match the dimension of the state vector, and the relative\n\
378 tolerance must also be a vector of the same length.\n\
380 @item @qcode{\"relative tolerance\"}\n\
381 Relative tolerance. May be either vector or scalar. If a vector, it\n\
382 must match the dimension of the state vector, and the absolute\n\
383 tolerance must also be a vector of the same length.\n\
385 The local error test applied at each integration step is\n\
389 abs (local error in x(i))\n\
390 <= rtol(i) * abs (Y(i)) + atol(i)\n\
394 @item @qcode{\"compute consistent initial condition\"}\n\
395 If nonzero, @code{dassl} will attempt to compute a consistent set of initial\n\
396 conditions. This is generally not reliable, so it is best to provide\n\
397 a consistent set and leave this option set to zero.\n\
399 @item @qcode{\"enforce nonnegativity constraints\"}\n\
400 If you know that the solutions to your equations will always be\n\
401 non-negative, it may help to set this parameter to a nonzero\n\
402 value. However, it is probably best to try leaving this option set to\n\
403 zero first, and only setting it to a nonzero value if that doesn't\n\
406 @item @qcode{\"initial step size\"}\n\
407 Differential-algebraic problems may occasionally suffer from severe\n\
408 scaling difficulties on the first step. If you know a great deal\n\
409 about the scaling of your problem, you can help to alleviate this\n\
410 problem by specifying an initial stepsize.\n\
412 @item @qcode{\"maximum order\"}\n\
413 Restrict the maximum order of the solution method. This option must\n\
414 be between 1 and 5, inclusive.\n\
416 @item @qcode{\"maximum step size\"}\n\
417 Setting the maximum stepsize will avoid passing over very large\n\
418 regions (default is not specified).\n\
420 @item @qcode{\"step limit\"}\n\
421 Maximum number of integration steps to attempt on a single call to the\n\
422 underlying Fortran code.\n\
428 int nargin = args.
length ();
434 else if (nargin == 1 || nargin == 2)
436 std::string keyword = args(0).string_value ();
446 error (
"dassl_options: expecting keyword as first argument");