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 {
"integration method",
45 {
"integration",
"method", 0, 0, },
46 { 3, 0, 0, 0, }, 1, },
48 {
"initial step size",
49 {
"initial",
"step",
"size", 0, },
50 { 3, 0, 0, 0, }, 1, },
53 {
"maximum",
"order", 0, 0, },
54 { 2, 1, 0, 0, }, 2, },
56 {
"maximum step size",
57 {
"maximum",
"step",
"size", 0, },
58 { 2, 1, 0, 0, }, 2, },
60 {
"minimum step size",
61 {
"minimum",
"step",
"size", 0, },
62 { 2, 0, 0, 0, }, 1, },
65 {
"step",
"limit", 0, 0, },
66 { 1, 0, 0, 0, }, 1, },
72 std::ostringstream buf;
75 <<
"Options for LSODE include:\n\n"
77 <<
" ------- -----\n";
194 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
202 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
210 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
218 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
226 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
234 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
242 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
250 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
259 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
271 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
285 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
292 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
297 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
304 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
308 retval =
static_cast<double> (val);
311 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
318 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
325 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
329 retval =
static_cast<double> (val);
333 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
339 DEFUN (lsode_options, args, ,
341 @deftypefn {Built-in Function} {} lsode_options ()\n\
342 @deftypefnx {Built-in Function} {val =} lsode_options (@var{opt})\n\
343 @deftypefnx {Built-in Function} {} lsode_options (@var{opt}, @var{val})\n\
344 Query or set options for the function @code{lsode}.\n\
345 When called with no arguments, the names of all available options and\n\
346 their current values are displayed.\n\
347 Given one argument, return the value of the corresponding option.\n\
348 When called with two arguments, @code{lsode_options} set the option\n\
349 @var{opt} to value @var{val}.\n\
354 @item @qcode{\"absolute tolerance\"}\n\
355 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
356 must match the dimension of the state vector.\n\
358 @item @qcode{\"relative tolerance\"}\n\
359 Relative tolerance parameter. Unlike the absolute tolerance, this\n\
360 parameter may only be a scalar.\n\
362 The local error test applied at each integration step is\n\
366 abs (local error in x(i)) <= ...\n\
367 rtol * abs (y(i)) + atol(i)\n\
371 @item @qcode{\"integration method\"}\n\
372 A string specifying the method of integration to use to solve the ODE\n\
373 system. Valid values are\n\
376 @item @qcode{\"adams\"}\n\
377 @itemx @qcode{\"non-stiff\"}\n\
378 No Jacobian used (even if it is available).\n\
380 @item @qcode{\"bdf\"}\n\
381 @itemx @qcode{\"stiff\"}\n\
382 Use stiff backward differentiation formula (BDF) method. If a\n\
383 function to compute the Jacobian is not supplied, @code{lsode} will\n\
384 compute a finite difference approximation of the Jacobian matrix.\n\
387 @item @qcode{\"initial step size\"}\n\
388 The step size to be attempted on the first step (default is determined\n\
391 @item @qcode{\"maximum order\"}\n\
392 Restrict the maximum order of the solution method. If using the Adams\n\
393 method, this option must be between 1 and 12. Otherwise, it must be\n\
394 between 1 and 5, inclusive.\n\
396 @item @qcode{\"maximum step size\"}\n\
397 Setting the maximum stepsize will avoid passing over very large\n\
398 regions (default is not specified).\n\
400 @item @qcode{\"minimum step size\"}\n\
401 The minimum absolute step size allowed (default is 0).\n\
403 @item @qcode{\"step limit\"}\n\
404 Maximum number of steps allowed (default is 100000).\n\
410 int nargin = args.
length ();
416 else if (nargin == 1 || nargin == 2)
418 std::string keyword = args(0).string_value ();
428 error (
"lsode_options: expecting keyword as first argument");