create a Modelica model from Maple input - MapleSim Help

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, $x\left(t\right)$. 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, $x\left(0\right)=0$. The D operator expresses initial derivatives; for example, $\mathrm{D}\left(x\right)\left(0\right)=1$.
 – Conditional expressions may be represented as piecewise expressions; for example, $\mathrm{piecewise}\left(x\left(t\right). A symbolic expression, say $b\left(t\right)$, in a condition may be expressed as $b\left(t\right)=\mathrm{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, $\mathrm{noEvent}\left(\mathrm{piecewise}\left(t<1,t,{t}^{2}\right)\right)$.
 – 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.

 > $\mathrm{with}\left(\mathrm{MapleSim}:-\mathrm{Tools}\right):$