perform and store a forward dynamic simulation on a model created with MapleSim/Multibody - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : Multibody : Deprecated Commands : MapleSim/Multibody/BuildSimulation(deprecated)

MapleSim[Multibody][BuildSimulation] - perform and store a forward dynamic simulation on a model created with MapleSim/Multibody

Calling Sequence

BuildSimulation(MSimMultibodyModel, options)

Parameters

MSimMultibodyModel - Maple module of a system created using the BuildEQs command or retrieved from a MapleSim/Multibody store file (`.lib`) using the GetModel command.  

options  - (optional) equations of the form keyword = value

Description

Important: The BuildSimulation 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 BuildSimulation command performs a forward dynamic simulation on the selected model equations of motion. The command uses dsolve/numeric to integrate the equations. In most cases, BuildSimulation converts the governing equations into an optimized Maple procedure before the integration.  However, if a differential-algebraic equation (DAE) solver is requested (rkf45_dae or mebdfi), BuildSimulation passes the unaltered system equation equations directly to dsolve/numeric/DAE.

Options

  

'SimName'= string

The name of the created simulation.  All of the simulation settings, numerical substitutions, initial conditions, and results are accessible from the store file of the model (`.lib`) under this name. Additionally, when you run the BuildSimulation command, the simulation results (as returned by dsolve/numeric) are assigned to this name in the global worksheet.  

  

 

  

'NumericSubs'= list

A list of equations of the form `parameter=value`. Any parameters or functions that are not explicitly given a value are set to 0.

 

  

'ICs'= list

A list of floats indicating the initial conditions for the simulation. The order of the elements in the list is assumed to be the same as the order of the model's state variables (the model's vX export).

 

  

'Integrator'= string

A string indicating which of dsolve/numeric integrators are used to perform the forward dynamic simulations. Valid options are rkf45 (default), rkf45_dae, dverk78, gear[bstoer], gear[polyextr], lsode[adamsfunc], lsode[backfull], and mebdfi.

 

  

'RelErrTol'= float

A float indicating the limit on the relative error tolerance for a successful integration step.  The default value is 0.001.  For more information, see dsolve/numeric.

 

  

'AbsErrTol'= float

A float indicating the limit on the absolute error tolerance for a successful integration step. The default value is 0.001.  For more information, see dsolve/numeric.

 

  

'Duration'= numeric

A numeric value indicating the duration of the simulation. The default value is 1.

 

  

'NumStorePoints'= posint

A positive integer indicating the number of data points to store. The stored data points are evenly distributed over the duration of the simulation.

 

  

'Baumgarte'= list

A list of the form [ALPHA, BETA], where ALPHA and BETA are the Baumgarte constraint stabilization parameters, as described in the Dynamic exports page.  These parameters are used to control position and velocity constraint violation for constrained systems that are not integrated with a DAE solver..

 

  

'SilentMode'= boolean

Setting this option to true hides the output generated by the BuildSimulation command.  The default value is false.

Examples

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

The example below shows an embedded MapleSim model of a planar slider-crank mechanism. In this example, the embedded component name is Simulation0 and the model name is SliderCrank. When a simulation is created, you can plot simulation results using the BuildPlot command.

leArguments:='InputString'=MapleSim:-Multibody:-GetMultibodyInputSimulation0,'ModelName'=SliderCrank,'KinSimpType'=Simplify,'DynSimpType'=Simplify,'AugType'=Lagrange,'MaxSmallQOrder'=1,'SaveToLib'=true,'SilentMode'=false:MapleSim:-Multibody:-BuildEQsopleArguments:

Analyzing system...

Performing constraint analysis...

The system has 1 degree(s) of freedom. It is modeled using 3 generalized coordinate(s) coupled by 2 algebraic constraint(s).

Peforming a dynamic analysis using an augmented Lagrange formulation - system variables shown below:

vQ,s_P2ttheta_R1ttheta_R5t,vP,ⅆⅆts_P2tⅆⅆttheta_R1tⅆⅆttheta_R5t,vPdot,ⅆ2ⅆt2s_P2tⅆ2ⅆt2theta_R1tⅆ2ⅆt2theta_R5t,vLambda,λ1tλ2t

Dynamic analysis complete.

Saving model for future use...:

Model saved to: C:/Documents and Settings/cschmitke/My Documents/HelpPages/Multibody/Building_Simulations/SliderCrank.lib

Use `Model := MapleSim:-Multibody:-GetModel("C:/Documents and Settings/cschmitke/My Documents/HelpPages/Multibody/Building_Simulations/SliderCrank.lib"):` to retrieve stored model.

(5.1)

The order of the initial conditions must match the order to the variables in the vX state vector:

convertSliderCrank:-vX,list;leICs:=0,0,0,1.5,0,0

ⅆⅆts_P2t,ⅆⅆttheta_R1t,ⅆⅆttheta_R5t,s_P2t,theta_R1t,theta_R5t

leICs:=0,0,0,1.5,0,0

(5.2)

leArguments:=SliderCrank,'SimName'=Sim_rkf45,'NumericSubs'=,'ICs'=leICs,'Integrator'=rkf45,'RelErrTol'=0.001,'AbsErrTol'=0.001,'Baumgarte'=1,1,'Duration'=5,'NumStorePoints'=200,'SilentMode'=false:MapleSim:-Multibody:-BuildSimulationopleArguments:

***Generating forward dynamics simulation procedure (pXdot) ***

Order of the State Variable Array:

ⅆⅆts_P2t,ⅆⅆttheta_R1t,ⅆⅆttheta_R5t,s_P2t,theta_R1t,theta_R5t

Order of the Constant Parameter Array:

Order of the Inputs Array:

--------------Processing Xdot-------------

Procedure `pXdot` created in the Maple workspace.

pXdot(NumStates, t, States, StateDerivatives) #compatible with `dsolve/numeric`

4functions+24subscripts+93assignments+80multiplications+58additions+3divisions

----duration: .94e-1 seconds----

***Starting simulation....***

Simulation complete - duration = .62e-1 seconds

Saving simulation for future use...:

Assigning simulation to workspace variable 'Sim_rkf45'.

(5.3)

MapleSim:-Multibody:-BuildPlotSliderCrank

See Also

Dynamic Exports, Kinematic Exports, MapleSim, MapleSim[Multibody][BuildEQs], MapleSim[Multibody][BuildExpression](deprecated), MapleSim[Multibody][BuildPlot](deprecated), MapleSim[Multibody][GetModel](deprecated), MapleSim[Multibody][GetMultibodyInput]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam