andes.core.discrete.DeadBandRT#
- class andes.core.discrete.DeadBandRT(u, center, lower, upper, enable=True)[source]#
Deadband with flags for directions of return.
- Parameters:
- uNumParam
The pre-deadband input variable
- centerNumParam
Neutral value of the output
- lowerNumParam
Lower bound
- upperNumParam
Upper bound
- enablebool
Enabled if True; Disabled and works as a pass-through if False.
Notes
Input changes within a deadband will incur no output changes. This component computes and exports five flags. The additional two flags on top of DeadBand indicate the direction of return:
zur: True if the input is/has been within the deadband and was returned from the upper threshold
zlr: True if the input is/has been within the deadband and was returned from the lower threshold
Initial condition:
All five flags are initialized to zero. All flags are updated during check_var when enabled. If the deadband component is not enabled, all of them will remain zero.
Examples
To implement a deadband whose output is pegged at the nearest deadband bounds, the equation for var can be provided as
var_out.e_str = 'var_in * (1 - db_zi) + \ dbl * db_zlr + \ dbu * db_zur - var_out'
- __init__(u, center, lower, upper, enable=True)[source]#
Initialize DeadBandRT with return-direction tracking flags.
Methods
check_eq(**kwargs)This function is called in
l_check_eqafter updating equations.check_iter_err([niter, err])Check if the minimum iteration or maximum error is reached so that this discrete block should be enabled.
check_var(*args, **kwargs)Notes
do_adjust_lower(val, lower[, allow_adjust, ...])Adjust the lower limit.
do_adjust_upper(val, upper[, allow_adjust, ...])Adjust the upper limit.
get_limit_report()Return a list of dicts describing variables clamped at limits.
get_names()Available symbols from this class
get_tex_names()Return tex_names of exported flags.
get_values()list2array(n)Allocate memory for the discrete flags specified in self.export_flags.
save_unconstrained()Save the input variable's unconstrained value (call after init pass 1).
Attributes
class_name