pathsim.blocks.differentiator module¶
- class pathsim.blocks.differentiator.Differentiator(f_max=100.0)[source]¶
Bases:
BlockDifferentiates the input signal (SISO) using a first order transfer function with a pole at the origin which implements a high pass filter.
\[H_\mathrm{diff}(s) = \frac{s}{1 + s / f_\mathrm{max}}\]The approximation holds for signals up to a frequency of approximately f_max.
Note
Depending on f_max, the resulting system might become stiff or ill conditioned! As a practical choice set f_max to 3x the highest expected signal frequency.
Note
Since this is an approximation of real differentiation, the approximation will not hold if there are high frequency components present in the signal. For example if you have discontinuities such as steps or squere waves.
Example
The block is initialized like this:
#cutoff at 1kHz D = Differentiator(f_max=1e3)
- Parameters:
f_max (float) – highest expected signal frequency
- op_dyn¶
internal dynamic operator for ODE component
- Type:
- op_alg¶
internal algebraic operator
- Type:
- update(t)[source]¶
update system equation fixed point loop, with convergence control
- Parameters:
t (float) – evaluation time