comparison m-toolbox/html_help/help/ug/ssm_build_built_in_content.html @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
5 <TITLE></TITLE>
6 <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.1 (Win32)">
7 <META NAME="CREATED" CONTENT="0;0">
8 <META NAME="CHANGEDBY" CONTENT="Adrien G">
9 <META NAME="CHANGED" CONTENT="20090827;17232200">
10 </HEAD>
11 <BODY LANG="en-US" DIR="LTR">
12 <P>Built-in models enable to build fast predefined models to use
13 later in simulations.</P>
14 <H2>Using existing built-in models</H2>
15 <P>The constructor can be called using either of the following
16 syntax:</P>
17 <DIV CLASS="fragment"><PRE><FONT COLOR="#000000">&gt;&gt; system = ssm(plist(</FONT><FONT COLOR="#a020f0">'built-in'</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#a020f0">'&lt;model name&gt;'</FONT><FONT COLOR="#000000">))</FONT>
18 <FONT COLOR="#000000">&gt;&gt; system = ssm(plist(</FONT><FONT COLOR="#a020f0">'built-in'</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#a020f0">'&lt;model number&gt;'</FONT><FONT COLOR="#000000">)) </FONT></PRE></DIV><P>
19 If the user does not know the model name/number, then he may use the
20 following call to see the list of all models :</P>
21 <DIV CLASS="fragment"><PRE STYLE="margin-bottom: 0.5cm">&gt;&gt;<FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>system = ssm(plist(</FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'built-in'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, </FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>''</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>))</FONT></FONT></FONT></PRE></DIV><P STYLE="margin-bottom: 0cm">
22 This way the numbers and names are displayed in an error message.
23 </P>
24 <P STYLE="margin-bottom: 0cm">Note that the numbers may change if a
25 new model is added, and using the name is highly recommended.</P>
26 <P STYLE="margin-bottom: 0cm"><BR>
27 </P>
28 <P STYLE="margin-bottom: 0cm">The LTPDA includes one mass-spring
29 model which can be generated :</P>
30 <P STYLE="margin-bottom: 0cm"><BR>
31 </P>
32 <DIV CLASS="fragment"><PRE>&gt;&gt; <FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>system = ssm(plist(</FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'built-in'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, </FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'standard_system_params'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>))</FONT></FONT></FONT>
33 M: running ssm/ssm
34 M: running ssmFromBuiltinSystem
35 M: looking for models in C:\Documents and Settings\Adrien.IFR-NB01\My Documents\MATLAB2008\LTPDA_SSM_MODELS\ltp_ssm_models
36 M: looking for models in C:\Users\Adrien.IFR-NB01\My Documents\MATLAB2008\ltpda_toolbox\ltpda\classes\@ssm\..\..\m\built_in_models
37 M: running buildParamPlist
38 M: running ssm/ssm
39 M: running ssm/ssm
40 M: running fromStruct
41 M: running ssm/ssm
42 M: running validate
43 M: running validate
44 M: running display
45 ------ ssm/1 -------
46 amats: { [2x2] } [1x1]
47 mmats: { [2x2] } [1x1]
48 bmats: { [2x1] [2x2] } [1x2]
49 cmats: { [1x2] } [1x1]
50 dmats: { [] [1x2] } [1x2]
51 timestep: 0
52 inputs: [1x2 ssmblock]
53 1 : U | Fu [kg m s^(-2)]
54 2 : N | Fn [kg m s^(-2)], On [m]
55 states: [1x1 ssmblock]
56 1 : standard test system | x [m], xdot [m s^(-1)]
57 outputs: [1x1 ssmblock]
58 1 : Y | y [m]
59 params: (empty-plist) [1x1 plist]
60 version: $Id: ssm_build_built_in_content.html,v 1.3 2009/08/28 14:20:07 adrien Exp $--&gt;$Id: ssm_build_built_in_content.html,v 1.3 2009/08/28 14:20:07 adrien Exp $
61 Ninputs: 2
62 inputsizes: [1 2]
63 Noutputs: 1
64 outputsizes: 1
65 Nstates: 1
66 statesizes: 2
67 Nparams: 0
68 isnumerical: true
69 hist: ssm.hist [1x1 history]
70 procinfo: (empty-plist) [1x1 plist]
71 plotinfo: (empty-plist) [1x1 plist]
72 name: standard_system_params
73 description: standard spring-mass-dashpot test system
74 mdlfile:
75 UUID: 4415784d-79d9-408d-9b82-3f39ace0d518</PRE></DIV><H2>
76 Options for the built-in constructor</H2>
77 <P>There are two options:</P>
78 <UL>
79 <LI><P>NAME and DESCRIPTION allow to set the object's name and
80 description in the constructor</P>
81 <LI><P>DIM allows to reduce the model to 3, 2 or 1 dimension. Lower
82 dimension models are built using the 3D model and deleting
83 inputs/states/outputs. The consequence is that parameters that
84 affect primarily the 3D model may still remain in the 1D model in
85 the &bdquo;params&ldquo; field, but also in the matrices if they
86 have a small effect on the 1D dynamics.</P>
87 <LI><P>WITHPARAMS allows to keep selected parameters symbolic, to
88 modify their value later. However current issues with MuPad make the
89 use of multiple symbolic systems complicated, as the symbolic
90 parameters are global variable with problematic side effects. The
91 keyword 'ALL' returns the system with all its parameters symbolic.</P>
92 <DIV CLASS="fragment"><PRE>&gt;&gt; system = ssm(plist(<FONT COLOR="#a020f0">'built-in'</FONT>, <FONT COLOR="#a020f0">'standard_system_params'</FONT>, <FONT COLOR="#a020f0">'withparams'</FONT>, {<FONT COLOR="#a020f0">'D'</FONT>}))
93 &gt;&gt; system = ssm(plist(<FONT COLOR="#a020f0">'built-in'</FONT>, <FONT COLOR="#a020f0">'standard_system_params'</FONT>, <FONT COLOR="#a020f0">'withparams'</FONT>, <FONT COLOR="#a020f0">'ALL'</FONT>))
94 &gt;&gt; <FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>sys = ssm(plist(</FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'built-in'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, </FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'standard_system_params'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, </FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'setnames'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, {</FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'W'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>}, </FONT></FONT></FONT><FONT COLOR="#a020f0"><FONT FACE="Courier New, monospace"><FONT SIZE=2>'setvalues'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><FONT SIZE=2>, 0.2*i ));</FONT></FONT></FONT></PRE></DIV><P>
95 Trying sys.isStable with the first and the third system shows a
96 different result, the negative stiffness making the latter unstable.</P>
97 </UL>
98 <UL>
99 <LI><P>SETNAMES and SETVALUES allow to set the value for parameters,
100 including those which are not kept symbolic. The first field is a
101 cell array of strings, the second is a double array of the
102 corresponding values.</P>
103 </UL>
104 <H2>How to make your own built-in model?</H2>
105 <P>The model must exist as a function mfile in the built-in folders
106 defined in the LTPDA preferences panel. The file name must be
107 &ldquo;ssm_model_&lt;model name&gt;.m&rdquo; .</P>
108 <P>A good template to start writing a file should be
109 &ldquo;ssm_model_standard_system_params.m&rdquo;. The model should
110 support all the options above, and the use of the ssm &ldquo;structure&ldquo;
111 constructor is recommended because it does not increment the history.</P>
112 <P><BR><BR>
113 </P>
114 </BODY>
115 </HTML>