Differentiation and Integration
Calculus
Differentiation "derive"
The function derive() differentiates the time-dependent signal with respect to time.
The physical unit of the result is reduced by one time dimension compared to the input function: .
This function is provided when the system is extended to include equidistant signal curves, thereby enabling at least linearly interpolated signal curves.
Since the smartCORE typically writes non-equidistant signal values to a single channel only when the value has changed, the value between two explicit support points must always be assumed to be constant, and the information for the last, actual sampling interval is missing. Between the sampling points, the signal value on the left side always applies (zero-order hold). This results in a staircase-shaped signal waveform.
Applying differentiation to non-equidistant signals with a staircase-like profile is meaningless. The result would be either or
Integration "integrate"
The function integrate() returns the time integral of the input function x
Since always provides individual support points at non-equidistant time points , between which the left-hand side function value is assumed to be constant, the integral can also be written as a sum:
The physical unit of the result is extended by a time dimension: .
For equidistant signals, trapezoidal integration is planned for the future.
I1 = integrate(y);
I2 = integrate(y, reset);
I3 = integrate(y, reset, preset);
// Optional configuration for all variants
Ix = integrate(..., { start: <dbl>
, preset: <dbl>
, lower: off|<dbl>
, upper: off|<dbl>
, storage: <str>
});
If true is supplied via the optional parameter reset, the integral is reset to the value specified by preset (as a parameter or property, default 0.0) and held. Immediately before the reset, an additional sample is inserted, which outputs the last integral value accumulated up to that point ("true peak").
| Property | Value | Description |
|---|---|---|
| start | <dbl> | Initial value for the integral when the Math module starts |
| preset | <dbl> | Fixed value for resetting the integral via the reset parameter |
| lower | off/<dbl> | Limits the integral value downward, if enabled. This is required, for example, for the implementation of control structures or models where the integration process is limited by a physical boundary. |
| upper | off/<dbl> | Limits the integral value from above, if enabled. This is required, for example, for the implementation of control structures or models in which the integration process is limited by a physical boundary. |
| storage | <str> | Name of a persistent storage for the internal integral value. This ensures that integration continues from the last saved value after a system restart. The contents of this storage cannot be used anywhere else in smartCORE. |
Example:
In Example 1a, the integrate() function is used to calculate electrical energy from current and voltage waveforms.
In Example 10, the integrate() function is used to measure times.
Summation "sumup"
The function sumup() returns the sum of individual values of the input signal x at the times of a positive edge on the trigger parameter
S1 = sumup(x, trigger);
S2 = sumup(x, trigger, reset);
// Optional configuration for all variants
Sx = sumup(... , { storage: <str>
});
If true is supplied via the optional parameter reset, the sum is reset to 0.0 and held.
| Property | Value | Description |
|---|---|---|
| storage | <str> | Name of a persistent storage location for the internal sum value. This ensures that after a system restart, the sum continues from the last saved value. The contents of this storage cannot be used anywhere else in smartCORE. |