Message Boards Message Boards


Integrate a variable with respect to time

Posted 9 years ago
3 Replies
2 Total Likes

How can I integrate a variable with respect to time ?

POSTED BY: Mohamed Mahmoud
3 Replies

You can find an Integrator component in the included libraries: Modelica.Blocks.Continuous.Integrator. This is modeled as an input block rather than a function to make it possible to connect to other components using drag&drop

POSTED BY: Jan Brugard

Thanks Frank. But this is a Mathematica code. I am asking about Modelica code (the language on which SystemModeler is based) !

Anyway, I used this function:

function int "Integrate variable with respect to time"
  extends Modelica.Icons.Function;
  input Real u;
  output Real y;
  annotation(Diagram(coordinateSystem(extent={{-148.5,-105.0},{148.5,105.0}}, preserveAspectRatio=true, initialScale=0.1, grid={5,5})));
end int;

It is working fine until now.

POSTED BY: Mohamed Mahmoud

Is it an explicit function of time?

In[1]:= f[t_] = t^3;

In[2]:= fi[tt_] = Integrate[f[t], {t, 0, tt}]

Out[2]= tt^4/4

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract