get the equations of the active MapleSim subsystem - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : API Commands : MapleSim/LinkModel/GetEquations

GetEquations - get the equations of the active MapleSim subsystem

Calling Sequence

A := MapleSim:-LinkModel();

A:-GetEquations(options)

Parameters

options

-

(optional) equation(s) of the form name = value

Returns

• 

list : list of the subsystem's equations

Description

• 

A:-GetEquations returns the list of the linked model A subsystem's equations.

• 

If a subsystem, for which the equations are requested, contains acausal ports, the flow variables on this ports are treated as input variables, when equations are simplified. To overwrite this behavior, use the inputs option.

• 

The A := MapleSim:-LinkModel() statement needs to be run prior to successfully using any of the ModelObject A's export functions.

Notes

• 

The following internal data types can occur in the set of the event handling definitions (these specifications correspond to Modelica constructs):

Internal Data Type Name

Definition

`msim/WHEN`

A wrapper for an event specification of the form `msim/WHEN`(conditions,equations) that contains event number of arguments alternating between conditions and equations (or a sequence of equations).  It is used to specify equations that are valid only at event instants.

`msim/SEQ`

Represents a wrapper for zero, two, or more Maple expressions.  It can be used to specify a sequence of expressions inside `msim/WHEN` that are valid at a particular event instant.

_msim_change

Used to detect changes of the discrete-time variables.  _msim_change(discretevariable) returns true for an instant when the variable discretevariable changes value.

_msim_edge

Used to detect changes of boolean variables.  _msim_edge(booleanvariable) is true for a time instant when the boolean variable booleanvariable changes value from false to true.

_msim_initial

The function _msim_initial() returns true at an event instant just before the beginning of simulation (usually t=0). It can be used as a condition in `msim/WHEN` to specify additional initialization information for discrete-time variables.

_msim_noEvent

Wrapping an expression in _msim_noEvent(expression) prevents that expression from generating events. This can be used to guard expressions from going outside of their domain of validity (for example, a square root of a negative value).

_msim_pre

This function is used to obtain predecessor values of a discrete-time variable.  The function _msim_pre(discretevariable) returns, at an event instant, a value of discretevariable immediately preceding the event.

_msim_reinit

Used to reinitialize a state variable.  A call to _msim_reinit(statevariable,expression) reinitializes a state variable statevariable with expression at an event instant and deactivates any existing assignment to statevariable.

_msim_sample

Used to periodically trigger events when used in combination with `msim/WHEN`.  The function _msim_sample(first,interval) returns true at time instants first + i*interval, where i=0,1,..,N.

_msim_terminate

Invoking _msim_terminate() causes the integration to terminate.  It can be used to terminate a simulation when it goes outside the domain where the model is valid.

• 

Any black-box function with multiple outputs that is present in the equations has been reformatted to make it easier to read. Instead of an internal format, such functions will have all the output variables on the left side of the definition equation followed by a function call with the input arguments on the right side.

Examples

Linking to a MapleSim model (located in .msim file):

A:=MapleSim:-LinkModel'filename'=catkernelopts'toolboxdir'=MapleSim,/data/examples/RLCcircuit.msim:

Getting the equations of the active subsystem's equations:

A:-GetEquations'output'='daes'

C1_p_it+I1_p_it+SC1_n_vtsin2πt=0,ⅆⅆtI1_p_it=SC1_n_vt,ⅆⅆtSC1_n_vt=C1_p_it

(1)

A:-GetEquations'output'='all'

C1_p_it+I1_p_it+SC1_n_vtsin2πt=0,ⅆⅆtI1_p_it=SC1_n_vt,ⅆⅆtSC1_n_vt=C1_p_it,C1_it=C1_p_it,C1_n_it=C1_p_it,C1_n_vt=0,C1_p_vt=SC1_n_vt,C1_vt=SC1_n_vt,G2_p_it=C1_p_it+I1_p_it+SC1_n_vtsin2πt,G2_p_vt=0,I1_it=I1_p_it,I1_n_it=I1_p_it,I1_n_vt=0,I1_p_vt=SC1_n_vt,I1_vt=SC1_n_vt,NP1_it=0,NP1_vt=0,NP2_it=0,NP2_vt=0,PP1_it=0,PP1_vt=SC1_n_vt,PP2_it=0,PP2_vt=SC1_n_vt,PP3_it=0,PP3_vt=SC1_n_vt,PS1_p_it=0,PS1_p_vt=SC1_n_vt,PS1_yt=SC1_n_vt,R1_it=SC1_n_vt,R1_n_it=SC1_n_vt,R1_n_vt=0,R1_p_it=SC1_n_vt,R1_p_vt=SC1_n_vt,R1_vt=SC1_n_vt,S1_yt=sin2πt,SC1_it=sin2πt,SC1_n_it=sin2πt,SC1_p_it=sin2πt,SC1_p_vt=0,SC1_vt=SC1_n_vt,Voutt=SC1_n_vt,InputSignalt=sin2πt,OutputSignalt=SC1_n_vt,R1_LossPowert=SC1_n_vt2,R1_R_actualt=1,R1_T_heatPortt=600320,,,

(2)

See Also

MapleSim, MapleSim[LinkModel]


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