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

objects in loop in Dymola

objects in loop in Dymola

Hi everyone,

I'm using dymola and I would like to use an object (a bodybox) in a loop because I want to be able to change the coordinates of several bodyboxes (linked with a ball joint) automatically.

For the moment, I'm writting this:

for k in 1:n+1 loop

  parameter Modelica.SIunits.Length X[k] = R * cos(k * Theta)
  parameter Modelica.SIunits.Length Y[k] = R * sin(k * Theta) ;

  end for;


I suppose that I need to use at some point the names of my bodyboxes in the loop --> bodybox_k , but no matter how I try, I donnot manage to succeed.


Thanks for your help,

Cheers,

Charlie


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