echo.models.gas package
- class echo.models.gas.FixedGasPort(uid: str = NOTHING, port_name: str = NOTHING, initial_value: dict[tuple[int, int], float] | float = 0, initial_value_ref: str | None = None, initial_value_scaling: int | None = None, import_constraint_value: ConstraintValueType | None = None, export_constraint_value: ConstraintValueType | None = None, active_periods: dict[tuple[int, int], Any] | None = None, slack: bool = False, objective: en.numeric_expr.NumericExpression | float = 0, allow_dangling_port: bool = False, flows: Flows = Flows.Both, import_constraint: FlowConstraint = FlowConstraint.NoConstraint, export_constraint: FlowConstraint = FlowConstraint.NoConstraint, flow_type: OptimisationType = OptimisationType.Parameter, units: Units = Units.JPS)
Bases:
FixedPortA Fixed port with flow units of Joules/second
- class echo.models.gas.FlexGasPort(uid: str = NOTHING, port_name: str = NOTHING, initial_value: dict[tuple[int, int], float] | float = 0, initial_value_ref: str | None = None, initial_value_scaling: int | None = None, import_constraint_value: ConstraintValueType | None = None, export_constraint_value: ConstraintValueType | None = None, active_periods: dict[tuple[int, int], Any] | None = None, slack: bool = False, objective: en.numeric_expr.NumericExpression | float = 0, allow_dangling_port: bool = False, flows: Flows = Flows.Both, import_constraint: FlowConstraint = FlowConstraint.NoConstraint, export_constraint: FlowConstraint = FlowConstraint.NoConstraint, flow_type: OptimisationType = OptimisationType.Variable, units: Units = Units.JPS)
Bases:
FlexPortA flexible port with flow units of Joules/second
- class echo.models.gas.GasBoilerFixedCOP(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, input_port_ref: str = 'input', output_port_ref: str = 'output', input_port_unit: Units = Units.JPS, output_port_unit: Units = Units.KWT, min_input: float | None = None, cop: float = 1, startup_cop: float = 1)
Bases:
InputOutputNodeA gas boiler converts gas to heat at a fixed coefficient of performance (COP) where COP = output/input.
- 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
- cop: float
- min_input: float | None
- set_ports(gas_input_port: OffOrConstrainedPort, thermal_output_port: FlexPort) None
- startup_cop: float
- class echo.models.gas.TempControlledBoiler(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, input_port_ref: str = 'input', output_port_ref: str = 'output', input_port_unit: Units = Units.JPS, output_port_unit: Units = Units.KWT, exit_temp_bounds: tuple = (75, 80), return_temp_bounds: tuple = (50, 80), min_input: float | None = None, cop: float = 1, startup_cop: float | None = None, return_t: str = '', exit_t: str = '', *, deg_to_kw: float)
Bases:
InputOutputNodeA temp controlled boiler has an input and output port. It has two internal temperature variables, one for exiting water temp and one for returning water temp.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- 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
- cop: float
- deg_to_kw: float
- exit_t: str
- exit_temp_bounds: tuple
- min_input: float | None
- return_t: str
- return_temp_bounds: tuple
- startup_cop: float | None
Submodules
- echo.models.gas.base module
- echo.models.gas.boiler_fixedcop module
- echo.models.gas.boiler_tempcontrolled module
TempControlledBoilerTempControlledBoiler.add_node_to_model()TempControlledBoiler.apply_node_constraints()TempControlledBoiler.copTempControlledBoiler.deg_to_kwTempControlledBoiler.exit_tTempControlledBoiler.exit_temp_boundsTempControlledBoiler.input_port_unitTempControlledBoiler.min_inputTempControlledBoiler.output_port_unitTempControlledBoiler.return_tTempControlledBoiler.return_temp_boundsTempControlledBoiler.startup_cop