Message Boards Message Boards

0
|
5760 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

Integrate a variable with respect to time

Posted 10 years ago

How can I integrate a variable with respect to time ?

POSTED BY: Mohamed Mahmoud
3 Replies

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
Posted 10 years ago

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;
algorithm 
  u:=der(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

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract