ml_dt_ss_simulate
Discrete-time simulation of standard systems.
Contents
Syntax
[t, y, info] = ml_dt_ss_simulate(sys1, ..., sysN) [t, y, info] = ml_dt_ss_simulate(sys1, ..., sysN, opts)
[t, y, info] = ml_dt_ss_simulate(sys, rom1, ..., romM) [t, y, info] = ml_dt_ss_simulate(sys, rom1, ..., romM, opts)
Description
This function can be used to simulate first-order discrete-time dynamical systems of the form
x(t+1) = A*x(t) + B*u(t), y(t) = C*x(t) + D*u(t).
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
|
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 |
TimeRange | nonnegative 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] |
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
- t - vector of size (number samples), conatining the time sampling points
- y - 3-D array of size p x (number samples) x (number systems), containing the outputs of the systems at the time points t
- info - structure, containing the following information:
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