- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OM Source code
OM Source code
OM Source code
Hello,
I have a little question about the function start and stop time or rather > and <. I want to declare several variables of Z (Z1,Z2,Z3) as local losses in different time phases. How can I write this in a source code? My equation is though correct, but only for one Z Variable. How can I declare, for instance three Z Variables with an impact in different times?
class losses
Real H(start = 200, unit = "m");
parameter Real J(unit = "m/s") = -0.02 "losses due to fric-tion";
parameter Real Z(unit = "m/s") = -0.05 "losses due to fric-tion";
equation
/* Equations of motion */
if time <=5 then der(H) = J;
elseif time >= 10 then der(H) = J;
else der(H) = Z+J;
end if;
end losses;
Is there anyone who could help me? Thanks ahead
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OM Source code