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

Posts

Posts

Hey, im just starting with OM and i think my problem is really basic, but anyway i don't find a solution, here it is:

I have a diameter that should be increased continous and after reaching a specific diameter it should be set to the beginning value, but the increasing should continue after this. So it should be like:

0:  0.1
1:  0.2
2:  0.3
3:  0.1 <- reset point
4:  0.2

My Code looks like this

Code:


if s>s_max then
     s= s_0;
  else
     der(s)= + v_grow;
  end if;

where v_grow is the growing speed in m/s, s the diameter and s_0 the diameter for reset and start.

The Problem is, that if when s>s_max is reached, modelica tries to calculate the der(s) term anyway and runs into an error. But i don't know why....

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