Building from built-in models


Built-in models enable to build fast predefined models to use later in simulations.

Using existing built-in models

The constructor can be called using either of the following syntax:

>> system = ssm(plist('built-in', '<model name>'))
>> system = ssm(plist('built-in', '<model number>')) 

If the user does not know the model name/number, then he may use the following call to see the list of all models :

>> system = ssm(plist('built-in', ''))

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 :


>> system = ssm(plist('built-in', 'standard_system_params'))
M: running ssm/ssm
M: running ssmFromBuiltinSystem
M:   looking for models in C:\Documents and Settings\Adrien.IFR-NB01\My Documents\MATLAB2008\LTPDA_SSM_MODELS\ltp_ssm_models
M:   looking for models in C:\Users\Adrien.IFR-NB01\My Documents\MATLAB2008\ltpda_toolbox\ltpda\classes\@ssm\..\..\m\built_in_models
M: running buildParamPlist
M: running ssm/ssm
M: running ssm/ssm
M: running fromStruct
M: running ssm/ssm
M: running validate
M: running validate
M: running display
------ ssm/1 -------
      amats: {  [2x2]  }  [1x1]
      mmats: {  [2x2]  }  [1x1]
      bmats: {  [2x1]   [2x2]  }  [1x2]
      cmats: {  [1x2]  }  [1x1]
      dmats: {   []     [1x2]  }  [1x2]
   timestep: 0
     inputs:  [1x2 ssmblock]
         1 : U | Fu [kg m s^(-2)]
         2 : N | Fn [kg m s^(-2)], On [m]
     states:  [1x1 ssmblock]
         1 : standard test system | x [m], xdot [m s^(-1)]
    outputs:  [1x1 ssmblock]
         1 : Y | y [m]
     params: (empty-plist) [1x1 plist]
    version: $Id$-->$Id$
    Ninputs: 2
 inputsizes: [1 2]
   Noutputs: 1
outputsizes: 1
    Nstates: 1
 statesizes: 2
    Nparams: 0
isnumerical: true
       hist: ssm.hist [1x1 history]
   procinfo: (empty-plist) [1x1 plist]
   plotinfo: (empty-plist) [1x1 plist]
       name: standard_system_params
description: standard spring-mass-dashpot test system
    mdlfile: 
       UUID: 4415784d-79d9-408d-9b82-3f39ace0d518

Options for the built-in constructor

There are two options:

How to make your own built-in model?

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.





©LTP Team