Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.3 - English

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Differential Equations, Integration > ode_discrete

ode_discrete

ordinary differential equation solver, discrete time simulation

Calling Sequence

y=ode("discrete",y0,k0,kvect,f)

Arguments

y0

real vector or matrix (initial conditions).

t0

real scalar (initial time).

f

external i.e. function or character string or list.

k0

integer (initial time).

kvect

integer vector.

Description

With this syntax (first argument equal to "discrete") ode computes recursively y(k+1)=f(k,y(k)) from an initial state y(k0) and returns y(k) for k in kvect. kvect(1) must be greater than or equal to k0.

Other arguments and other options are the same as for ode, see the ode help.

Examples

y1=[1;2;3]; deff("yp=a_function(k,y)","yp=A*y+B*u(k)")
A=diag([0.2,0.5,0.9]); B=[1;1;1];u=1:10;n=5;
y=ode("discrete",y1,1,1:n,a_function);
y(:,2)-(A*y1+B*u(1))

// Now y evaluates  at [y3,y5,y7,y9]
y=ode("discrete",y1,1,3:2:9,a_function)

See Also

  • ode — ordinary differential equation solver
<< ode Differential Equations, Integration ode_optional_output >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:09:38 CEST 2011