LTPDA Toolbox™ | contents | ![]() ![]() |
Built-in models enable to build fast predefined models to use later in simulations.
The constructor can be called using either of the following syntax:
sys = ssm(plist('built-in', '<model name>'));
ssm.getBuiltInModels
This way the numbers and names are displayed in an error message.
Note that the numbers may change if a new model is added, and using the name is highly recommended.
The LTPDA includes one mass-spring model which can be generated:
sys = ssm(plist('built-in', 'SMD')) M: running buildParamPlist M: running buildParamPlist M: running update_struct M: running validate M: running validate M: running display ------ ssm/1 ------- amats: { [2 x2 ] } [1x1] bmats: { [2 x1 ] [2 x2 ] } [1x2] cmats: { [1 x2 ] } [1x1] dmats: { [0] [1 x2 ] } [1x2] timestep: 0 inputs: [1x2 ssmblock] 1 : CMD | f [kg m s^(-2)] 2 : DIST_SMD | f [kg m s^(-2)], s [m] states: [1x1 ssmblock] 1 : SMD | x [m], xdot [m s^(-1)] outputs: [1x1 ssmblock] 1 : SMD | obs [m] numparams: (SMD_W=0.20000000000000001, SMD_C=0.5, SMD_S1=0, SMD_S2=0, SMD_B=1, SMD_D1=0) params: (empty-plist) Ninputs: 2 inputsizes: [1 2] Noutputs: 1 outputsizes: 1 Nstates: 1 statesizes: 2 Nnumparams: 6 Nparams: 0 isnumerical: true hist: ssm.hist procinfo: [] plotinfo: [] name: SPRINGMASSDAMPER description: standard spring-mass-damper test system UUID: 888a56bc-f736-4d4b-b557-1521134770a6 --------------------
There are two options:
NAME and DESCRIPTION allow to set the object's name and description in the constructor
DIM allows to reduce the model to 3, 2 or 1 dimension. Lower dimension models are built using the 3D model and deleting inputs/states/outputs. The consequence is that parameters that affect primarily the 3D model may still remain in the 1D model in the „params“ field, but also in the matrices if they have a small effect on the 1D dynamics.
WITHPARAMS allows to keep selected parameters symbolic, to modify their value later. However current issues with MuPad make the use of multiple symbolic systems complicated, as the symbolic parameters are global variable with problematic side effects. The keyword 'ALL' returns the system with all its parameters symbolic.
sys = ssm(plist('built-in', 'SMD', 'SYMBOLIC PARAMS', {'D'})) sys = ssm(plist('built-in', 'SMD', 'SYMBOLIC PARAMS', 'all')) sys = ssm(plist('built-in', 'SMD', 'PARAM NAMES', {'SMD_W'}, 'PARAM VALUES', 0.2*i));
Trying
sys.isStable
PARAM NAMES and PARAM VALUES allow to set the value for parameters, including those which are not kept symbolic. The first field is a cell array of strings, the second is a double array of the corresponding values.
The model must exist as a function mfile in the built-in folders defined in the LTPDA preferences panel. The file name must be “ssm_model_<model name>.m” .
A good template to start writing a file should be “ssm_model_standard_system_params.m”. The model should support all the options above, and the use of the ssm “structure“ constructor is recommended because it does not increment the history.
![]() |
Building from scratch | Modifying systems | ![]() |
©LTP Team