der
Return time derivative of operand
Parent Section: equations
Syntax
der(x)
Description
The der operator returns the time derivative of its operand:
der(x) = =
Use the der operator in the equations section of a component or
domain.
The der operator takes any numerical expression as its
argument:
derapplied to expressions that are continuous returns their time derivativederapplied totimeargument returns 1derapplied to expressions that are parametric or constant returns 0derapplied to countable operands returns 0. For example,der(a<b)returns 0 even if a and b are variables.
The return unit of der is the unit of its operand divided by
seconds.
You can nest der operators to specify higher order derivatives. For
example, der(der(x))is the second order time derivative of x.
The following restrictions apply:
You cannot form nonlinear expressions of the output from
der. For example,der(x)*der(x)would produce an error because this is no longer a linearly implicit system.For a component to compile, the number of differential equations should equal the number of differential variables.
Examples
Tips
x.deris equivalent toder(x), but not recommended. Useder(x)for code clarity.x.dercan be removed in a future release.
Version History
Introduced in R2008b