A derivative filtered in discrete or continuous time.
blockType: SubSystem
Path in the library:
/Physical Modeling/Electrical/Control/General Control/Filtered Derivative (Discrete or Continuous)
Description
Block Filtered Derivative (Discrete or Continuous) implements a derivative with filtering in accordance with the IEEE 421.5-2016 standard [1].
You can switch between continuous and discrete block implementations using the parameter Sample time (-1 for inherited).
The equations
notable mode
To configure the filtered derivative to work in continuous mode, set the parameter Sample time (-1 for inherited) meaning 0. This representation is equivalent to a continuous transfer function.
where
— gain factor;
— time constant.
The above transfer function implies a system of equations defining the derivative:
where
— the input signal of the unit;
— condition;
— the output signal of the unit;
— simulation time;
— the initial value of the input signal of the block.
discret mode
To configure the derivative with filtering to work in discrete mode, set the parameter Sample time (-1 for inherited) positive non-zero value or value −1 to inherit the sampling period from the upstream block. The discrete representation is equivalent to the transfer function
where
— gain factor;
— time constant;
— the sampling period.
Based on the discrete transfer function, the derivative equations with filtering are determined using the direct Euler method.:
where
— the input signal of the unit;
— block status;
— the output signal of the unit;
— time step of the simulation;
— the initial value of the input signal of the block.
Determining the initial conditions
The initial conditions of the block can be set using the parameter Initialization. Set the value:
Inherited from block input — the unit will set the initial conditions of the status and output signal equal to the initial input value;
Specify as parameter — the block will set the initial condition of the state equal to the value of the parameter Initial state.
Output signal limitation
To limit the output signal to the derivative with filtering, set the final values for the parameters Upper saturation limit and Lower saturation limit.
Unlike other typical blocks listed in the IEEE 421.5-2016 standard, saturation methods with error accumulation are used for the derivative with filtering («windup») and with suppression of error accumulation («anti-windup») do not differ. The output signal can immediately respond to a change in the sign of the input signal when it is saturated.
Ports
Input
# u
—
derivative input signal with filtering
vector
Details
The input signal is a derivative with filtering. The block uses the initial value of the input signal to determine the initial value of the state.
Data types
Float32, Float64
Complex numbers support
I don’t
Output
# y
—
derivative output signal with filtering
vector
#Time constant —
the time constant of the derivative
Details
The time constant of the derivative with filtering. To ensure acceptable accuracy, set this parameter to at least 10 times more than Sample time (-1 for inherited).
Default value
0.1
Program usage name
T
Evaluatable
Yes
#Upper saturation limit —
upper limit of the output signal
Details
The upper limit of the output signal of the derivative with filtering. Set the value Inf for an unsaturated upper limit.
Default value
Inf
Program usage name
upper_saturation_limit
Evaluatable
Yes
#Lower saturation limit —
lower limit of the output signal
Details
The lower limit of the output signal of the derivative with filtering. Set the value −Inf for the unsaturated lower limit.
Default value
-Inf
Program usage name
lower_saturation_limit
Evaluatable
Yes
#Minimum time constant to sample time ratio —
the discrete ratio
Details
The minimum allowable ratio of the time constant to the sampling period. As the sampling period approaches the time constant, the accuracy of the block decreases. Use this parameter to set the tolerance for this ratio.
Default value
10.0
Program usage name
T_to_sample_time_ratio
Evaluatable
Yes
#Initialization —
the method of setting the initial state
Inherited from block input | Specify as parameter
To use this parameter, set for the parameter Initialization meaning Specify as parameter.
Default value
0.0
Program usage name
initial_state
Evaluatable
Yes
#Sample time (-1 for inherited) —
block sampling period
Details
The time between consecutive block executions. During execution, the block generates output signals and, if necessary, updates its internal state.
For the inherited discrete time mode, set this parameter to −1. For discrete mode, set this parameter to a positive integer. For continuous mode, set this parameter to 0.
To ensure acceptable accuracy, set this parameter to at least 10 times less than Time constant.
Default value
-1
Program usage name
sample_time
Evaluatable
Yes
Literature
IEEE Recommended Practice for Excitation System Models for Power System Stability Studies. IEEE Std 421.5-2016. Piscataway, NJ: IEEE-SA, 2016.