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

While loop

While loop

Hello All,
I have the following system. It contains 26 DAEs.

Model AModel

(Definition of parameters, constants, variables and initialization of the 26 variables denoteted with yi, i=1,..., 26)

equation

26 DAEs with 26 equations and 26 variables

while K > 21 loop

    A= 3.3 + (c1*c2)/c3*(y5*(0^2/2 - 0*c3) +
      y6/2*(0^3/3 - 0*c4^2) + y7/3*(0^4/4 - 0*c5^3) +
      y8/4*(0^5/5 - 0*c5^4));

    B = y9 + (c1*c2)/sigmaeffn*(y1*(L^2/2 - L*c3) +
      y2/2*(L^3/3 - L*c5^2) +
      y3/3*(L^4/4 - L*c5^3));

    K=B-A;

end while;
end AModel;

       
In the Above equations (A and B) y1, y2, y3, y5, y6, y7, y8, y9 are 8 of the 26 variables obtained from the 26 DAEs.
Without while loop it works properly but using the loop I got errors. I think I am doing some sintax errors as I am new with Modelica.
I've also tried using algorithm but I still got errors.

Thank you so much!
Gabriele

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