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\
305 When called with no arguments, the names of all available options and\n\
306 their current values are displayed.\n\
308 Given one argument, return the value of the option @var{opt}.\n\
310 When called with two arguments, @code{dasrt_options} sets the option\n\
311 @var{opt} to value @var{val}.\n\
316 @item @qcode{\"absolute tolerance\"}\n\
317 Absolute tolerance. May be either vector or scalar. If a vector, it\n\
318 must match the dimension of the state vector, and the relative\n\
319 tolerance must also be a vector of the same length.\n\
321 @item @qcode{\"relative tolerance\"}\n\
322 Relative tolerance. May be either vector or scalar. If a vector, it\n\
323 must match the dimension of the state vector, and the absolute\n\
324 tolerance must also be a vector of the same length.\n\
326 The local error test applied at each integration step is\n\
330 abs (local error in x(i)) <= ...\n\
331 rtol(i) * abs (Y(i)) + atol(i)\n\
335 @item @qcode{\"initial step size\"}\n\
336 Differential-algebraic problems may occasionally suffer from severe\n\
337 scaling difficulties on the first step. If you know a great deal\n\
338 about the scaling of your problem, you can help to alleviate this\n\
339 problem by specifying an initial stepsize.\n\
341 @item @qcode{\"maximum order\"}\n\
342 Restrict the maximum order of the solution method. This option must\n\
343 be between 1 and 5, inclusive.\n\
345 @item @qcode{\"maximum step size\"}\n\
346 Setting the maximum stepsize will avoid passing over very large\n\
349 @item @qcode{\"step limit\"}\n\
350 Maximum number of integration steps to attempt on a single call to the\n\
351 underlying Fortran code.\n\
357 int nargin = args.
length ();
363 else if (nargin == 1 || nargin == 2)
365 std::string keyword = args(0).string_value ();
375 error (
"dasrt_options: expecting keyword as first argument");
double maximum_step_size(void) const
void set_relative_tolerance(double val)
void set_step_limit(octave_idx_type val)
OCTINTERP_API void print_usage(void)
void set_absolute_tolerance(double val)
octave_idx_type length(void) const
int int_value(bool req_int=false, bool frc_str_conv=false) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
static DASRT_options dasrt_opts
void set_maximum_order(octave_idx_type val)
void set_maximum_step_size(double val)
static octave_value_list show_DASRT_options(const std::string &keyword)
static void print_DASRT_options(std::ostream &os)
static void set_DASRT_options(const std::string &keyword, const octave_value &val)
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
octave_idx_type step_limit(void) const
void warning(const char *fmt,...)
Handles the reference counting for all the derived classes.
Array< double > relative_tolerance(void) const
octave_idx_type length(void) const
Number of elements in the array.
Array< double > absolute_tolerance(void) const
void octave_print_internal(std::ostream &, char, bool)
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
octave_idx_type maximum_order(void) const
void set_initial_step_size(double val)
double initial_step_size(void) const
double double_value(bool frc_str_conv=false) const
static DASRT_options_struct DASRT_options_table[]