retrieves a stored symbolic model from a MapleSim/Multibody store file (.lib) - MapleSim Help

MapleSim[Multibody][GetModel] - retrieves a stored symbolic model from a MapleSim/Multibody store file (.lib)

 Calling Sequence GetModel(libfile)
 Parameters libfile - (optional) name of the MapleSim/Multibody store file to open.  These files have a .lib file extension.
 Description Important: The GetModel command has been deprecated. Use the templates in the MapleSim templates folder to analyze your model instead. For more information, see Opening MapleSim Templates. The GetModel command returns a Maple module previously generated and stored using the MapleSim/Multibody BuildEQs command. The GetModel command is particularly useful for large systems whose symbolic equations take a long time to generate. If you use the GetModel command with no arguments, a dialog box allows you to select the .lib store file.

Examples

Important: The GetModel command has been deprecated. Use the templates in the MapleSim document folder to analyze your model instead.

The example shows how the GetModel command can be used to retrieve a stored symbolic model quickly without regenerating the model equations. Construct a store file for the model by using the BuildEQs command.

 > $\mathrm{leArguments}≔\left['\mathrm{InputString}'=\mathrm{MapleSim}:-\mathrm{Multibody}:-\mathrm{GetMultibodyInput}\left("Simulation0"\right),'\mathrm{ModelName}'="SliderCrank",'\mathrm{KinSimpType}'="Simplify",'\mathrm{DynSimpType}'="Simplify",'\mathrm{AugType}'="Lagrange",'\mathrm{MaxSmallQOrder}'=1,'\mathrm{SaveToLib}'=\mathrm{true},'\mathrm{SilentMode}'=\mathrm{false}\right]:$$\mathrm{MapleSim}:-\mathrm{Multibody}:-\mathrm{BuildEQs}\left(\mathrm{op}\left(\mathrm{leArguments}\right)\right):$
 ${"Analyzing system..."}$
 ${"Performing constraint analysis..."}$
 ${"The system has 1 degree\left(s\right) of freedom. It is modeled using 3 generalized coordinate\left(s\right) coupled by 2 algebraic constraint\left(s\right)."}$
 ${"Peforming a dynamic analysis using an augmented Lagrange formulation - system variables shown below:"}$
 ${"vQ"}{,}\left[\begin{array}{c}{\mathrm{s_P2}}{}\left({t}\right)\\ {\mathrm{theta_R1}}{}\left({t}\right)\\ {\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vP"}{,}\left[\begin{array}{c}\frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{s_P2}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R1}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vPdot"}{,}\left[\begin{array}{c}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{s_P2}}{}\left({t}\right)\\ \frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{theta_R1}}{}\left({t}\right)\\ \frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vLambda"}{,}\left[\begin{array}{c}{\mathrm{λ1}}{}\left({t}\right)\\ {\mathrm{λ2}}{}\left({t}\right)\end{array}\right]$
 ${"Dynamic analysis complete."}$
 ${"Saving model for future use...:"}$
 ${"Model saved to: c:/SliderCrank.lib"}$
 ${"Use Model := MapleSim:-Multibody:-GetModel\left("c:/SliderCrank.lib"\right): to retrieve stored model."}$ (4.1)

You can now show one of the outputs of the model. In this example, the mass matrix is shown.

 > $\mathrm{SliderCrank}:-\mathrm{xM}$
 $\left[\begin{array}{ccc}{2.500000000}& {0}& {0.2500000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)\\ {0}& {0.007500000000}& {0}\\ {0.2500000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {0}& {0.1290000000}\end{array}\right]$ (4.2)

By restarting the system, the generated symbolic module MyModel is removed from Maple's memory, thus, none of its symbolic entries are accessible.

 > $\mathrm{restart}:$$\mathrm{SliderCrank}:-\mathrm{xM}$
 Error, SliderCrank does not evaluate to a module

As indicated in the output of BuildEQs, the generated symbolic model can be retrieved using the GetModel command.  When they are assigned to a worksheet variable, the properties of the retrieved model are accessible again.

 > $\mathrm{MyModel}≔\mathrm{MapleSim}:-\mathrm{Multibody}:-\mathrm{GetModel}\left("C:/SliderCrank.lib"\right):$$\mathrm{MyModel}:-\mathrm{xM}$
 $\left[\begin{array}{ccc}{2.500000000}& {0}& {0.2500000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)\\ {0}& {0.007500000000}& {0}\\ {0.2500000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {0}& {0.1290000000}\end{array}\right]$ (4.3)