I have a model in my Modelica and I use Dymola to compile this model. In my model I need the simulation information "Output Interval length". I have searched for it but I could not get the useful information. Is there any other possible way we could access simulation information.
-
Why do you need it? There might be a better way to accomplish what you want to do.jrhodin– jrhodin2016-09-24 04:54:40 +00:00Commented Sep 24, 2016 at 4:54
-
sorry for my late reply. I have used sine block to generate a signal. The also want the change in the value of the signal after every time step. At present I have used a delay function with the delay time step value. I have hardcoded the time step value. So after reading the valuable comments I have found that we cannot access the timestep. so is there any other way to the find the change in the sine block output after every time step?chaitanya majjari– chaitanya majjari2016-09-26 06:54:41 +00:00Commented Sep 26, 2016 at 6:54
-
Do you need this value for some computation in the model or could you use postprocessing to access the value?sjoelund.se– sjoelund.se2016-09-26 10:39:57 +00:00Commented Sep 26, 2016 at 10:39
-
I need it in the computation. I have to provide the difference in amplitude after every time step.chaitanya majjari– chaitanya majjari2016-09-26 12:25:30 +00:00Commented Sep 26, 2016 at 12:25
-
Is it the time derivative of the signal that you want?Jesse Gohl– Jesse Gohl2016-10-04 13:00:43 +00:00Commented Oct 4, 2016 at 13:00
4 Answers
If you are simply trying to get the results reported at specific intervals, you can use a sample operator to achieve that. That would force the solution to be computed at specific times without directly specifying something like the time step.
The important point to understand here is that a model where the behavior of the model depends on the numerical integration is highly suspect and I've never seen a case where the behavior couldn't be described without knowledge of the solution method. Said another way, "mother nature" doesn't know anything about "time steps". :-)
Comments
You could use a clocked system with an integrator. For an Example, see File -->Libraries-->Modelica_Synchronous --> Examples --> Systems --> Controlled_mixing_unit in Dymola There the period (i.e. in this case the timestep of the explicit Euler method) is a parameter of the periodic clock)
Comments
Modelica by design prohibits accessing any numerical solver internals, so you cannot access it. The output interval length also cannot be determined by the model in any reliable way since the solver will take internal steps longer than the output interval and then interpolate values for the result file.