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
  • » PietervD
  • » Profile

Posts

Posts

Jan-10-12 16:55:33
What causes this error?

Hello,


I want to model a (Coulomb) friction force on the translation of BodyBox components (from the MultiBody library). I want to do this by attaching the frames of the BodyBox components to Fixed components, via two Prismatic joints (the movement is two dimensional). Consequently I want to attach a SupportFriction component to the flanges of the Prismatic joints.
However, I get the error message that the model is singular. Can anyone explain why?

As an example, please consider the following code for a simple pendulum that incorporates the above mentioned construction and results in the error when simulated in OMEdit 1.7.0 (without the Prismatic joints, Fixed and SupportFriction it runs without problems):

Code:


model pendulum
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(useAxisFlange = false, n = {0,0,1});
  Modelica.Mechanics.MultiBody.Parts.BodyBox element1(r_0(start = {0,0,0}, fixed = true), r = {1,0,0}, width = 0.1);
  Modelica.Mechanics.MultiBody.Parts.Fixed fixed(r = {1,0,0});
  Modelica.Mechanics.MultiBody.Joints.Prismatic prismaticX(useAxisFlange = false, n = {1,0,0}, stateSelect = StateSelect.always, v(fixed = true), s(fixed = true, start = 0));
  Modelica.Mechanics.MultiBody.Joints.Prismatic prismaticY(useAxisFlange = true, n = {0,1,0}, stateSelect = StateSelect.always, v(fixed = true), s(fixed = true, start = 0));
  Modelica.Mechanics.Translational.Components.SupportFriction frictionForce(useSupport = false);
equation
  connect(world.frame_b,  revolute1.frame_a);
  connect(revolute1.frame_b,  element1.frame_a);
  connect(fixed.frame_b,  prismaticX.frame_a);
  connect(prismaticX.frame_b,  prismaticY.frame_a);
  connect(prismaticY.frame_b,  element1.frame_b);
  connect(prismaticY.axis,  frictionForce.flange_a);
  connect(prismaticY.support,  frictionForce.flange_b);
end pendulum;

Kind regards,

Pieter

Jan-10-12 15:46:23
Is it possible to use Modelica.Mechanics.MultiBody in OMNotebook?

That almost did the trick, I got an error that the class ModelicaServices.Animation.Shape was not found, so I also had to load ModelicaServices.
Now it works fine. Thank you both a lot!

Jan-10-12 14:14:36
Is it possible to use Modelica.Mechanics.MultiBody in OMNotebook?

Thanks for your reply. I've tried simulating a very simple model, to see if I understand you correctly.

I've created an a.onb file with the following contents:

Code:


cd("c:/OpenModelica1.7.0/work/");
runScript("a.mos");

a.mos contains:

Code:


loadModel(pendulum.mo);getErrorString();
simulate(pendulum, stopTime = 3);getErrorString();

and pendulum.mo contains a model for a simple pendulum, which runs fine in OMEdit:

Code:


model pendulum
  inner Modelica.Mechanics.MultiBody.World world;
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(useAxisFlange = false, n = {0,0,1});
  Modelica.Mechanics.MultiBody.Parts.BodyBox element1(r_0(start = {0,0,0}, fixed = true), r = {1,0,0}, width = 0.1);
equation
  connect(world.frame_b,  revolute1.frame_a);
  connect(revolute1.frame_b,  element1.frame_a);
end pendulum;

All files are in the c:/OpenModelica1.7.0/work/ folder.

Unfortunately, the output in OMNotebook simply says [done], but nothing seems to happen.
I'm probably making some simple mistake, since I really have no experience with this kind of programming.

Regards,

Pieter

Jan-10-12 13:23:34
Is it possible to use Modelica.Mechanics.MultiBody in OMNotebook?

Hello,

Is it possible to use Modelica.Mechanics.MultiBody in OMNotebook?
I'm running my model using OMEdit now, but I want to run it with a range of parameter values overnight, without having to click on simulate for every simulation.

Kind regards,

Pieter

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