ml_ct_dss_simulate_ss11
Single step first-order integrator.
Contents
Syntax
[t, y, info] = ml_ct_dss_simulate_ss11(sys1, ..., sysN) [t, y, info] = ml_ct_dss_simulate_ss11(sys1, ..., sysN, opts)
[t, y, info] = ml_ct_dss_simulate_ss11(sys, rom1, ..., romM) [t, y, info] = ml_ct_dss_simulate_ss11(sys, rom1, ..., romM, opts)
Description
This function can be used to simulate first-order dynamical systems of the form
E*x'(t) = A*x(t) + B*u(t), y(t) = C*x(t) + D*u(t),
where the first-order single step residual weighted integration formulas are used. The parameter opts.Theta can be used to tune the convergence and stability of the method. 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 |
Theta | nonnegative scalar, residual weighting parameter, set to 0 for explicit methods default: 0.5 |
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
|
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
- 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 |
Reference
O. C. Zienkiewicz, R. L. Taylor, J. Z. Zhu, The Finite Element Method: Its Basis and Fundamentals, 6th Edition, Butterworth-Heinemann, 2005.
See Also