create a Modelica model from Maple input - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : API Commands : Tools : MapleSim/Tools/MapleToModelica

MapleSim[Tools][MapleToModelica] - create a Modelica model from Maple input

Calling Sequence

MapleToModelica(sys, opts)

Parameters

sys

-

(optional) list or set of equations, a DynamicSystems object, or a string

opts

-

(optional) equation(s) of the form option = value; specify options for MapleToModelica

Description

• 

The MapleToModelica command creates a Modelica model from either Maple equations, a DynamicSystems object, or a Modelica class name. It also creates a Modelica connector from a connector specification.

• 

The optional sys parameter specifies the system equations. It may be a list or set of differential-algebraic equations, a DynamicSystems object, or a string corresponding to a Modelica class. The default value of sys is an empty set. This is useful when creating a custom connector.

• 

When sys is a list or set of equations, the following considerations apply:

– 

Variables in the equations should be represented as functions of time, for example, xt. The tvar option specifies the time variable, by default t.

– 

Time derivatives are expressed as diff(x(t),t).

– 

Time derivatives of order greater than one are converted to first-order derivatives using auxiliary variables.

– 

Initial conditions are expressed by substituting 0 for the time-variable; for example, x0=0. The D operator expresses initial derivatives; for example, Dx0=1.

– 

Conditional expressions may be represented as piecewise expressions; for example, piecewisext<yt&comma;xt&comma;yt. A symbolic expression, say bt, in a condition may be expressed as bt&equals;true; piecewise requires a Maple boolean expression.

– 

The and, or, and not boolean operators may be used in boolean expressions.

– 

The Modelica function noEvent may be applied to an expression to prevent events from being generated by the inequalities of the expression; for example, noEventpiecewiset<1&comma;t&comma;t2.

– 

The following standard Maple functions are handled: sin, cos, tan, arcsin, arccos, arctan, sinh, cosh, tanh, exp, ln, and log; arctan may be used in either the one or two argument form.  The log function is identical to the ln function.

• 

When sys is a DynamicSystems object, the inputs and output of the object become the inputs and outputs of the model, respectively. The inputs are placed on the left side of the icon, the outputs on the right. The systemname field of the DynamicSystems object is used as the class name of the model, unless it is the empty string or the class_name parameter is passed to MapleToModelica.

• 

When sys is a string corresponding to a fully-qualified Modelica class, the modelica corresponding to the class definition is returned.  This is primarily useful for inspecting the equations of a class to be extended. See the Modelon Hydraulics example.

• 

The generated Modelica model is returned as a string.

Examples

Access MapleToModelica directly.

withMapleSim:-Tools&colon;

See Also

DynamicSystems, 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