Page 1 of 1

How to get the inital value of a variable ?

Posted: April 29th, 2017, 9:07 pm
by mathew1105
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

Re: How to get the inital value of a variable ?

Posted: May 2nd, 2017, 11:29 am
by Tuomas Miettinen
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.

Re: How to get the inital value of a variable ?

Posted: May 2nd, 2017, 6:35 pm
by mathew1105
Thank you very much that worked perfectly