Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Same model different number of equations

Same model different number of equations

Below I enclose the model "QSAsma" in a file of its own (model.mo) and in a package (package.mo).
OM reports 221 variables.
OM reports for the model in model.mo 222 equations, for the model in package.mo 228 variables.
Dymola always reports 221 variables and equations.
When this model is simulated in OM (called by other models) OM complains about it having too many equations.

I see two issues:
1) is it possible that for THE SAME model a different number of equations is counted when inside or outside packages?
2) maybe something is wrong also in the model.mo equations counting (222 instead of 221)?

***  FILE MODEL.MO ***

Code:


within ;
model QSAsma
  import PI = Modelica.Constants.pi;
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L1_(L = L1) annotation(Placement(transformation(extent = {{-8,8},{12,28}})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Resistor R1_(R_ref = R1) annotation(Placement(transformation(extent = {{-32,8},{-12,28}})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L2_(L = L2) annotation(Placement(transformation(extent = {{26,8},{46,28}})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor Lm_(L = Lm) annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {18,-2})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.VariableResistor Rmecc annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {90,-2})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VariableVoltageSource
                                                                                uTerminals annotation(Placement(transformation(extent = {{-10,10},{10,-10}}, rotation = 270, origin = {-72,-2})));
  Modelica.ComplexBlocks.ComplexMath.PolarToComplex ToComplexUin annotation(Placement(transformation(origin = {-70,84}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealInput U annotation(Placement(transformation(extent = {{-160,40},{-120,80}}), iconTransformation(extent = {{-140,40},{-100,80}})));
  Modelica.Blocks.Sources.Constant const(k = 0) annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 180, origin = {-70,58})));
  Modelica.Blocks.Interfaces.RealInput f annotation(Placement(transformation(extent = {{-160,-80},{-120,-40}}), iconTransformation(extent = {{-140,-80},{-100,-40}})));
  Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation(Placement(transformation(extent = {{108,68},{128,88}}), iconTransformation(extent = {{88,-10},{108,10}})));
  Modelica.Mechanics.Rotational.Sources.Torque torque annotation(Placement(transformation(extent = {{14,68},{34,88}})));
  Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {72,60})));
  Modelica.Blocks.Nonlinear.Limiter limF(uMin = 0.000001, uMax = 1000000.0) annotation(Placement(transformation(extent = {{-112,-70},{-92,-50}})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor Pag annotation(Placement(transformation(extent = {{54,8},{74,28}})));
  Modelica.Blocks.Sources.RealExpression WmS1(y = (3 * toPag.re) / W0) annotation(Placement(transformation(extent = {{-36,68},{-4,88}})));
  parameter Integer pp = 2 "pole pairs";
  parameter Real R1 = 0.435 "stator's phase resistance";
  parameter Real L1 = 0.004 "stator's leakage indctance";
  parameter Real Lm = 0.0693 "stator's leakage indctance";
  parameter Real R2 = 0.4 "rotor's phase resistance";
  parameter Real L2 = 0.002 "rotor's leakage indctance";
  parameter Real J = 2.0 "rotor's moment of inertia";
  Real W0;
  //velocità meccanica di sincronismo
  Real s;
  //scorrimento
  Modelica.Mechanics.Rotational.Components.Inertia inertia(J = J) annotation(Placement(transformation(extent = {{82,68},{102,88}})));
  Modelica.ComplexBlocks.ComplexMath.ComplexToReal toPag annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {46,-8})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground ground annotation(Placement(transformation(extent = {{8,-38},{28,-18}})));
  Modelica.ComplexBlocks.ComplexMath.ComplexToReal toPin annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {-54,-10})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor Pin annotation(Placement(transformation(extent = {{-56,8},{-36,28}})));
  Modelica.Blocks.Interfaces.RealOutput Pdc annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {-60,-110}), iconTransformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {-70,-110})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.CurrentSensor currentSensor annotation(Placement(transformation(extent = {{-10,10},{10,-10}}, rotation = 180, origin = {-6,-22})));
  Modelica.ComplexBlocks.ComplexMath.ComplexToPolar ToIPolar annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {56,-76})));
  Modelica.Blocks.Interfaces.RealOutput Iac annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {60,-110})));
  Modelica.Mechanics.Rotational.Sensors.PowerSensor PmGen annotation(Placement(transformation(extent = {{46,68},{66,88}})));
  Modelica.Blocks.Math.Gain toW1(k = 3) annotation(Placement(transformation(extent = {{-8,-8},{8,8}}, rotation = -90, origin = {-50,-80})));
equation
  W0 = (limF.y * 2 * PI) / pp;
  s = (W0 - Wm.w) / W0;
  Rmecc.R_ref = R2 / s;
  connect(R1_.pin_n,L1_.pin_p) annotation(Line(points = {{-12,18},{-8,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(L1_.pin_n,L2_.pin_p) annotation(Line(points = {{12,18},{26,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Lm_.pin_p,L1_.pin_n) annotation(Line(points={{18,8},{18,18},{12,18}},   color = {85,170,255}, smooth = Smooth.None));
  connect(Rmecc.pin_n,Lm_.pin_n) annotation(Line(points={{90,-12},{90,-22},{18,
          -22},{18,-12}},                                                                        color = {85,170,255}, smooth = Smooth.None));
  connect(ToComplexUin.y,uTerminals.V) annotation(Line(points={{-59,84},{-40,84},
          {-40,40},{-100,40},{-100,2},{-82,2}},                                                                          color = {85,170,255}, smooth = Smooth.None));
  connect(ToComplexUin.len,U) annotation(Line(points = {{-82,90},{-100,90},{-100,60},{-140,60}}, color = {0,0,127}, smooth = Smooth.None));
  connect(const.y,ToComplexUin.phi) annotation(Line(points = {{-81,58},{-92,58},{-92,78},{-82,78}}, color = {0,0,127}, smooth = Smooth.None));
  connect(limF.u,f) annotation(Line(points = {{-114,-60},{-140,-60}}, color = {0,0,127}, smooth = Smooth.None));
  connect(uTerminals.f,limF.y) annotation(Line(points={{-82,-6},{-88,-6},{-88,
          -60},{-91,-60}},                                                                       color = {0,0,127}, smooth = Smooth.None));
  connect(Pag.currentP,L2_.pin_n) annotation(Line(points = {{54,18},{46,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Pag.voltageP,Pag.currentP) annotation(Line(points = {{64,28},{54,28},{54,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Pag.voltageN,Rmecc.pin_n) annotation(Line(points = {{64,8},{64,-22},{90,-22},{90,-12}}, color = {85,170,255}, smooth = Smooth.None));
  connect(WmS1.y,torque.tau) annotation(Line(points={{-2.4,78},{12,78}},   color = {0,0,127}, smooth = Smooth.None));
  connect(inertia.flange_b,flange_a) annotation(Line(points = {{102,78},{118,78}}, color = {0,0,0}, smooth = Smooth.None));
  connect(Pag.y,toPag.u) annotation(Line(points={{56,7},{46,7},{46,-0.8}},   color = {85,170,255}, smooth = Smooth.None));
  connect(Pag.currentN,Rmecc.pin_p) annotation(Line(points = {{74,18},{90,18},{90,8}}, color = {85,170,255}, smooth = Smooth.None));
  connect(ground.pin,Lm_.pin_n) annotation(Line(points={{18,-18},{18,-15},{18,
          -12},{18,-12}},                                                                       color = {85,170,255}, smooth = Smooth.None));
  connect(Pin.currentN,R1_.pin_p) annotation(Line(points = {{-36,18},{-32,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Pin.currentP,uTerminals.pin_p) annotation(Line(points = {{-56,18},{-72,18},{-72,8}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Pin.voltageP,Pin.currentP) annotation(Line(points = {{-46,28},{-56,28},{-56,18}}, color = {85,170,255}, smooth = Smooth.None));
  connect(Pin.y,toPin.u) annotation(Line(points={{-54,7},{-54,-2.8}},   color = {85,170,255}, smooth = Smooth.None));
  connect(Pin.voltageN,uTerminals.pin_n) annotation(Line(points = {{-46,8},{-46,0},{-26,0},{-26,-22},{-72,-22},{-72,-12}}, color = {85,170,255}, smooth = Smooth.None));
  connect(uTerminals.pin_n,currentSensor.pin_n) annotation(Line(points = {{-72,-12},{-72,-22},{-16,-22}}, color = {85,170,255}, smooth = Smooth.None));
  connect(currentSensor.pin_p,Rmecc.pin_n) annotation(Line(points = {{4,-22},{90,-22},{90,-12}}, color = {85,170,255}, smooth = Smooth.None));
  connect(ToIPolar.u,currentSensor.y) annotation(Line(points={{56,-68.8},{56,
          -50},{-6,-50},{-6,-33}},                                                                      color = {85,170,255}, smooth = Smooth.None));
  connect(ToIPolar.len,Iac) annotation(Line(points = {{59.6,-83.2},{60,-83.2},{60,-110}}, color = {0,0,127}, smooth = Smooth.None));
  connect(PmGen.flange_a,torque.flange) annotation(Line(points = {{46,78},{34,78}}, color = {0,0,0}, smooth = Smooth.None));
  connect(PmGen.flange_b,inertia.flange_a) annotation(Line(points = {{66,78},{82,78}}, color = {0,0,0}, smooth = Smooth.None));
  connect(Wm.flange,PmGen.flange_b) annotation(Line(points = {{72,70},{72,78},{66,78}}, color = {0,0,0}, smooth = Smooth.None));
  connect(toW1.u,toPin.re) annotation(Line(points = {{-50,-70.4},{-50,-17.2},{-50.4,-17.2}}, color = {0,0,127}, smooth = Smooth.None));
  connect(Pdc,toW1.y) annotation(Line(points = {{-60,-110},{-60,-88.8},{-50,-88.8}}, color = {0,0,127}, smooth = Smooth.None));
  annotation(Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-120,-100},{120,100}}), graphics={  Rectangle(extent = {{-80,34},{100,-36}}, lineColor = {255,0,0}, pattern = LinePattern.Dash)}), Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-120,-100},{120,100}}), graphics={  Line(points = {{-100,60},{-48,32}}, color = {0,0,127}, smooth = Smooth.None),Line(points = {{-100,-60},{-48,-30}}, color = {0,0,127}, smooth = Smooth.None),Text(extent = {{-106,138},{106,112}}, lineColor = {0,0,127}, fillColor = {95,95,95},
            fillPattern =                                                                                                    FillPattern.Solid, textString = "%name"),Rectangle(extent = {{-42,66},{78,-54}}, lineColor = {0,0,0},
            fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {175,175,175}),Rectangle(extent = {{78,10},{98,-10}}, lineColor = {0,0,0},
            fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {95,95,95}),Rectangle(extent = {{-42,66},{-62,-54}}, lineColor = {0,0,0},
            fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {128,128,128}),Polygon(points = {{-54,-84},{-44,-84},{-14,-14},{36,-14},{66,-84},{76,-84},{76,-94},{-54,-94},{-54,-84}}, lineColor = {0,0,0}, fillColor = {0,0,0},
            fillPattern =                                                                                                    FillPattern.Solid)}), Documentation(info = "<html>
<p>This model models ans asynchronous machine based on a quasi-stationary approximation: the equivalent single-phase circuit.</p>
<p>This model is very fast and compact, and gives result with sufficient precision in most vehicular propulsion needs.</p>
</html>"),
    uses(Modelica(version="3.2")));
end QSAsma;

*** FILE PACKAGE.MO ***

Code:


within ;
encapsulated package EVQSPkg10 "Package per EV con modello QuasiStationary"
  import Modelica;
  import EVQSPkg = EVQSPkg10;
  model QSAsma
    import PI = Modelica.Constants.pi;
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L1_(L = L1) annotation(Placement(transformation(extent = {{-8,8},{12,28}})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Resistor R1_(R_ref = R1) annotation(Placement(transformation(extent = {{-32,8},{-12,28}})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor L2_(L = L2) annotation(Placement(transformation(extent = {{26,8},{46,28}})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Inductor Lm_(L = Lm) annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {18,-2})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.VariableResistor Rmecc annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {90,-2})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VariableVoltageSource
                                                                                  uTerminals annotation(Placement(transformation(extent = {{-10,10},{10,-10}}, rotation = 270, origin = {-72,-2})));
    Modelica.ComplexBlocks.ComplexMath.PolarToComplex ToComplexUin annotation(Placement(transformation(origin = {-70,84}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Blocks.Interfaces.RealInput U annotation(Placement(transformation(extent = {{-160,40},{-120,80}}), iconTransformation(extent = {{-140,40},{-100,80}})));
    Modelica.Blocks.Sources.Constant const(k = 0) annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 180, origin = {-70,58})));
    Modelica.Blocks.Interfaces.RealInput f annotation(Placement(transformation(extent = {{-160,-80},{-120,-40}}), iconTransformation(extent = {{-140,-80},{-100,-40}})));
    Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a annotation(Placement(transformation(extent = {{108,68},{128,88}}), iconTransformation(extent = {{88,-10},{108,10}})));
    Modelica.Mechanics.Rotational.Sources.Torque torque annotation(Placement(transformation(extent = {{14,68},{34,88}})));
    Modelica.Mechanics.Rotational.Sensors.SpeedSensor Wm annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {72,60})));
    Modelica.Blocks.Nonlinear.Limiter limF(uMin = 0.000001, uMax = 1000000.0) annotation(Placement(transformation(extent = {{-112,-70},{-92,-50}})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor Pag annotation(Placement(transformation(extent = {{54,8},{74,28}})));
    Modelica.Blocks.Sources.RealExpression WmS1(y = (3 * toPag.re) / W0) annotation(Placement(transformation(extent = {{-36,68},{-4,88}})));
    parameter Integer pp = 2 "pole pairs";
    parameter Real R1 = 0.435 "stator's phase resistance";
    parameter Real L1 = 0.004 "stator's leakage indctance";
    parameter Real Lm = 0.0693 "stator's leakage indctance";
    parameter Real R2 = 0.4 "rotor's phase resistance";
    parameter Real L2 = 0.002 "rotor's leakage indctance";
    parameter Real J = 2.0 "rotor's moment of inertia";
    Real W0;
    //velocità meccanica di sincronismo
    Real s;
    //scorrimento
    Modelica.Mechanics.Rotational.Components.Inertia inertia(J = J) annotation(Placement(transformation(extent = {{82,68},{102,88}})));
    Modelica.ComplexBlocks.ComplexMath.ComplexToReal toPag annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {46,-8})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground ground annotation(Placement(transformation(extent = {{8,-38},{28,-18}})));
    Modelica.ComplexBlocks.ComplexMath.ComplexToReal toPin annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {-54,-10})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor Pin annotation(Placement(transformation(extent = {{-56,8},{-36,28}})));
    Modelica.Blocks.Interfaces.RealOutput Pdc annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {-60,-110}), iconTransformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {-70,-110})));
    Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.CurrentSensor currentSensor annotation(Placement(transformation(extent = {{-10,10},{10,-10}}, rotation = 180, origin = {-6,-22})));
    Modelica.ComplexBlocks.ComplexMath.ComplexToPolar ToIPolar annotation(Placement(transformation(extent = {{-6,-6},{6,6}}, rotation = 270, origin = {56,-76})));
    Modelica.Blocks.Interfaces.RealOutput Iac annotation(Placement(transformation(extent = {{-10,-10},{10,10}}, rotation = 270, origin = {60,-110})));
    Modelica.Mechanics.Rotational.Sensors.PowerSensor PmGen annotation(Placement(transformation(extent = {{46,68},{66,88}})));
    Modelica.Blocks.Math.Gain toW1(k = 3) annotation(Placement(transformation(extent = {{-8,-8},{8,8}}, rotation = -90, origin = {-50,-80})));
  equation
    W0 = (limF.y * 2 * PI) / pp;
    s = (W0 - Wm.w) / W0;
    Rmecc.R_ref = R2 / s;
    connect(R1_.pin_n,L1_.pin_p) annotation(Line(points = {{-12,18},{-8,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(L1_.pin_n,L2_.pin_p) annotation(Line(points = {{12,18},{26,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Lm_.pin_p,L1_.pin_n) annotation(Line(points = {{18,8},{18,18},{12,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Rmecc.pin_n,Lm_.pin_n) annotation(Line(points = {{90,-12},{90,-22},{18,-22},{18,-12}}, color = {85,170,255}, smooth = Smooth.None));
    connect(ToComplexUin.y,uTerminals.V) annotation(Line(points = {{-59,84},{-40,84},{-40,40},{-100,40},{-100,2},{-82,2}}, color = {85,170,255}, smooth = Smooth.None));
    connect(ToComplexUin.len,U) annotation(Line(points = {{-82,90},{-100,90},{-100,60},{-140,60}}, color = {0,0,127}, smooth = Smooth.None));
    connect(const.y,ToComplexUin.phi) annotation(Line(points = {{-81,58},{-92,58},{-92,78},{-82,78}}, color = {0,0,127}, smooth = Smooth.None));
    connect(limF.u,f) annotation(Line(points = {{-114,-60},{-140,-60}}, color = {0,0,127}, smooth = Smooth.None));
    connect(uTerminals.f,limF.y) annotation(Line(points = {{-82,-6},{-88,-6},{-88,-60},{-91,-60}}, color = {0,0,127}, smooth = Smooth.None));
    connect(Pag.currentP,L2_.pin_n) annotation(Line(points = {{54,18},{46,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pag.voltageP,Pag.currentP) annotation(Line(points = {{64,28},{54,28},{54,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pag.voltageN,Rmecc.pin_n) annotation(Line(points = {{64,8},{64,-22},{90,-22},{90,-12}}, color = {85,170,255}, smooth = Smooth.None));
    connect(WmS1.y,torque.tau) annotation(Line(points = {{-2.4,78},{12,78}}, color = {0,0,127}, smooth = Smooth.None));
    connect(inertia.flange_b,flange_a) annotation(Line(points = {{102,78},{118,78}}, color = {0,0,0}, smooth = Smooth.None));
    connect(Pag.y,toPag.u) annotation(Line(points = {{56,7},{46,7},{46,-0.8}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pag.currentN,Rmecc.pin_p) annotation(Line(points = {{74,18},{90,18},{90,8}}, color = {85,170,255}, smooth = Smooth.None));
    connect(ground.pin,Lm_.pin_n) annotation(Line(points = {{18,-18},{18,-15},{18,-12},{18,-12}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pin.currentN,R1_.pin_p) annotation(Line(points = {{-36,18},{-32,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pin.currentP,uTerminals.pin_p) annotation(Line(points = {{-56,18},{-72,18},{-72,8}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pin.voltageP,Pin.currentP) annotation(Line(points = {{-46,28},{-56,28},{-56,18}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pin.y,toPin.u) annotation(Line(points = {{-54,7},{-54,-2.8}}, color = {85,170,255}, smooth = Smooth.None));
    connect(Pin.voltageN,uTerminals.pin_n) annotation(Line(points = {{-46,8},{-46,0},{-26,0},{-26,-22},{-72,-22},{-72,-12}}, color = {85,170,255}, smooth = Smooth.None));
    connect(uTerminals.pin_n,currentSensor.pin_n) annotation(Line(points = {{-72,-12},{-72,-22},{-16,-22}}, color = {85,170,255}, smooth = Smooth.None));
    connect(currentSensor.pin_p,Rmecc.pin_n) annotation(Line(points = {{4,-22},{90,-22},{90,-12}}, color = {85,170,255}, smooth = Smooth.None));
    connect(ToIPolar.u,currentSensor.y) annotation(Line(points = {{56,-68.8},{56,-50},{-6,-50},{-6,-33}}, color = {85,170,255}, smooth = Smooth.None));
    connect(ToIPolar.len,Iac) annotation(Line(points = {{59.6,-83.2},{60,-83.2},{60,-110}}, color = {0,0,127}, smooth = Smooth.None));
    connect(PmGen.flange_a,torque.flange) annotation(Line(points = {{46,78},{34,78}}, color = {0,0,0}, smooth = Smooth.None));
    connect(PmGen.flange_b,inertia.flange_a) annotation(Line(points = {{66,78},{82,78}}, color = {0,0,0}, smooth = Smooth.None));
    connect(Wm.flange,PmGen.flange_b) annotation(Line(points = {{72,70},{72,78},{66,78}}, color = {0,0,0}, smooth = Smooth.None));
    connect(toW1.u,toPin.re) annotation(Line(points = {{-50,-70.4},{-50,-17.2},{-50.4,-17.2}}, color = {0,0,127}, smooth = Smooth.None));
    connect(Pdc,toW1.y) annotation(Line(points = {{-60,-110},{-60,-88.8},{-50,-88.8}}, color = {0,0,127}, smooth = Smooth.None));
    annotation(Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-120,-100},{120,100}}), graphics = {Rectangle(extent=  {{-80,34},{100,-36}}, lineColor=  {255,0,0}, pattern=  LinePattern.Dash)}), Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-120,-100},{120,100}}), graphics={  Line(points = {{-100,60},{-48,32}}, color = {0,0,127}, smooth = Smooth.None),Line(points = {{-100,-60},{-48,-30}}, color = {0,0,127}, smooth = Smooth.None),Text(extent = {{-106,138},{106,112}}, lineColor = {0,0,127}, fillColor = {95,95,95},
              fillPattern =                                                                                                    FillPattern.Solid, textString = "%name"),Rectangle(extent = {{-42,66},{78,-54}}, lineColor = {0,0,0},
              fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {175,175,175}),Rectangle(extent = {{78,10},{98,-10}}, lineColor = {0,0,0},
              fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {95,95,95}),Rectangle(extent = {{-42,66},{-62,-54}}, lineColor = {0,0,0},
              fillPattern =                                                                                                    FillPattern.HorizontalCylinder, fillColor = {128,128,128}),Polygon(points = {{-54,-84},{-44,-84},{-14,-14},{36,-14},{66,-84},{76,-84},{76,-94},{-54,-94},{-54,-84}}, lineColor = {0,0,0}, fillColor = {0,0,0},
              fillPattern =                                                                                                    FillPattern.Solid)}), Documentation(info = "<html>
<p>This model models ans asynchronous machine based on a quasi-stationary approximation: the equivalent single-phase circuit.</p>
<p>This model is very fast and compact, and gives result with sufficient precision in most vehicular propulsion needs.</p>
</html>"));
  end QSAsma;
  annotation(uses(Modelica(version = "3.2")));
end EVQSPkg10;


Re: Same model different number of equations

What command did you use to count the number of equations in OpenModelica? If you used checkModel(), note that the count is way off since it does not handle array-equations correctly.

Re: Same model different number of equations

I used "check model" in OMEdit.
This "equation number" issue is blocking, since when I use the proposed model as a submodel of something "runnable", I receive the following message

Symbolic    19:02:42        0:0-0:0    Too many equations, overdetermined system. The model has 546 equation(s) and 539 variable(s)

and simulation does not start.

There are 0 guests and 0 other users also viewing this topic
You are here: