Systems Theory and Automatic Control

ADMITdiscretizeDynamics
ADMIT documentation: ADMITdiscretizeDynamics

ADMITdiscretizeDynamics

ADMITdiscretizeDynamics discretizes an ODE model using Euler's method.

OPT = ADMITdiscretizeDynamics(OPT,INTEGRATION,VARS,RHS)
OPT = ADMITdiscretizeDynamics(OPT,INTEGRATION,VARS,RHS,TIME)
OPT = ADMITdiscretizeDynamics(OPT,VARS,RHS,OPTIONS)
OPT = ADMITdiscretizeDynamics(OPT,VARS,RHS,TIME,OPTIONS)

Inputs
  OPT         : valid ADMITproject-object
  INTEGRATION : integration method to be used
                [EULERFORWARD,EULERBACKWARD,EULERIMPLICIT,EULEREXPLICIT]
  VARS        : time-variant variables as cell array of strings
  RHS         : right-hand side of the ODE, either as string or symbolic
                expression
  TIME        : string representing a ADMITtime object, 
                or (named) ADMITtime object; 
                dynamics are considered for this time point set;
  OPTIONS     : valid ADMIToptions object

Returns
  OPT : valid ADMITproject-object

Examples

The following code adds dynamics for states "c" and "s" by
time-discretization (using Euler-implicit) of the right-hand-sides.
opt = ADMITproject();
opt = ADMITdiscretizeDynamics(opt,'eulerImplicit',...
        {'c(t)','s(t)'},...
        {'(1-c(t))*p1*s(t)-(p2+p3)*c(t)',...
         '(c(t)-1)*p1*s(t)+p2*c(t)'},...
         't_m0')