Hi i am trying to get the vale of an auxiliary variable and save it in another variable so the variable gets that value for the rest of the simulation.
Does anybody know how to do it?
thank you
How to get the inital value of a variable ?
-
- Posts: 4
- Joined: March 28th, 2017, 9:59 pm
-
- Site Admin
- Posts: 31
- Joined: March 11th, 2013, 3:14 pm
Re: How to get the inital value of a variable ?
You can get the initial value with the delay function. E.g.,
Aux1 = time + 1
Aux2 = delay(Aux1, stopTime)
gives Aux2 = 1 thru the whole simulation.
Can't tell how to do that in the middle of the simulation, but since the Sysdyn model is compiled to a Modelica model, there might be some Modelica functions to do that which the OpenModelica forum might be able to answer.
Aux1 = time + 1
Aux2 = delay(Aux1, stopTime)
gives Aux2 = 1 thru the whole simulation.
Can't tell how to do that in the middle of the simulation, but since the Sysdyn model is compiled to a Modelica model, there might be some Modelica functions to do that which the OpenModelica forum might be able to answer.
-
- Posts: 4
- Joined: March 28th, 2017, 9:59 pm
Re: How to get the inital value of a variable ?
Thank you very much that worked perfectly