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

Multibody with closed loop kinematics

Multibody with closed loop kinematics

In order to built op my Modelica multibody modeling skills, I try to get the following simple multibody problem working (mass under dual parallel springs) -- it contains a planar, kinematic loop (can be straight loaded in OMEdit):

Code:


model MultibodyDAE
  inner Modelica.Mechanics.MultiBody.World world(label2 = "y", n = {0,-1,0}) annotation(Placement(visible = true, transformation(origin = {-66.7694,62.4183}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedtranslation1(r = {1,0,0}) annotation(Placement(visible = true, transformation(origin = {-14.1176,62.1849}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Forces.Spring spring1(c = 1, s_unstretched = 1) annotation(Placement(visible = true, transformation(origin = {-26.5546,36.9748}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  Modelica.Mechanics.MultiBody.Parts.Body body1(r_CM = {0,1,0}, r_0(start = {0,-1,0}, fixed = true), m = 1, I_11 = 1, I_22 = 1, I_33 = 11) annotation(Placement(visible = true, transformation(origin = {-15.7983,-1.0084}, extent = {{-12,12},{12,-12}}, rotation = -90)));
  annotation(experiment(StartTime = 0.0, StopTime = 10.0, Tolerance = 0.000001));
  Modelica.Mechanics.MultiBody.Sensors.AbsoluteAngles body1Angles annotation(Placement(visible = true, transformation(origin = {27.8992,10.4202}, extent = {{-12,-12},{12,12}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Forces.Spring spring2(c = 1, s_unstretched = 1) annotation(Placement(visible = true, transformation(origin = {-2.01681,36.6387}, extent = {{-12,12},{12,-12}}, rotation = -90)));
equation
  connect(fixedtranslation1.frame_b,spring2.frame_a) annotation(Line(points = {{-2.1176,62.1849},{-2.01681,62.1849},{-2.01681,48.6387},{-2.01681,48.6387}}));
  connect(spring2.frame_b,body1.frame_a) annotation(Line(points = {{-2.01681,24.6387},{-1.68067,24.6387},{-1.68067,10.9916},{-15.7983,10.9916}}));
  connect(body1.frame_a,body1Angles.frame_a) annotation(Line(points = {{-15.7983,10.9916},{16.4706,10.9916},{16.4706,10.4202},{15.8992,10.4202}}));
  connect(spring1.frame_b,body1.frame_a) annotation(Line(points = {{-26.5546,24.9748},{-26.8908,24.9748},{-26.8908,10.9916},{-15.7983,10.9916}}));
  connect(fixedtranslation1.frame_a,spring1.frame_a) annotation(Line(points = {{-26.1176,62.1849},{-26.2185,62.1849},{-26.2185,48.9748},{-26.5546,48.9748}}));
  connect(world.frame_b,fixedtranslation1.frame_a) annotation(Line(points = {{-54.7694,62.4183},{-25.8824,62.4183},{-25.8824,62.1849},{-26.1176,62.1849}}));
end MultibodyDAE;

The 3 degrees of freedom are the body's x,y-translations and it's z-rotation (r_CM under frame_a). As is, the problem won't simulate and stops after a fraction of a second.

I've read about index reduction, and how the "overdetermined DAE -> ODE" translation in (Open)Modelica can be helped (stateSelect) to get the desired result. My understanding however is still partial. Some guidance is much welcomed!

Re: Multibody with closed loop kinematics

Solved by carefully reading Otter, Elmqvist and Mattson's article "The New Modelica Multibody Library" (2003). Very impressed with the thorough work; thanks!

One problem remains though: simulation stability with closed-loop (stiff DAE) multibody problems. After a certain simulation time (within OMEdit or with the executable from the commandline), with all available solvers in OMEdit c.q. OpenModelica, numerical noise creeps in the acceleration components, causing the solution to blow up rather than to converge to a stationary (energy dissipated) solution. I'd hoped by exporting to FMI and using PyFMI to have access to Assimulo's Radau5ODE integrator, but apart from PyFMI's default CVode I can't use anything else...

Re: Multibody with closed loop kinematics

henk wrote:

Solved ...

One problem remains though: simulation stability with closed-loop (stiff DAE) multibody problems. After a certain simulation time (within OMEdit or with the executable from the commandline), with all available solvers in OMEdit c.q. OpenModelica, numerical noise creeps in the acceleration components, causing the solution to blow up rather than to converge to a stationary (energy dissipated) solution. I'd hoped by exporting to FMI and using PyFMI to have access to Assimulo's Radau5ODE integrator, but apart from PyFMI's default CVode I can't use anything else...

Also solved: Setting enforceStates=true in both body objects allowed the default dassl integrator to do a perfect stable simulation!

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