Derivatives model

Requirements.Examples.Elementary.SignalAnalysis.Derivatives  ยท source

Icon of Derivatives

Examples for DerXXX (various ways to compute derivatives of signals)

Extends Modelica.Icons.Example

Using the signal analysis blocks ExactDerivative, ApproximateDerivativeWithFilter, and ApproximateDerivativeWithWindow to compute the derivative of the input signal analytically or approximately with the following example

results in

simulation result

Note, the approximate derivatives have a large error at the start of the simulation, because no information about the derivative of the signal is known. For this reason, the ApproximateDerivativeWithFilter block starts, for example, with steady-state (so zero derivative), and then needs some time until the approximation of the derivative is fine.

Components and variables

NameTypeDescription
der1Requirements.SignalAnalysis.ExactDerivativeExact (analytic) derivative of the sine
approxDerFilterRequirements.SignalAnalysis.ApproximateDerivativeWithFilterFiltered derivative of the sine, cut-off frequency 10 Hz
sineModelica.Blocks.Sources.SineSine of amplitude 2 at 1 Hz, phase 45 deg: the differentiated signal
approxDerWindowRequirements.SignalAnalysis.ApproximateDerivativeWithWindowFinite difference quotient of the sine over 0.1 s