echo.models.agnostic.time_delay module

class echo.models.agnostic.time_delay.TimeDelayNode(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, max_output: float | None = None, min_output: float | None = None, max_input: float | None = None, min_input: float | None = None, input_port_ref: str = 'input', output_port_ref: str = 'output', *, input_port_unit: Units, output_port_unit: Units, time_delay: int)

Bases: InputOutputNode

A time delay node is an input-output node that implements a fixed delay between input and output.

apply_node_constraints(model: EchoConcreteModel) → None

Apply constraints associated with this node to a concrete model.

Intended to be overridden in subclasses.

Define constraints as functions that returns a Constraint, EqualityExpression or InequalityExpression.

Define a subfunction of the form detailed in the example below, then apply with setattr. For example:

def apply_node_constraints(self, model: EchoConcreteModel) -> None:
def tellegen_node_rule(model: EchoConcreteModel, p: int, t:int) -> EqualityExpression:

a = 0 for port in node_ports.values():

a += getattr(model, port.port_name)[p, t]

return a == 0

node_ports = self.ports con_name = “reliability_con_” + self.node_name setattr(model, con_name, en.Constraint(model.Expansion, model.Time, rule=tellegen_node_rule))

Parameters:

model – The model to add the constraints to.

Returns:

None

time_delay: int