How can i retrieve the time step size for real value in the Modelica?

Viewed 228

I'm wondering how i get the each time step size for the real values to use this to the equation. I was trying to find the functions or something else but i couldn't.

Actually, I'm trying to integrate the pressure by the volume but the integrator in the Modelica only support the time integral. So i decided to multiply the (delta_volume/delta_time) to the integral of the pressure. That's why i'm doing this.

The pseudo code is like the below.

  Work=Integral(pressure);

enter image description here

But integrating the pressure by the volume is what i want, not by the time. So it should be changed like this

  Work=(Integral(pressure)) * (delta Volume/delta time);

I'm not able to use the constant value for the delta time because solver cannot handle my model for fixed time step.

Please reply this to me how i can get the value of each time step size for the real value.

2 Answers

If you don't want to integrate p dt but p dV=p dV/dt dt then you have to multiply p by der(V), there are blocks for multiplication Modelica.Blocks.Math.Product and differentiation Modelica.Blocks.Continuous.Der; alternatively use Modelica.Blocks.Continuous.Derivative for an approximate derivative.

Note that Dymola automatically checks units, in this case it is checked that the integral p*der(V) is compatible with work (i.e. "J") - which it should be.

Not sure if I understand your question correctly, but couldn't you compute power by

Power = pressure * volumeFlowRate = pressure * der(volume);

and then compute

der(Work) = Power;

Besides this, regarding your actual question: It is not possible to retrieve the step-size of a solver from the Modelica-code of a model.

Related