1

I know I can define parameter units like so:

parameter Modelica.SIunits.Mass m0 = 2 "Mass";

And the units of state variables like so:

Real m(start=m0, fixed=true, min=0, max=100, unit="kg");

But how can I define the units of a derivative? (Or are these generated automatically? It may be that JModelica, which I am using, simply does not check units.)

der(m) = m*u;
Richard
  • 56,349
  • 34
  • 180
  • 251

1 Answers1

2

Dymola does this automatically for you. OpenModelica does not. So I guess it's probably something also missing in JModelica.org.

Dietmar Winkler
  • 942
  • 5
  • 11
  • Thanks. I'm assuming you are referring to unit checking. Still, do you know if there is a way to set the derivative units in Dymola? Or are these calculated automagically? – Richard Aug 17 '15 at 15:42
  • 1
    I meant that it is automatically derived by Dymola. – Dietmar Winkler Aug 18 '15 at 16:23