Time derivative of expression or
partial derivative of function


der(expr) or
IDENT "=" der "(" name "," IDENT { "," IDENT } ")" comment


The first form is the time derivative of expression expr. If the expression expr is a scalar it needs to be a subtype of Real. The expression and all its subexpressions must be differentiable. If expr is an array, the operator is applied to all elements of the array. For Real parameters and constants the result is a zero scalar or array of the same size as the variable.

The second form is the partial derivative of a function and may only be used as declarations of functions. The semantics is that a function [and only a function] can be specified in this form, defining that it is the partial derivative of the function to the right of the equal sign (looked up in the same way as a short class definition - the looked up name must be a function), and partially differentiated with respect to each IDENT in order (starting from the first one). The IDENT must be Real inputs to the function. The comment allows a user to comment the function (in the info-layer and as one-line description, and as icon).


  Real x, xdot1, xdot2;
  xdot1 = der(x);
  xdot2 = der(x*sin(x));

The specific enthalpy can be computed from a Gibbs-function as follows:

function Gibbs
  input Real p,T;
  output Real g;
end Gibbs;

function Gibbs_T=der(Gibbs, T);

function specificEnthalpy
  input Real p,T;
  output Real h;
end specificEnthalpy;

Generated at 2020-07-15T01:52:57Z by OpenModelicaOpenModelica 1.16.0~dev-555-g52c29dc using GenerateDoc.mos