ode_root
ordinary differential equation solver with roots finding
Syntax
[y, rd, w, iw] = ode("root", y0, t0, t [,rtol [,atol]], f [,jac], ng, g [,w,iw])
Arguments
- y0
 a real vector or matrix (initial conditions).
- t0
 a real scalar (initial time).
- t
 a real vector (times at which the solution is computed).
- f
 an external function (Scilab function, list or string), computes the value of
f(t, y). It is the right hand side of the differential equation. See ode help for more details.- rtol, atol
 a real constants or real vectors of the same size as
y.- jac
 an external function (a Scilab fuction, list or string), computes the Jacobian of the function
f(t, y). See ode help for more details.- ng
 an integer, number of components of
gfunction- g
 an external function (a Scilab fuction, list or string) with the syntax
g(t, y), returns a vector of sizeng. Each component defines a surface.- y
 a real vector or matrix. The solution.
- rd
 a real vector.
- w, iw
 vectors of real numbers. See ode() optional output
Description
With this syntax (first argument equal to "root")
            ode computes the solution of the differential equation
            dy/dt=f(t,y) until the state y(t)
            crosses the surface g(t,y)=0.
g should give the equation of the surface. It is
            an external i.e. a function with specified syntax, or the name of a
            Fortran subroutine or a C function (character string) with specified
            syntax or a list:
- a Scilab function
 Its syntax must be
r = g(t,y)
this function must return a vector with
ngelements.- a list
 This form of external is used to pass parameters to the function. It must be as follows:
list(g, p1, p2,...)
where the syntax of the function
gis nowr = g(t, y, p1, p2,...)
- a character string
 it must refer to the name of a C or Fortran routine. Assuming that <g_name> is the given name,
The Fortran calling sequence must be
subroutine <g_name>(n, t, y, ng, gout) double precision t, y(*), gout(*) integer n, ng
The C syntax must be
where
tis a real scalar (time)yis a real vector (the state)ngis the number of constraintsnthe dimension of the stategoutis the results array.
See the ode_root help for more details.
Output rd is a 1 x k vector.
            The first entry contains the stopping time. Other entries indicate which
            components of g have changed sign. k
            larger than 2 indicates that more than one surface
            ((k-1) surfaces) have been simultaneously
            traversed.
Other arguments and other options are the same as for
            ode, see the ode help.
Examples
See also
- ode — solveur d'équations différentielles ordinaires
 - ode_optional_output — ode solvers optional outputs description
 - ode_discrete — ordinary differential equation solver, discrete time simulation
 - dae — Solveur de système d'Equations Différentielles Algébriques
 
| Report an issue | ||
| << ode_optional_output | Equations différentielles | odedc >> |