OpenModelica


Forgot password? | Forgot username? | Register

Powersystem Library: frequent error

Powersystem Library: frequent error

frequent error in PowerSystem Library: "Could not evaluate structural parameter (or constant): n_r which gives dimensions of array: L_r[n_r]. Array dimensions must be known at compile time."
an example in this model:

model Inverter2 "Inverter, controlled rectifier"
  inner PowerSystems.System system(ref = "inertial") annotation(Placement(transformation(extent = {{-80, 60}, {-60, 80}})));
  PowerSystems.AC3ph.Impedances.Inductor ind(r = 0.05) annotation(Placement(transformation(extent = {{-50, -10}, {-30, 10}})));
  PowerSystems.AC3ph.Sensors.PVImeter meterAC(av = true, tcst = 0.1) annotation(Placement(transformation(extent = {{-20, -10}, {0, 10}})));
  replaceable PowerSystems.AC3ph.Inverters.Inverter ac_dc(redeclare PowerSystems.Control.Modulation.PWMasyn modulator "sine PWM asyn", redeclare PowerSystems.AC3ph.Inverters.Components.InverterSwitch inverter "switch, no diode, no losses") annotation(Placement(transformation(extent = {{30, -10}, {10, 10}})));
  PowerSystems.AC1ph_DC.Sensors.PVImeter meterDC(av = true, tcst = 0.1) annotation(Placement(transformation(extent = {{40, -10}, {60, 10}})));
  PowerSystems.AC1ph_DC.Sources.DCvoltage vDC(pol = 0, puUnits = true, V_nom = 400, v0 = 1.2) annotation(Placement(transformation(extent = {{90, -10}, {70, 10}})));
  PowerSystems.AC3ph.Nodes.GroundOne grd2 annotation(Placement(transformation(extent = {{90, -10}, {110, 10}})));
  replaceable PowerSystems.AC3ph.Machines.Asynchron asynchron(par(V_nom = 400, S_nom = 1e3)) annotation(Placement(transformation(extent = {{-56, -34}, {-76, -14}})));
  PowerSystems.Mechanics.Rotation.Rotor rotor annotation(Placement(transformation(extent = {{-72, -72}, {-52, -52}})));
  PowerSystems.Mechanics.Rotation.Torque torq(scType_par = false, tau0 = 10) annotation(Placement(transformation(extent = {{-12, -72}, {-32, -52}})));
  PowerSystems.Blocks.Signals.Transient trsSignal(t_change = 0.5, t_duration = 1, s_ini = 10, s_fin = 10) annotation(Placement(transformation(extent = {{24, -72}, {4, -52}})));
equation
  connect(ind.term_n, meterAC.term_p) annotation(Line(points = {{-30, 0}, {-20, 0}}, color = {0, 110, 110}));
  connect(meterAC.term_n, ac_dc.AC) annotation(Line(points = {{0, 0}, {10, 0}}, color = {0, 110, 110}));
  connect(ac_dc.DC, meterDC.term_p) annotation(Line(points = {{30, 0}, {40, 0}}, color = {0, 0, 255}));
  connect(meterDC.term_n, vDC.term) annotation(Line(points = {{60, 0}, {70, 0}}, color = {0, 0, 255}));
  connect(vDC.neutral, grd2.term) annotation(Line(points = {{90, 0}, {90, 0}}, color = {0, 0, 255}));
  connect(ind.term_p, asynchron.term) annotation(Line(points = {{-50, 0}, {-50, -24}, {-56, -24}}, color = {0, 120, 120}, smooth = Smooth.None));
  connect(asynchron.airgap, rotor.flange_p) annotation(Line(points = {{-66, -18}, {-88, -18}, {-88, -62}, {-72, -62}}, color = {0, 0, 0}, smooth = Smooth.None));
  connect(rotor.flange_n, torq.flange) annotation(Line(points = {{-52, -62}, {-32, -62}}, color = {0, 0, 0}, smooth = Smooth.None));
  connect(torq.tau, trsSignal.y) annotation(Line(points = {{-12, -62}, {4, -62}}, color = {0, 0, 127}, smooth = Smooth.None));
  annotation(Documentation(info = "<html>
<p><a href=\"modelica://PowerSystems.Examples.Spot.AC3ph\">up users guide</a></p>
</html>"), experiment(StopTime = 1, Interval = 0.2e-3), uses(PowerSystems(version = "0.4.0"), Modelica(version = "3.2.1")), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics));
end Inverter2;

What is the problem?

Edited by: claudio34 - Oct-03-15 08:50:19
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Powersystem Library: frequent error

OpenModelica has problems with determining the array size of certain modeling constructs. This is also reported in the OpenModelica regression tests, for example at https://test.openmodelica.org/libraries … anels.err.
I don't think there is anything we can do in the Buildings library to avoid this problem and I therefore close the ticket.

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic
You are here: