get the Modelica description 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/GetModelica

GetModelica - get the Modelica description of the active MapleSim subsystem

Calling Sequence

A := MapleSim:-LinkModel();

A:-GetModelica(options)

Parameters

options

-

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

Returns

• 

string : Modelica description of the model or active subsystem

Description

• 

A:-GetModelica returns the Modelica description of the entire model.

• 

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

Notes

• 

The returned Modelica has MapleSim specific annotations in it and may not display correctly in other tools.

Examples

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

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

Setting the active subsystem an RLC circuit subsystem:

A:-SetSubsystemNameRLC

Getting the Modelica description of the active subsystem:

A:-GetModelica

/* Generated by MapleSim (www.maplesoft.com) - 01:24:50 14-05-2015 */ model Main import Modelica.Constants.inf; import Pi=Modelica.Constants.pi; import Modelica.Constants.pi; import Maplesoft.Constants.I; public Maplesoft.SignalBlocks.Sources.Real.Sine S1(amplitude=1, freqHz=1, phase=0, offset=0, startTime=0) annotation(Placement(transformation(origin={73.0,249.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0))); public RLC_Parallel RLC(R=1, L=1, C=1) annotation(Placement(transformation(origin={181.5595703125,248.37116241455078},extent={{-20.0,-19.99999237060547},{20.0,19.99999237060547}},rotation=0))); equation connect(S1.y, RLC.InputSignal) annotation(Line(points={{95.0,249.0},{162.0,249.0}},color={0,0,127},smooth=Smooth.None)); annotation( Diagram(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{500.0,500.0}}),graphics), Icon(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,200.0}}),graphics={Rectangle(extent={{0,0},{200.0,200.0}}, lineColor={0,0,0})}), uses(Modelica(version="3.2.1")), experiment( StartTime = 0, StopTime = 10.0, __Maplesoft_solver = "rkf45", __Maplesoft_adaptive = true, __Maplesoft_engine = 2, Tolerance = 0.10e-6, __Maplesoft_tolerance_abs = 0.10e-6, __Maplesoft_step_size = 0.10e-2, __Maplesoft_plot_points = 200, __Maplesoft_numeric_jacobian = false, __Maplesoft_constraint_iterations = 50, __Maplesoft_event_iterations = 100, __Maplesoft_algebraic_error_control = false, __Maplesoft_algebraic_error_relaxation_factor = 1.0, __Maplesoft_rate_hysteresis = 0.10e-9, __Maplesoft_scale_method = "none", __Maplesoft_reduce_events = false, __Maplesoft_integration_diagnostics = false, __Maplesoft_plot_event_points = true, __Maplesoft_compiler = false ), __Maplesoft_probes={ Probe(name="Probe1", quantities={Quantity(variable=RLC.OutputSignal, displayName="Vout")}, gui="probe(bounds = [237.0, 244.0, 14.0, 14.0], color = [0, 0, 0], fill = [221, 221, 255], thickness = 1.0, probename = \"Probe1\", all = [[\"\", \"Real\", \"\", \"false\", \"Vout\"]], probed = [[\"\", \"Real\", \"\", \"false\", \"Vout\"]], pin1 = \"RLC.OutputSignal\", pin2 = \"\", reversed = \"false\", connectionName = \"RLC.OutputSignal\", context = \"\")") } ); end Main; model RLC_Parallel import Modelica.Constants.inf; import Pi=Modelica.Constants.pi; import Modelica.Constants.pi; import Maplesoft.Constants.I; inner parameter Real R = 1; inner parameter Real L = 1; inner parameter Real C = 1; protected Modelica.Electrical.Analog.Interfaces.NegativePin NP1 annotation(Placement(transformation(origin={128.0,43.0},extent={{-2.0,-2.0},{2.0,2.0}},rotation=0))); public Maplesoft.Electrical.Analog.Passive.Capacitors.Capacitor C1(C=C) annotation(Placement(transformation(origin={217.0,98.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=-90))); public Maplesoft.Electrical.Analog.Passive.Ground G2 annotation(Placement(transformation(origin={60.0,24.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0))); protected Modelica.Electrical.Analog.Interfaces.PositivePin PP1 annotation(Placement(transformation(origin={166.0,144.0},extent={{-2.0,-2.0},{2.0,2.0}},rotation=0))); protected Modelica.Electrical.Analog.Interfaces.NegativePin NP2 annotation(Placement(transformation(origin={167.0,43.0},extent={{-2.0,-2.0},{2.0,2.0}},rotation=0))); public Maplesoft.Electrical.Analog.Passive.Resistors.Resistor R1(R=R, T_ref=300.15, alpha=0, useHeatPort=false, T=R1.T_ref) annotation(Placement(transformation(origin={127.0,97.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=-90))); public Maplesoft.Electrical.Analog.Passive.Inductors.Inductor I1(L=L) annotation(Placement(transformation(origin={166.0,98.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=-90))); protected Modelica.Electrical.Analog.Interfaces.PositivePin PP2 annotation(Placement(transformation(origin={127.0,144.0},extent={{-2.0,-2.0},{2.0,2.0}},rotation=0))); public Maplesoft.Electrical.Analog.Sources.Current.SignalCurrent SC1 annotation(Placement(transformation(origin={60.0,97.0},extent={{20.0,20.0},{-20.0,-20.0}},rotation=-90))); public Modelica.Blocks.Interfaces.RealInput InputSignal annotation(Placement(transformation(origin={0.0,98.0},extent={{-10.0,-10.0},{10.0,10.0}},rotation=0))); public Maplesoft.Electrical.Analog.Sensors.PotentialSensor PS1(toUnit=Maplesoft.Conversions.VoltageDim.'V') annotation(Placement(transformation(origin={228.0,169.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0))); protected Modelica.Electrical.Analog.Interfaces.PositivePin PP3 annotation(Placement(transformation(origin={191.0,144.0},extent={{-2.0,-2.0},{2.0,2.0}},rotation=0))); public Modelica.Blocks.Interfaces.RealOutput OutputSignal annotation(Placement(transformation(origin={277.455078125,97.99609375},extent={{-10.0,-10.0},{10.0,10.0}},rotation=0))); equation connect(I1.p, PP1) annotation(Line(points={{166.0,118.0},{166.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(R1.p, PP2) annotation(Line(points={{127.0,117.0},{127.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(PP2, PP1) annotation(Line(points={{127.0,144.0},{166.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(R1.n, NP1) annotation(Line(points={{127.0,77.0},{127.0,43.0},{128.0,43.0}},color={0,0,255},smooth=Smooth.None)); connect(NP1, G2.p) annotation(Line(points={{128.0,43.0},{60.0,43.0},{60.0,44.0},{60.0,44.0}},color={0,0,255},smooth=Smooth.None)); connect(I1.n, NP2) annotation(Line(points={{166.0,78.0},{166.0,43.0},{167.0,43.0}},color={0,0,255},smooth=Smooth.None)); connect(C1.n, NP2) annotation(Line(points={{217.0,78.0},{217.0,43.0},{201.0,43.0},{167.0,43.0}},color={0,0,255},smooth=Smooth.None)); connect(NP2, NP1) annotation(Line(points={{167.0,43.0},{128.0,43.0}},color={0,0,255},smooth=Smooth.None)); connect(SC1.n, PP2) annotation(Line(points={{60.0,117.0},{60.0,144.0},{127.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(SC1.p, G2.p) annotation(Line(points={{60.0,77.0},{60.0,44.0}},color={0,0,255},smooth=Smooth.None)); connect(SC1.i, InputSignal) annotation(Line(points={{46.0,97.0},{0.0,97.0},{0.0,98.0}},color={0,0,127},smooth=Smooth.None)); connect(PS1.p, PP3) annotation(Line(points={{208.0,169.0},{191.0,169.0},{191.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(PP1, PP3) annotation(Line(points={{166.0,144.0},{191.0,144.0}},color={0,0,255},smooth=Smooth.None)); connect(PP3, C1.p) annotation(Line(points={{191.0,144.0},{217.0,144.0},{217.0,118.0}},color={0,0,255},smooth=Smooth.None)); connect(PS1.y, OutputSignal) annotation(Line(points={{250.0,169.0},{249.0,169.0},{249.0,96.0},{277.0,96.0},{277.0,98.0}},color={0,0,127},smooth=Smooth.None)); annotation( Diagram(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{277.0,194.0}}),graphics), Icon(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,199.99992}}),graphics={Rectangle(extent={{0,0},{200.0,199.99992}}, lineColor={0,0,0}),Rectangle(extent={{0.0,-1.52587890625E-5},{200.0,199.9999237060547}})}) ); end RLC_Parallel;

(1)

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