I'm pretty new to openmodelica and wondering why OME creates new equations for every loop it makes and how to solve this.
For this "doubletank system" it creates 6 equations and 4 variables while I loop twice through q as a function of u.
**model DoubleTankSystem
Real q[u];
constant Integer u=2;
Real h1(start=1);
Real h2(start=1);
parameter Real h0=3.2;
parameter Real Area=33;
parameter Real area=0.16;
parameter Real g=982;
equation
for u in 1:u loop // u går från 1 till 10
q[u]=21.96*u^(0.3853) + 0.3477;
0 = -der(h1)+ q[u]/Area - (area/Area)* sqrt(2*g*(h1+h0));
0 = -der(h2)+ (area/Area)* sqrt(2*g*(h1+h0)) - (area/Area)* sqrt(2*g*(h2+h0));
end for;
end DoubleTankSystem;**