ml_ct_ss_simulate_ie

Implicit Euler first-order integrator.

Contents

Syntax

[t, y, info] = ml_ct_ss_simulate_ie(sys1, ..., sysN)
[t, y, info] = ml_ct_ss_simulate_ie(sys1, ..., sysN, opts)
[t, y, info] = ml_ct_ss_simulate_ie(sys, rom1, ..., romM)
[t, y, info] = ml_ct_ss_simulate_ie(sys, rom1, ..., romM, opts)

Description

This function can be used to simulate first-order dynamical systems of the form

   x'(t) = A*x(t) + B*u(t),
    y(t) = C*x(t) + D*u(t),

where the first-order implicit Euler method is used. If no input function u is given, the unit step response is computed.

Input

sys1, ..., sysN - struct, containing first-order descriptor systems {!} rom1, ..., romM - struct, containing first-order descriptor systems {!} * opts - structure, containing the following optional entries:

Parameter
Meaning
DiffMode
character array, determining type of plot
  • 'off' - time response plots of sys1, sys2, ...
  • 'abs' - absolute errors sys-rom1, sys-rom2, ...
  • 'rel' - relative errors sys-rom1, sys-rom2, ...
  • 'all' - all plot types are shown
default: 'off'
Info
{0, 1}, used to disable/enable display of sampling steps
default: 0
InputFcn
function handle, input function u(t) which takes a time argument and returns an input vector of appropriate size
default: ones(m, 1)
InputRange
vector of length <= 2, time range in which the input function u(t) is applied to the system, otherwise u = 0, if only a scalar tu0 is given, the input time interval is taken to be [tu0, tf]
default: opts.TimeRange
LineSpecs
{!}
character array, determining the line specifications for the plots
default: '-'
ShowPlot
{0, 1}, used to disable/enable showing of plots
default: 1
StoreStates
{0, 1}, used to disable/enable storing the computed system states additionally
default: 0
TimePoints
positive integer, number of equally distributed points in the time range, only used if opts.TimeSample == 'equalpts'
default: 500
TimeRange
vector of length <= 2, time range in which the system is simulated, if only a scalar tf is given, time range is set to be [0, tf]
default: [0 10]
TimeSample
vector or character array, determining the way of sampling the time points
  • 'equalpts' - equally distributed opts.TimePoints
  • 'equalstep' - equally distributed opts.TimeStep
  • [numeric] - given time values are used
default: 'equalpts'
TimeStep
scalar, time step size, only use if opts.TimeSample == 'equalstep'
default: (tf - t0) / 500
X0
{!}
vector, initial states of x(t)
default: zeros(n, 1)

Note: Arguments/Parameters marked with {!} may also be a cell array containing multiple arguments.

Output

Entry
Meaning
AbsErr
if opts.DiffMode == 'off' empty, otherwise matrix of size p x (number samples) x (number systems-1), containing the computed absolute error values
Npts
positive integer, number of plotted points
RelErr
if opts.DiffMode == 'off' empty, otherwise matrix of size p x (number samples) x (number systems-1), containing the computed relative error values
X
if opts.StoreStates == 0 empty, otherwise cell array of length (number systems) containing matrices of size n x (number samples) with the computed states

See Also

ml_ct_ss_simulate_ss11 | ml_ct_ss_simulate_ss21