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

Simulation problem

Simulation problem

Hello all,

I have simple simulation: sinusoidal source, input rectifier, filtering cap, and resistive load. As soon as resistive load is bigger (low resistor, high current) simulation works, and if my resistive load is low (high resistor, low current) simulation does not work (stops during simulation process). I guess it is convergence problem. Unfortunately I was now able attached the modelica file.
Any change to simulation to start working?

Thank you!

Best regards,
peter

Edited by: peb - Dec-06-11 14:46:10

Re: Simulation problem

Morevover,
I've added resistor component and after simulation this component was not in "Plot Variables". Then I've deleted this component  but ""Modelica Text View" does not reflect this and old component is still there.
I am using OMEdit 1.8.

Peter

Re: Simulation problem

My simple rectifier model which does not run on my machine:

model ipfc
  Modelica.Electrical.Analog.Basic.Inductor inductor1(L = 1e-006)
  Modelica.Electrical.Analog.Basic.Ground ground1
  Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50)
  Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5)
  Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01)
  Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2)
equation
  connect(Cbus.n,ground1.p)
  connect(inductor1.n,D1.p)
  connect(Source.p,inductor1.p)
  connect(D1.p,D2.n)
  connect(D1.n,Cbus.p)
  connect(D1.n,D3.n)
  connect(Source.n,D4.n)
  connect(D3.p,D4.n)
  connect(Source.p,inductor1.p)
  connect(D2.p,D4.p)
  connect(D4.p,Cbus.n)
  connect(D3.n,Cbus.p)
  connect(D1.n,D3.n)
  connect(D1.n,Cbus.p)
  connect(Source.n,ground1.p)
  connect(Cbus.n,Rload.n)
  connect(Cbus.p,Rload.p)
end ipfc;

Re: Simulation problem

After some work (reconnecting diagram) I get this on text view:

model ipfc
  Modelica.Electrical.Analog.Basic.Inductor inductor1(L = 1e-006)
  Modelica.Electrical.Analog.Basic.Ground ground1
  Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50)
  Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5)
  Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01)
  Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2)
  Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2)
equation
  connect(D3.n[-1],Cbus.p[-1])
  connect(D3.p[-1],D4.n[-1])
  connect(D1.p[-1],D2.n[-1])
  connect(inductor1.n[-1],D1.p[-1])
  connect(Cbus.n,ground1.p)
  connect(inductor1.n,D1.p)
  connect(Source.p,inductor1.p)
  connect(D1.p,D2.n)
  connect(D1.n,Cbus.p)
  connect(Source.n,D4.n)
  connect(D3.p,D4.n)
  connect(Source.p,inductor1.p)
  connect(D2.p,D4.p)
  connect(D4.p,Cbus.n)
  connect(D3.n,Cbus.p)
  connect(D1.n,Cbus.p)
  connect(Source.n,ground1.p)
  connect(Cbus.n,Rload.n)
  connect(Cbus.p,Rload.p)
end ipfc;

Re: Simulation problem

Problems are still there, I re-installed the tool (openmodelica) and model it again (diagrammatically). Unfortunately with the same problems, simulation does not run, and by reconnecting, adding/deleting components Connection Editor makes mismatch on model text view. It's kind of weird behavior.

Peter

Re: Simulation problem

Hi Peter,

Your model is pretty strange because if you have created it in OMEdit why it is missing all the annotations that are heart of OMEdit. Also your connection equation shows wrong indexing as well e.g connect(D3.n[-1],Cbus.p[-1]) , since D3.n is not an array Cbus.p is also not an array so it should be connect(D3.n,Cbus.p).

Can you explain how you build your model? Which platform you are using. Wrong indexing problem is known bug on linux.

Adeel.

Re: Simulation problem

I deleted annotation  to be simpler: Wrong indexing comes from OMEdit. It creates this and I don't why?

model ipfc
  Modelica.Electrical.Analog.Basic.Ground ground2 annotation(Placement(visible = true, transformation(origin = {-77.6162,12.0216}, extent = {{-3.15998,-3.15998},{3.15998,3.15998}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5) annotation(Placement(visible = true, transformation(origin = {1.92278,25.8121}, extent = {{-6.1579,6.1579},{6.1579,-6.1579}}, rotation = -90)));
  Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01) annotation(Placement(visible = true, transformation(origin = {-19.3103,25.1065}, extent = {{-6.77369,6.77369},{6.77369,-6.77369}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-43.0547,14.4396}, extent = {{2.8727,-2.8727},{-2.8727,2.8727}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-43.3597,37.9485}, extent = {{3.15998,-3.15998},{-3.15998,3.15998}}, rotation = -270)));
  Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50) annotation(Placement(visible = true, transformation(origin = {-77.4522,23.9803}, extent = {{-2.15831,2.15831},{2.15831,-2.15831}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-34.5142,37.6862}, extent = {{3.47597,-3.47597},{-3.47597,3.47597}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-32.5772,15.4961}, extent = {{3.15998,-3.15998},{-3.15998,3.15998}}, rotation = -270)));
equation
  connect(Source.p,D1.p) annotation(Line(points = {{-77.4522,26.1386},{-43.2308,26.1386},{-43.2308,34.7885},{-43.3597,34.7885}}));
  connect(Source.n,ground2.p) annotation(Line(points = {{-77.4522,21.822},{-77.5689,21.822},{-77.5689,15.1815},{-77.6162,15.1815}}));
  connect(D4.p,Cbus.n) annotation(Line(points = {{-32.5772,12.3362},{-19.1941,12.3362},{-19.1941,18.3328},{-19.3103,18.3328}}));
  connect(D2.p,D4.p) annotation(Line(points = {{-43.0547,11.5669},{-32.5772,11.5669},{-32.5772,12.3362},{-32.5772,12.3362}}));
  connect(Source.n,D4.n) annotation(Line(points = {{-77.4522,21.822},{-32.5772,21.822},{-32.5772,18.6561},{-32.5772,18.6561}}));
  connect(D3.p,D4.n) annotation(Line(points = {{-34.5142,34.2102},{-32.5772,34.2102},{-32.5772,18.6561},{-32.5772,18.6561}}));
  connect(D1.p,D2.n) annotation(Line(points = {{-43.3597,34.7885},{-42.9666,34.7885},{-42.9666,17.3123},{-43.0547,17.3123}}));
  connect(Cbus.n,Rload.n) annotation(Line(points = {{-19.3103,18.3328},{1.84897,18.3328},{1.84897,19.6542},{1.92278,19.6542}}));
  connect(Cbus.p,Rload.p) annotation(Line(points = {{-19.3103,31.8802},{1.76093,31.8802},{1.76093,31.97},{1.92278,31.97}}));
  connect(D3.n,Cbus.p) annotation(Line(points = {{-34.5142,41.1622},{-19.2822,41.1622},{-19.2822,31.8802},{-19.3103,31.8802}}));
  connect(D1.n,D3.n) annotation(Line(points = {{-43.3597,41.1085},{-34.6022,41.1085},{-34.6022,41.1622},{-34.5142,41.1622}}));
end ipfc;

Re: Simulation problem

I am using Windows 7 - 32bit and OpenModelica 1.8.

The OMEdit does wrong indexing and moreover it leaves old connection if components are addded/deleted, and not displaying new variables in "Plotting" window.

If you suggest something I can try...

Peter

Re: Simulation problem

I just try it again - added input inductor and OMEdit generated wrong connection


model ipfc
  Modelica.Electrical.Analog.Basic.Ground ground2 annotation(Placement(visible = true, transformation(origin = {-77.6162,12.0216}, extent = {{-3.15998,-3.15998},{3.15998,3.15998}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5) annotation(Placement(visible = true, transformation(origin = {1.92278,25.8121}, extent = {{-6.1579,6.1579},{6.1579,-6.1579}}, rotation = -90)));
  Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01) annotation(Placement(visible = true, transformation(origin = {-19.3103,25.1065}, extent = {{-6.77369,6.77369},{6.77369,-6.77369}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-43.0547,14.4396}, extent = {{2.8727,-2.8727},{-2.8727,2.8727}}, rotation = -270)));
  Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50) annotation(Placement(visible = true, transformation(origin = {-77.4522,23.9803}, extent = {{-2.15831,2.15831},{2.15831,-2.15831}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-34.5142,37.6862}, extent = {{3.47597,-3.47597},{-3.47597,3.47597}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-32.5772,15.4961}, extent = {{3.15998,-3.15998},{-3.15998,3.15998}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-46.0811,42.7728}, extent = {{3.15998,-3.15998},{-3.15998,3.15998}}, rotation = -270)));
  Modelica.Electrical.Analog.Basic.Inductor inductor1 annotation(Placement(visible = true, transformation(origin = {-63.9523,35.749}, extent = {{-5.08917,-5.08917},{5.08917,5.08917}}, rotation = 0)));
equation
  connect(D1.p[-1],D2.n[-1]) annotation(Line(points = {{-46.0811,39.6128},{-46.3065,39.6128},{-46.3065,17.3123},{-43.0547,17.3123}}));
  connect(D1.n[-1],D3.n[-1]) annotation(Line(points = {{-46.0811,45.9327},{-34.6022,45.9327},{-34.6022,41.1622},{-34.5142,41.1622}}));
  connect(D3.p[-1],D4.n[-1]) annotation(Line(points = {{-34.5142,34.2102},{-28.9899,34.2102},{-32.5772,18.6561},{-32.5772,18.6561}}));
  connect(Source.p,D1.p) annotation(Line(points = {{-77.4522,26.1386},{-43.2308,26.1386},{-43.2308,34.7885},{-43.3597,34.7885}}));
  connect(Source.n,ground2.p) annotation(Line(points = {{-77.4522,21.822},{-77.5689,21.822},{-77.5689,15.1815},{-77.6162,15.1815}}));
  connect(D4.p,Cbus.n) annotation(Line(points = {{-32.5772,12.3362},{-19.1941,12.3362},{-19.1941,18.3328},{-19.3103,18.3328}}));
  connect(D2.p,D4.p) annotation(Line(points = {{-43.0547,11.5669},{-32.5772,11.5669},{-32.5772,12.3362},{-32.5772,12.3362}}));
  connect(Source.n,D4.n) annotation(Line(points = {{-77.4522,21.822},{-32.5772,21.822},{-32.5772,18.6561},{-32.5772,18.6561}}));
  connect(D3.p,D4.n) annotation(Line(points = {{-34.5142,34.2102},{-32.5772,34.2102},{-32.5772,18.6561},{-32.5772,18.6561}}));
  connect(D1.p,D2.n) annotation(Line(points = {{-43.3597,34.7885},{-42.9666,34.7885},{-42.9666,17.3123},{-43.0547,17.3123}}));
  connect(Cbus.n,Rload.n) annotation(Line(points = {{-19.3103,18.3328},{1.84897,18.3328},{1.84897,19.6542},{1.92278,19.6542}}));
  connect(Cbus.p,Rload.p) annotation(Line(points = {{-19.3103,31.8802},{1.76093,31.8802},{1.76093,31.97},{1.92278,31.97}}));
  connect(D3.n,Cbus.p) annotation(Line(points = {{-34.5142,41.1622},{-19.2822,41.1622},{-19.2822,31.8802},{-19.3103,31.8802}}));
  connect(D1.n,D3.n) annotation(Line(points = {{-43.3597,41.1085},{-34.6022,41.1085},{-34.6022,41.1622},{-34.5142,41.1622}}));
end ipfc;

Re: Simulation problem

I have tried to create your model again in OMEdit from scratch and everything works fine for me. I am also using Windows 7 with OpenModelica 1.8.0 (r10637).

I don't get any wrong indexing. I suppose it is a bug but i am unable to created it on my end.
Deleting a component deletes all the connections associated with it. But if your connection is wrong like the one with wrong indexing that will not be deleted.

I unable to simualte your model it throws compilation errors.

here is the code that is generated using OMEdit,

model ipfc
  Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50) annotation(Placement(visible = true, transformation(origin = {-84.8263,-2.55944}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-36.1975,-56.3071}, extent = {{12,-12},{-12,12}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-39.4882,20.8409}, extent = {{12,-12},{-12,12}}, rotation = -270)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {6.58132,-55.5759}, extent = {{12,-12},{-12,12}}, rotation = -270)));
  Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01) annotation(Placement(visible = true, transformation(origin = {36.5631,-13.894}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5) annotation(Placement(visible = true, transformation(origin = {81.17,-13.1627}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {3.65631,21.2066}, extent = {{12,-12},{-12,12}}, rotation = -270)));
  Modelica.Electrical.Analog.Basic.Inductor inductor1 annotation(Placement(visible = true, transformation(origin = {-71.298,58.5009}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Ground ground2 annotation(Placement(visible = true, transformation(origin = {-81.9013,-62.1572}, extent = {{-12,-12},{12,12}}, rotation = 0)));
equation
  connect(Source.n,ground2.p) annotation(Line(points = {{-84.8263,-14.5594},{-81.9013,-14.5594},{-81.9013,-50.1572},{-81.9013,-50.1572}}));
  connect(D3.n,Cbus.p) annotation(Line(points = {{3.65631,33.2066},{36.5631,33.2066},{36.5631,-1.894},{36.5631,-1.894}}));
  connect(Cbus.p,Rload.p) annotation(Line(points = {{36.5631,-1.894},{81.17,-1.894},{81.17,-1.16273},{81.17,-1.16273}}));
  connect(Cbus.n,Rload.n) annotation(Line(points = {{36.5631,-25.894},{81.5356,-25.894},{81.5356,-25.1627},{81.17,-25.1627}}));
  connect(Source.n,D4.n) annotation(Line(points = {{-84.8263,-14.5594},{-12.0658,-14.5594},{-12.0658,-43.5101},{6.58132,-43.5101},{6.58132,-43.5759}}));
  connect(D2.p,D4.p) annotation(Line(points = {{-36.1975,-68.3071},{6.58135,-68.3071},{6.58135,-67.5759},{6.58132,-67.5759}}));
  connect(D4.p,Cbus.n) annotation(Line(points = {{6.58132,-67.5759},{36.1974,-67.5759},{36.1974,-25.894},{36.5631,-25.894}}));
  connect(Source.p,D1.p) annotation(Line(points = {{-84.8263,9.44056},{-39.1225,9.44056},{-39.1225,8.84094},{-39.4882,8.84094}}));
  connect(D3.p,D4.n) annotation(Line(points = {{3.65631,9.20663},{6.94698,9.20663},{6.94698,-43.5759},{6.58132,-43.5759}}));
  connect(D1.n,D3.n) annotation(Line(points = {{-39.4882,32.8409},{4.02194,32.8409},{4.02194,33.2066},{3.65631,33.2066}}));
  connect(D1.p,D2.n) annotation(Line(points = {{-39.4882,8.84094},{-36.1974,8.84094},{-36.1974,-44.3071},{-36.1975,-44.3071}}));
end ipfc;

Adeel.

Re: Simulation problem

just delete some connections and try to connect them

Re: Simulation problem

And even if I delete all connections and my model is without connections at all. Then some connect lines are still left.

Re: Simulation problem

Ok. I have found the bug. I will try to fix it ASAP.

Adeel.

Re: Simulation problem

Wow. That's really fine you can replicate it.

And it's really cool you can fix it!

Best regards,
Peter

Re: Simulation problem

Have you chance to fix it?

Best regards,
Peter

There are 0 guests and 0 other users also viewing this topic