odeoptions
set options for ode solvers
Syntax
odeoptions()
Description
This function interactively displays a command which should be
executed to set various options of ode solvers. The context variable
%ODEOPTIONS sets the options.
![]() | The |
The variable %ODEOPTIONS is a vector with the
following elements:
[itask, tcrit, h0, hmax, hmin, jactyp, mxstep, maxordn, maxords, ixpr, ml, mu].
The default value is: [1, 0, 0, %inf, 0, 2, 500, 12, 5, 0, -1, -1].
The meaning of the elements is described below.
itasksets the integration mode:1: normal computation at specified times
2 : computation at mesh points (given in first row of output of
ode)3 : one step at one internal mesh point and return
4 : normal computation without overshooting
tcrit5 : one step, without passing
tcrit, and return
tcritcritical time used only ifitaskequals 4 or 5 as described aboveh0first step triedhmaxmax step sizehminmin step sizejactypeset jacobian properties:0: functional iterations, no jacobian used (
"adams"or"stiff"only)1 : user-supplied full jacobian
2 : internally generated full jacobian
3: internally generated diagonal jacobian (
"adams"or"stiff"only)4 : user-supplied banded jacobian (see
mlandmubelow)5 : internally generated banded jacobian (see
mlandmubelow)
mxstepmaximum number of steps allowed ("adams"or"stiff"only)maxordnmaximum non-stiff order allowed, at most 12maxordsmaximum stiff order allowed, at most 5ixprprint level, 0 or 1ml,mu
Examples
In the following example, we solve the Ordinary Differential Equation
dy/dt=y^2-y sin(t)+cos(t) with the initial
condition y(0)=0 claiming the solution be stored at each mesh value.
function ydot=f(t, y) ydot = y^2 - y*sin(t) + cos(t) endfunction %ODEOPTIONS = [2,0,0,%inf,0,2,500,12,5,0,-1,-1]; y = ode(0,0,%pi,f); plot(y(1,:),y(2,:)) clear %ODEOPTIONS

See also
- ode — solveur d'équations différentielles ordinaires
| Report an issue | ||
| << odedc | Equations différentielles | Fonctions Elémentaires >> |
