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

Manually fix bodies

Manually fix bodies

In order to build more complex models, I need to understand why a so simple project is failing because of equations>variables.

It's a simple free-falling object that is fixed in two different ways: the first using MultiBody "Fixed", the second one by manually fixing a frame, using the exact same equations.
The only difference is where the equations reside.

First script:

Code:


model freefalling

  inner Modelica.Mechanics.MultiBody.World world(enableAnimation = false, n = {0, 0, -1});
  Modelica.Mechanics.MultiBody.Parts.Body body1(m = 10, r_CM = {0, 0, 0}) ;
  Modelica.Mechanics.MultiBody.Parts.Fixed fixed1;

equation
  connect(fixed1.frame_b, body1.frame_a);
 
  annotation(
    uses(Modelica(version = "3.2.2")));

end freefalling;

The second

Code:


model freefalling2
 
  inner Modelica.Mechanics.MultiBody.World world(enableAnimation = false, n = {0, 0, -1});
  Modelica.Mechanics.MultiBody.Parts.Body body1;
  Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b;
 
equation
  connect(frame_b, body1.frame_a);
 
  Connections.root(frame_b.R);
  frame_b.r_0 = zeros(3);
  frame_b.R = Modelica.Mechanics.MultiBody.Frames.nullRotation();
 
  annotation(
    uses(Modelica(version = "3.2.2")));

end freefalling2;

In the second script I just replicated the same equations as script 1: however, at the end there are 6 more equations! Namely

Code:


frame_b.t[...] =0
frame_b.f[...] =0

that I didn't actually write and I don't know where they come from.

Why that happens? What am I doing wrong?

Edited by: DarioMangoni - Mar-22-18 11:21:01
There are 0 guests and 0 other users also viewing this topic