Mercurial > hg > octave-lyh
annotate liboctave/LSODE-opts.in @ 9245:16f53d29049f
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 22 May 2009 10:46:00 -0400 |
parents | 8970b4b10e9f |
children | 12884915a8e4 |
rev | line source |
---|---|
9245 | 1 # Copyright (C) 2002, 2005, 2007, 2009 John W. Eaton |
7017 | 2 # |
3 # This file is part of Octave. | |
4 # | |
5 # Octave is free software; you can redistribute it and/or modify it | |
6 # under the terms of the GNU General Public License as published by the | |
7 # Free Software Foundation; either version 3 of the License, or (at | |
8 # your option) any later version. | |
9 # | |
10 # Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 # for more details. | |
14 # | |
15 # You should have received a copy of the GNU General Public License | |
16 # along with Octave; see the file COPYING. If not, see | |
17 # <http://www.gnu.org/licenses/>. | |
18 | |
3998 | 19 CLASS = "LSODE" |
20 | |
4044 | 21 INCLUDE = "ODE.h" |
22 | |
3998 | 23 OPTION |
24 NAME = "absolute tolerance" | |
4051 | 25 DOC_ITEM |
26 Absolute tolerance. May be either vector or scalar. If a vector, it | |
27 must match the dimension of the state vector. | |
28 END_DOC_ITEM | |
3998 | 29 TYPE = "Array<double>" |
30 SET_ARG_TYPE = "const $TYPE&" | |
31 INIT_BODY | |
32 $OPTVAR.resize (1); | |
33 $OPTVAR(0) = ::sqrt (DBL_EPSILON); | |
34 END_INIT_BODY | |
35 SET_CODE | |
36 void set_$OPT (double val) | |
37 { | |
38 $OPTVAR.resize (1); | |
39 $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); | |
4049 | 40 reset = true; |
3998 | 41 } |
42 | |
43 void set_$OPT (const $TYPE& val) | |
4049 | 44 { $OPTVAR = val; reset = true; } |
3998 | 45 END_SET_CODE |
46 END_OPTION | |
47 | |
48 OPTION | |
4051 | 49 NAME = "relative tolerance" |
50 DOC_ITEM | |
51 Relative tolerance parameter. Unlike the absolute tolerance, this | |
52 parameter may only be a scalar. | |
53 | |
54 The local error test applied at each integration step is | |
55 | |
56 @example | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7081
diff
changeset
|
57 @group |
7081 | 58 abs (local error in x(i)) <= ... |
59 rtol * abs (y(i)) + atol(i) | |
9067
8970b4b10e9f
Cleanup documentation for quad.texi and diffeq.texi
Rik <rdrider0-list@yahoo.com>
parents:
7081
diff
changeset
|
60 @end group |
4051 | 61 @end example |
62 END_DOC_ITEM | |
63 TYPE = "double" | |
64 INIT_VALUE = "::sqrt (DBL_EPSILON)" | |
65 SET_EXPR = "(val > 0.0) ? val : ::sqrt (DBL_EPSILON)" | |
66 END_OPTION | |
67 | |
68 OPTION | |
3998 | 69 NAME = "integration method" |
4231 | 70 DOC_ITEM |
7007 | 71 A string specifying the method of integration to use to solve the ODE |
4051 | 72 system. Valid values are |
73 | |
74 @table @asis | |
75 @item \"adams\" | |
76 @itemx \"non-stiff\" | |
77 No Jacobian used (even if it is available). | |
78 @item \"bdf\" | |
79 @item \"stiff\" | |
80 Use stiff backward differentiation formula (BDF) method. If a | |
81 function to compute the Jacobian is not supplied, @code{lsode} will | |
82 compute a finite difference approximation of the Jacobian matrix. | |
83 @end table | |
84 END_DOC_ITEM | |
3998 | 85 TYPE = "std::string" |
86 SET_ARG_TYPE = "const $TYPE&" | |
87 INIT_VALUE = ""stiff"" | |
88 SET_BODY | |
89 if (val == "stiff" || val == "bdf") | |
90 $OPTVAR = "stiff"; | |
91 else if (val == "non-stiff" || val == "adams") | |
92 $OPTVAR = "non-stiff"; | |
93 else | |
94 (*current_liboctave_error_handler) | |
95 ("lsode_options: method must be \"stiff\", \"bdf\", \"non-stiff\", or \"adams\""); | |
96 END_SET_BODY | |
97 END_OPTION | |
98 | |
99 OPTION | |
100 NAME = "initial step size" | |
4051 | 101 DOC_ITEM |
102 The step size to be attempted on the first step (default is determined | |
103 automatically). | |
104 END_DOC_ITEM | |
3998 | 105 TYPE = "double" |
106 INIT_VALUE = "-1.0" | |
107 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
108 END_OPTION | |
109 | |
110 OPTION | |
4231 | 111 NAME = "maximum order" |
112 DOC_ITEM | |
113 Restrict the maximum order of the solution method. If using the Adams | |
114 method, this option must be between 1 and 12. Otherwise, it must be | |
115 between 1 and 5, inclusive. | |
116 END_DOC_ITEM | |
5275 | 117 TYPE = "octave_idx_type" |
4231 | 118 INIT_VALUE = "-1" |
119 SET_EXPR = "val" | |
120 END_OPTION | |
121 | |
122 OPTION | |
3998 | 123 NAME = "maximum step size" |
4051 | 124 DOC_ITEM |
125 Setting the maximum stepsize will avoid passing over very large | |
126 regions (default is not specified). | |
127 END_DOC_ITEM | |
3998 | 128 TYPE = "double" |
129 INIT_VALUE = "-1.0" | |
130 SET_EXPR = "(val >= 0.0) ? val : -1.0" | |
131 END_OPTION | |
132 | |
133 OPTION | |
134 NAME = "minimum step size" | |
4051 | 135 DOC_ITEM |
136 The minimum absolute step size allowed (default is 0). | |
137 END_DOC_ITEM | |
3998 | 138 TYPE = "double" |
139 INIT_VALUE = "0.0" | |
140 SET_EXPR = "(val >= 0.0) ? val : 0.0" | |
141 END_OPTION | |
142 | |
143 OPTION | |
144 NAME = "step limit" | |
4051 | 145 DOC_ITEM |
146 Maximum number of steps allowed (default is 100000). | |
147 END_DOC_ITEM | |
5275 | 148 TYPE = "octave_idx_type" |
3998 | 149 INIT_VALUE = "100000" |
150 SET_EXPR = "val" | |
151 END_OPTION |