<< odedc Intégration - dérivation Fonctions Elémentaires >>

Scilab Help >> Intégration - dérivation > odeoptions

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 ode function checks if this variable exists and in this case it uses it. For using default values you should clear this variable. To create it you must execute the instruction %ODEOPTIONS=odeoptions().

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.

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


Report an issue
<< odedc Intégration - dérivation Fonctions Elémentaires >>