comparison m-toolbox/html_help/help/ug/ssm_build_built_in.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.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>Building from built-in models (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "ssm_build_description.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Building from scratch"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "ssm_modify.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Modifying systems"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Building from built-in models</h1>
37 <hr>
38
39 <p>
40 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
41 <HTML>
42 <HEAD>
43 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
44 <TITLE></TITLE>
45 <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.1 (Win32)">
46 <META NAME="CREATED" CONTENT="0;0">
47 <META NAME="CHANGEDBY" CONTENT="Adrien G">
48 <META NAME="CHANGED" CONTENT="20090827;17232200">
49 </HEAD>
50 <BODY LANG="en-US" DIR="LTR">
51 <P>Built-in models enable to build fast predefined models to use
52 later in simulations.</P>
53 <H2>Using existing built-in models</H2>
54 <P>The constructor can be called using either of the following
55 syntax:</P>
56 <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>
57 <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>
58 If the user does not know the model name/number, then he may use the
59 following call to see the list of all models :</P>
60 <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">
61 This way the numbers and names are displayed in an error message.
62 </P>
63 <P STYLE="margin-bottom: 0cm">Note that the numbers may change if a
64 new model is added, and using the name is highly recommended.</P>
65 <P STYLE="margin-bottom: 0cm"><BR>
66 </P>
67 <P STYLE="margin-bottom: 0cm">The LTPDA includes one mass-spring
68 model which can be generated :</P>
69 <P STYLE="margin-bottom: 0cm"><BR>
70 </P>
71 <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>
72 M: running ssm/ssm
73 M: running ssmFromBuiltinSystem
74 M: looking for models in C:\Documents and Settings\Adrien.IFR-NB01\My Documents\MATLAB2008\LTPDA_SSM_MODELS\ltp_ssm_models
75 M: looking for models in C:\Users\Adrien.IFR-NB01\My Documents\MATLAB2008\ltpda_toolbox\ltpda\classes\@ssm\..\..\m\built_in_models
76 M: running buildParamPlist
77 M: running ssm/ssm
78 M: running ssm/ssm
79 M: running fromStruct
80 M: running ssm/ssm
81 M: running validate
82 M: running validate
83 M: running display
84 ------ ssm/1 -------
85 amats: { [2x2] } [1x1]
86 mmats: { [2x2] } [1x1]
87 bmats: { [2x1] [2x2] } [1x2]
88 cmats: { [1x2] } [1x1]
89 dmats: { [] [1x2] } [1x2]
90 timestep: 0
91 inputs: [1x2 ssmblock]
92 1 : U | Fu [kg m s^(-2)]
93 2 : N | Fn [kg m s^(-2)], On [m]
94 states: [1x1 ssmblock]
95 1 : standard test system | x [m], xdot [m s^(-1)]
96 outputs: [1x1 ssmblock]
97 1 : Y | y [m]
98 params: (empty-plist) [1x1 plist]
99 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 $
100 Ninputs: 2
101 inputsizes: [1 2]
102 Noutputs: 1
103 outputsizes: 1
104 Nstates: 1
105 statesizes: 2
106 Nparams: 0
107 isnumerical: true
108 hist: ssm.hist [1x1 history]
109 procinfo: (empty-plist) [1x1 plist]
110 plotinfo: (empty-plist) [1x1 plist]
111 name: standard_system_params
112 description: standard spring-mass-dashpot test system
113 mdlfile:
114 UUID: 4415784d-79d9-408d-9b82-3f39ace0d518</PRE></DIV><H2>
115 Options for the built-in constructor</H2>
116 <P>There are two options:</P>
117 <UL>
118 <LI><P>NAME and DESCRIPTION allow to set the object's name and
119 description in the constructor</P>
120 <LI><P>DIM allows to reduce the model to 3, 2 or 1 dimension. Lower
121 dimension models are built using the 3D model and deleting
122 inputs/states/outputs. The consequence is that parameters that
123 affect primarily the 3D model may still remain in the 1D model in
124 the &bdquo;params&ldquo; field, but also in the matrices if they
125 have a small effect on the 1D dynamics.</P>
126 <LI><P>WITHPARAMS allows to keep selected parameters symbolic, to
127 modify their value later. However current issues with MuPad make the
128 use of multiple symbolic systems complicated, as the symbolic
129 parameters are global variable with problematic side effects. The
130 keyword 'ALL' returns the system with all its parameters symbolic.</P>
131 <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>}))
132 &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>))
133 &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>
134 Trying sys.isStable with the first and the third system shows a
135 different result, the negative stiffness making the latter unstable.</P>
136 </UL>
137 <UL>
138 <LI><P>SETNAMES and SETVALUES allow to set the value for parameters,
139 including those which are not kept symbolic. The first field is a
140 cell array of strings, the second is a double array of the
141 corresponding values.</P>
142 </UL>
143 <H2>How to make your own built-in model?</H2>
144 <P>The model must exist as a function mfile in the built-in folders
145 defined in the LTPDA preferences panel. The file name must be
146 &ldquo;ssm_model_&lt;model name&gt;.m&rdquo; .</P>
147 <P>A good template to start writing a file should be
148 &ldquo;ssm_model_standard_system_params.m&rdquo;. The model should
149 support all the options above, and the use of the ssm &ldquo;structure&ldquo;
150 constructor is recommended because it does not increment the history.</P>
151 <P><BR><BR>
152 </P>
153 </BODY>
154 </HTML>
155 </p>
156
157 <br>
158 <br>
159 <table class="nav" summary="Navigation aid" border="0" width=
160 "100%" cellpadding="0" cellspacing="0">
161 <tr valign="top">
162 <td align="left" width="20"><a href="ssm_build_description.html"><img src=
163 "b_prev.gif" border="0" align="bottom" alt=
164 "Building from scratch"></a>&nbsp;</td>
165
166 <td align="left">Building from scratch</td>
167
168 <td>&nbsp;</td>
169
170 <td align="right">Modifying systems</td>
171
172 <td align="right" width="20"><a href=
173 "ssm_modify.html"><img src="b_next.gif" border="0" align=
174 "bottom" alt="Modifying systems"></a></td>
175 </tr>
176 </table><br>
177
178 <p class="copy">&copy;LTP Team</p>
179 </body>
180 </html>