andes.core.discrete.Sampling#

class andes.core.discrete.Sampling(u, interval=1.0, offset=0.0, name=None, tex_name=None, info=None)[source]#

Sample and hold

Sample an input variable periodically at the given time interval and hold the value until the next sample time.

For example, this class can be used to implement a 4-second sampling of the AGC signal.

The output of Sampling is named <INSTANCE_NAME>_v, where <INSTANCE_NAME> is the Sampling instance name.

__init__(u, interval=1.0, offset=0.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(dae_t, *args, **kwargs)

Check and update the output.

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 and set all _last_v internal storage to zeros.

save_unconstrained()

Save the input variable's unconstrained value (call after init pass 1).

Attributes

class_name