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

Fixed step

Fixed step

Is there a way how to force fixed step in simulatiom? Becuse even when I use rungekutta method in some cases step is happening 2times as it should or 1 step is called 8 times (this happens when i use code
algorithm
  // here i call external function and add values to some variables
  if initial() then
    initTime(time);
  end if;
if noEvent(ErrorType > 100) then
    terminate("error or simulation stop");
  end if;
 
when it is just
  if initial() then
    initTime(time);
  end if;
if noEvent(ErrorType > 100) then
    terminate("error or simulation stop");
  end if;


no 8 times step calling but first  IF is not  done (with or without noEvent in second IF)
)

if i move if(initial) to other block without if in algorithm  it works

Edited by: bumino - May-12-16 15:53:56

Re: Fixed step

Could you try to provide a more complete example, I can't reproduce it.

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