MapleSim
GetEquations(deprecated)
return the system of equations for the input system
Calling Sequence
Parameters
Returns
Options
Description
Examples
GetEquations( modelFile, modelName, opts )
modelFile
-
(optional) string; Modelica model code string or file name
modelName
(optional) string; Modelica model name
opts
(optional) equation(s) of the form option = value; specify options for GetEquations
GetEquations returns an expression sequence with the following sets: eqs, ics, constrs, params, vars, aux, probes,Boolean, Discrete, Function.
eqs contains the core continuous equations.
ics contains the initial conditions for the system.
constrs contains the constraint equations obtained from the index reduction process. If simplify<>tryhard, constrs is an empty set.
params contains the parameter substitution equations that define the values of the symbolic parameters remaining in the system equations in eqs.
vars contains the system variables in eqs.
aux contains the auxiliary equations defining the auxiliary variables in terms of the system variables found in vars. Auxiliary variables are variables that have been eliminated from the system through the simplification process.
probes contains the variable names to which probes are attached.
Boolean contains the Boolean equations.
Discrete contains the discontinuous equations.
Functions contains the procedures defined in the system.
is_immediate = truefalse
The is_immediate keyword parameter specifies whether the optional parameter modelFile is interpreted as the file name of the Modelica source file or as the Modelica model code string.
When is_immediate=true, the modelFile parameter is interpreted as containing the actual Modelica code. Otherwise, it is interpreted as the name of the Modelica source file.
mbaumgarte = list(nonnegative,nonnegative)
The mbaumgarte keyword parameter specifies the value of the Baumgarte constraint stabilization parameters ([α, β]) applied to the multibody portion of the system. If the value is greater than 0, the position-level constraints are removed from the multibody system and replaced by Baumgarte stabilized acceleration constraints, effectively transforming the multibody DAEs to pure ODEs. The default value is [0,0].
symbolicname = Or( list(name), `all` )
The symbolicname keyword parameter specifies a list of parameter names to be kept as symbolic in the returned equations. For example, if the system has two parameters J=1 and C=2, having symbolicname=[J] will keep the parameter J in the returned equations while the value of C will be substituted in.
With the default setting of symbolicname=[], the returned equations will have all of the parameter values substituted in.
The special case of symbolicname=all specifies that all of the parameter names in the system are kept symbolic in the returned equations.
start_time = numeric
If specified then it is used by the flattener to override the default start time (which is 0). Note that non-zero start times are currently not supported by the simulation engine.
timefunction = truefalse
The timefunction keyword parameter specifies whether the variables in the returned equations are expressed as a function of time, for example, x(t), or simply as inert names, for example, x.
When timefunction=true, the default setting, the function of time form is returned. Otherwise, the inert name form is returned.
The name of the independent time variable is specified by the time field of the flattened record.
simplify = Or( truefalse, `tryhard` )
The simplify keyword parameter specifies the type of simplification to apply to the system equations.
The simplify=false option returns the equations without any simplification.
The simplify=true option simplifies the system model by eliminating redundant variables and equations in the system. This is the default setting.
The simplify=tryhard option applies redundant variable removal and index reduction to the system.
This command is part of the MapleSim package. It can be used in the form GetEquations(...) only after executing the command with(MapleSim). However, it can always be accessed through the long form of the command by using MapleSim[GetEquations](...).
Important: The GetEquations command has been deprecated.
The GetEquations command returns a list of equations that describe the behavior of the system model.
You can specify the input systems in two ways: by using a Modelica model source file name or a Modelica model code string.
To specify the input system using the file name of a Modelica model source, set the modelFile parameter to the file name and the modelName parameter to the name of the model.
To specify the input system using the Modelica code string, set the modelFile parameter, which passes the code string, and set the keyword parameter option is_immediate to true.
The options parameters are optional parameters of the form option = value, where option is one of the names listed below. These are keyword parameters; the left side of the equation is the keyword and the right side is the value. Each keyword parameter has a default value that is assigned if the parameter is not passed.
with⁡MapleSim:
Assign a string that corresponds to a simple Modelica deck.
model≔model Main Real y,z;initial equation y = 0;equation der(y) = if time < 1 then time else time^2; z = y + sin(time); annotation(probes = {y,z});end Main;
Call GetEquations, using the is_immediate option to indicate that the input is a literal Modelica deck.
eqs,ics,constrs,params,vars,aux,probes,bool,disc,func≔MapleSim:-GetEquations⁡model,is_immediate:
The eqs set contains the core differential equations of the system.
eqs
ⅆⅆtMain.y⁡t−msim/CVAR1⁡t=0,Main.z⁡t−Main.y⁡t−sin⁡t=0,msim/CVAR1⁡t=tt<1t2otherwise
The `msim/RVAR1`(t) variable represents a boolean relation; it is defined in bool.
bool
∅
Given the simplicity of the equations, we can substitute bool into eqs after calling subsindets to change the condition in the piecewise expression to the proper form.
deqs≔subs⁡bool,subsindets⁡eqs,anything=identical⁡true,lhs
deqs≔ⅆⅆtMain.y⁡t−msim/CVAR1⁡t=0,Main.z⁡t−Main.y⁡t−sin⁡t=0,msim/CVAR1⁡t=tt<1t2otherwise
Pass the set of differential equations to dsolve for a symbolic solution.
dsol≔dsolve⁡deqs
dsol≔Main.y⁡t=t22t≤1t33+161<t+c__1,Main.z⁡t=t22t≤1t33+161<t+c__1+sin⁡t,msim/CVAR1⁡t=tt<1t2otherwise
See Also
Download Help Document