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

FirstExample in Modelica.StateGraph doesn't works

FirstExample in Modelica.StateGraph doesn't works

I'm working in ubuntu with the lastest version of OpenModelica (8109-1). I try to simulate the example Modelica.StateGrapg.Examples.FirstExample. This example compiles but the results are not logical. In http://lup.lub.lu.se/luur/download?func … OId=625575  show that:

"In the above example, the simulation starts at ini-
tialStep. After 1 second, transition1 fires and step1
becomes active. After another second transition2
fires and initialStep becomes again active. After a
further second step1 becomes active, and so on.
"

But when I run the simulation step1 is always deactivated.

I don't know if is a problem from the library, openmodelica or mine.

Re: FirstExample in Modelica.StateGraph doesn't works

Hi,

Maybe this helps

Steps represent the possible states a StateGraph can have. If a step is active the Boolean variable active of the step is true. If it is deactivated, active = false. At the initial time, all "usual" steps are deactivated. The InitialStep objects are steps that are activated at the initial time. They are characterized by a double box (see figure above).
Transitions are used to change the state of a StateGraph. When the step connected to the input of a transition is active, the step connected to the output of this transition is deactivated and the transition condition becomes true, then the transition fires. This means that the step connected to the input to the transition is deactivated and the step connected to the output of the transition is activated.
The transition condition is defined via the parameter menu of the transition object.

In the input field "condition", any type of time varying Boolean expression can be given (in Modelica notation, this is a modification of the time varying variable condition). Whenever this condition is true, the transition can fire. Additionally, it is possible to activate a timer, via enableTimer (see menu above) and provide a waitTime. In this case the firing of the transition is delayed according to the provided waitTime. The transition condition and the waitTime are displayed in the transition icon.
In the above example, the simulation starts at initialStep. After 1 second, transition1 fires and step1 becomes active. After another second transition2 fires and initialStep becomes again active. After a further second step1 becomes again active, and so on.

Re: FirstExample in Modelica.StateGraph doesn't works

Hi, thanks for answer.

When I run the simulation, the InitialStep always is active and the second step always is deactivated. I run the simulation for 5 seconds, and the transitions has 1 second in the waitime parameter. I understand what should hapen, but the simulation no have a logical result. I don't know what I have to do to the simulation have succesfully results.

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