Mercurial > hg > ltpda
view m-toolbox/html_help/help/ug/ssm_build_built_in.html @ 22:b11e88004fca database-connection-manager
Update collection.fromRepository
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html lang="en"> <head> <meta name="generator" content= "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org"> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii"> <title>Building from built-in models (LTPDA Toolbox)</title> <link rel="stylesheet" href="docstyle.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.52.2"> <meta name="description" content= "Presents an overview of the features, system requirements, and starting the toolbox."> </head> <body> <a name="top_of_page" id="top_of_page"></a> <p style="font-size:1px;"> </p> <table class="nav" summary="Navigation aid" border="0" width= "100%" cellpadding="0" cellspacing="0"> <tr> <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td> <td valign="baseline" align="right"><a href= "ssm_build_description.html"><img src="b_prev.gif" border="0" align= "bottom" alt="Building from scratch"></a> <a href= "ssm_modify.html"><img src="b_next.gif" border="0" align= "bottom" alt="Modifying systems"></a></td> </tr> </table> <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Building from built-in models</h1> <hr> <p> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> <TITLE></TITLE> <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.1 (Win32)"> <META NAME="CREATED" CONTENT="0;0"> <META NAME="CHANGEDBY" CONTENT="Adrien G"> <META NAME="CHANGED" CONTENT="20090827;17232200"> </HEAD> <BODY LANG="en-US" DIR="LTR"> <P>Built-in models enable to build fast predefined models to use later in simulations.</P> <H2>Using existing built-in models</H2> <P>The constructor can be called using either of the following syntax:</P> <DIV CLASS="fragment"><PRE><FONT COLOR="#000000">>> system = ssm(plist(</FONT><FONT COLOR="#a020f0">'built-in'</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#a020f0">'<model name>'</FONT><FONT COLOR="#000000">))</FONT> <FONT COLOR="#000000">>> system = ssm(plist(</FONT><FONT COLOR="#a020f0">'built-in'</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#a020f0">'<model number>'</FONT><FONT COLOR="#000000">)) </FONT></PRE></DIV><P> If the user does not know the model name/number, then he may use the following call to see the list of all models :</P> <DIV CLASS="fragment"><PRE STYLE="margin-bottom: 0.5cm">>><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"> This way the numbers and names are displayed in an error message. </P> <P STYLE="margin-bottom: 0cm">Note that the numbers may change if a new model is added, and using the name is highly recommended.</P> <P STYLE="margin-bottom: 0cm"><BR> </P> <P STYLE="margin-bottom: 0cm">The LTPDA includes one mass-spring model which can be generated :</P> <P STYLE="margin-bottom: 0cm"><BR> </P> <DIV CLASS="fragment"><PRE>>> <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> 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: ssm_build_built_in_content.html,v 1.3 2009/08/28 14:20:07 adrien Exp $-->$Id: ssm_build_built_in_content.html,v 1.3 2009/08/28 14:20:07 adrien Exp $ 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</PRE></DIV><H2> Options for the built-in constructor</H2> <P>There are two options:</P> <UL> <LI><P>NAME and DESCRIPTION allow to set the object's name and description in the constructor</P> <LI><P>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.</P> <LI><P>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.</P> <DIV CLASS="fragment"><PRE>>> 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>})) >> 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>)) >> <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> Trying sys.isStable with the first and the third system shows a different result, the negative stiffness making the latter unstable.</P> </UL> <UL> <LI><P>SETNAMES and SETVALUES 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.</P> </UL> <H2>How to make your own built-in model?</H2> <P>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” .</P> <P>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.</P> <P><BR><BR> </P> </BODY> </HTML> </p> <br> <br> <table class="nav" summary="Navigation aid" border="0" width= "100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td align="left" width="20"><a href="ssm_build_description.html"><img src= "b_prev.gif" border="0" align="bottom" alt= "Building from scratch"></a> </td> <td align="left">Building from scratch</td> <td> </td> <td align="right">Modifying systems</td> <td align="right" width="20"><a href= "ssm_modify.html"><img src="b_next.gif" border="0" align= "bottom" alt="Modifying systems"></a></td> </tr> </table><br> <p class="copy">©LTP Team</p> </body> </html>