andes.core.discrete.DeadBand#

class andes.core.discrete.DeadBand(u, center, lower, upper, enable=True, equal=False, zu=0.0, zl=0.0, zi=1.0, name=None, tex_name=None, info=None)[source]#

The basic deadband type.

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 three flags.

Three flags computed from the current input:
  • zl: True if the input is below the lower threshold

  • zi: True if the input is within the deadband

  • zu: True if is above the lower threshold

Initial condition:

All three 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

Exported deadband flags need to be used in the algebraic equation corresponding to the post-deadband variable. Assume the pre-deadband input variable is var_in and the post-deadband variable is var_out. First, define a deadband instance db in the model using

self.db = DeadBand(u=self.var_in, center=self.dbc,
                   lower=self.dbl, upper=self.dbu)

To implement a no-memory deadband whose output returns to center when the input is within the band, the equation for var can be written as

var_out.e_str = 'var_in * (1 - db_zi) + \
                 (dbc * db_zi) - var_out'
__init__(u, center, lower, upper, enable=True, equal=False, zu=0.0, zl=0.0, zi=1.0, name=None, tex_name=None, info=None)[source]#

Methods

check_eq(**kwargs)

This function is called in l_check_eq after 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