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

implementing a

implementing a

I would like to do something like this: In this model X should be increased by "1"  with each timestep of the simulation. But I always get this error:

Code:

assert            | assert  | ERROR: Too many event iterations. System is inconsistent. Simulation terminate.

Code:

class stepfunction

  parameter Real seed = 1234;
  parameter Real range = 10;
  Integer X(start = 0);
algorithm
  X := X+1;
end stepfunction;

Any Idea, or hint what I could change to make it work?

Edited by: yeus - Feb-04-13 18:09:03

Re: implementing a

You want to use x := pre(x) + 1;

But that wll only increase the value by one at each discrete time step. I believe there is no way to increase x by one at each continuous step.

Re: implementing a

hmm. that would be pretty bad news, because that is exactly what I  want to do (increase x by one at each continuous step).

There are 0 guests and 0 other users also viewing this topic
You are here: