ml_ct_soss_simulate_ss22

Single step second-order integrator.

Contents

Syntax

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

Description

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

   M*x''(t) + E*x'(t) + K*x(t) = Bu*u(t),
                          y(t) = Cp*x(t) + Cv*x'(t) + D*u(t),

where the second-order single step residual weighted integration formulas are used. The parameters opts.Theta1 and opts.Theta2 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 second-order systems {!} rom1, ..., romM - struct, containing second-order 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
Theta1
nonnegative scalar, first residual weighting parameter, set to 0 for explicit methods
default: 0.5
Theta2
nonnegative scalar, second residual weighting parameter
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
  • '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
Xp0
{!}
vector, initial states of the positions x(t)
default: zeros(n, 1)
Xv0
{!}
vector, initial states of the velocities 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
Xv
if opts.StoreStates == 0 empty, otherwise cell array of length (number systems) containing matrices of size n x (number samples) with the computed states
Xv
if opts.StoreStates == 0 empty, otherwise cell array of length (number systems) containing matrices of size n x (number samples) with the computed first derivatives

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

ml_ct_soss_simulate_ie