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
  • Index
  • » Users
  • » Houssem
  • » Profile

Posts

Posts

Hi,

I'm trying to simulate the planar 4 bar mechanism in OpenModelica using Modelica Multibody librairie.
I know that Openmodelica now support the Modelica  Multibody librairie.
But when i try to simulate the model, i have no messages and no results.
Is the problem come from Openmodelica , Modelica language or the model itself?
I tried the model in simulationX using a student version but it doesn’t work!!!

Thanks for the answer

here is the model:

model fbar
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(n = {1,0,0}) annotation(Placement(visible = true, transformation(origin = {-12.0482,26.0241}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  inner Modelica.Mechanics.MultiBody.World world annotation(Placement(visible = true, transformation(origin = {-54.9398,26.506}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.BodyShape bodyshape1(r = {0,0,1}, r_CM = {0,0,0.5}, m = 1) annotation(Placement(visible = true, transformation(origin = {30.8434,26.0241}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(n = {1,0,0}) annotation(Placement(visible = true, transformation(origin = {64.5783,25.5422}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute3(n = {1,0,0}) annotation(Placement(visible = true, transformation(origin = {55.9036,-41.9277}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.BodyShape bodyshape2(r = {0,0,1}, r_CM = {0,0,0.5}, m = 1) annotation(Placement(visible = true, transformation(origin = {20.7229,-41.9277}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.BodyShape bodyshape3(r = {0,0,1}, r_CM = {0,0,0.5}, m = 1) annotation(Placement(visible = true, transformation(origin = {84.3373,-12.5301}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedtranslation1(r = {0,0,1}) annotation(Placement(visible = true, transformation(origin = {-42.4096,-15.9036}, extent = {{-12,12},{12,-12}}, rotation = -90)));
equation
  connect(fixedtranslation1.frame_b,bodyshape2.frame_a) annotation(Line(points = {{-42.4096,-27.9036},{-41.9277,-27.9036},{-41.9277,-41.9277},{8.7229,-41.9277}}));
  connect(fixedtranslation1.frame_a,world.frame_b) annotation(Line(points = {{-42.4096,-3.90361},{-42.8916,-3.90361},{-42.8916,26.506},{-42.9398,26.506}}));
  connect(revolute3.frame_a,bodyshape2.frame_b) annotation(Line(points = {{43.9036,-41.9277},{32.7711,-41.9277},{32.7711,-41.9277},{32.7229,-41.9277}}));
  connect(revolute3.frame_b,bodyshape3.frame_b) annotation(Line(points = {{67.9036,-41.9277},{83.3735,-41.9277},{83.3735,-23.1325},{84.3373,-23.1325},{84.3373,-24.5301}}));
  connect(bodyshape3.frame_a,revolute2.frame_b) annotation(Line(points = {{84.3373,-0.53012},{84.8193,-0.53012},{84.8193,25.5422},{76.5783,25.5422}}));
  connect(revolute2.frame_a,bodyshape1.frame_b) annotation(Line(points = {{52.5783,25.5422},{42.8916,25.5422},{42.8916,26.0241},{42.8434,26.0241}}));
  connect(bodyshape1.frame_a,revolute1.frame_b) annotation(Line(points = {{18.8434,26.0241},{0,26.0241},{0,26.0241},{-0.0481928,26.0241}}));
  connect(world.frame_b,revolute1.frame_a) annotation(Line(points = {{-42.9398,26.506},{-23.1325,26.506},{-23.1325,26.0241},{-24.0482,26.0241}}));
  annotation(uses(Modelica(version = "3.2")), Diagram(graphics));
end fbar;

Hi,
I am simulating a complex model and the plot file is very big (500M). Is there a way to reduce the number of variables in the plt file and then reduce its size to plot my variables. Note that I can't reduce the integration step (1e-4) du to convergeance problem.
As I know, protected variables in Dymola are not plotted. This is not the case for OpenModelica.

Another question: The runge-Kutta solver used by OpenModelica is  fixed step or  variable step?

Thank you in advance.
Best regards,
Houssem

Hello,

How can I get more information's in the simulation result?
-CPU Time
-number of Zero crossing
-Maximum integration order

thinks

model test
Integer i;
Real R[3,8]=fill(0,3,8);
equation
if time>0.5 then
    i=2;
else
    i=4;
end if;

when time>0.5 then

reinit(R,{{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0}});

end when;
end test;

this also dasn't work.

Hello,

why OpenModelica dasn't accepte the use of matrix in when statement?
this is a exemple?

model test
Integer i;
Real R[3,8]=fill(0,3,8);
equation
if time>0.5 then
    i=2;
else
    i=4;
end if;

when change(i) then

reinit(R,{{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0}});

end when;
end test;

any one have a solution for that?

thinks

hello,

why I have this message when I'm trying to check this model?

function ret_2_matrix
output Real M1[2,3];
output Real M2[2,3];
algorithm
M1:={{1,2,3},{2,3,6}};
M2:={{1,4,3},{2,7,6}};
end ret_2_matrix;

model test
Real Matrix1[2,3];
Real Matrix2[2,3];
equation
when initial() then
(Matrix1,Matrix2)=ret_2_matrix();
end when;
end test;

is it OpenModelica have a probleme in initialization? because this model was checked in another Modelica compiler successfully.


thinks

thank you very much

Hello,

is OpenModelica have more then  one solver? and how we can change the deffault solver?

thinks

  • Index
  • » Users
  • » Houssem
  • » Profile
You are here: