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

Posts

Posts

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


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