monee express¶
Create functions¶
Flat create_* convenience functions for adding individual nodes,
branches, children and coupling points. Conventionally imported as
import monee.express as mx.
- monee.express.create_bus(network: monee.model.network.Network, base_kv=1, constraints=None, grid='electricity', overwrite_id=None, name=None, position=None)[source]¶
Add a Bus node. Returns the node id.
- monee.express.create_chp(network: monee.model.network.Network, power_node_id, heat_node_id, heat_return_node_id, gas_node_id, diameter_m, efficiency_power, efficiency_heat, mass_flow_setpoint_kgs, regulation=1, constraints=None, remove_existing_branch=False)[source]¶
Add a CHP compound (gas → power + heat via internal HX branch).
- monee.express.create_chp_hg(network: monee.model.network.Network, power_node_id, heat_node_id, gas_node_id, efficiency_power, efficiency_heat, mass_flow_setpoint_kgs, regulation=1, constraints=None)[source]¶
CHP variant using a SubHG node-based heat injector (no heat_return / diameter).
- monee.express.create_compressor(network: monee.model.network.Network, from_node_id, to_node_id, compression_ratio=1.5, max_flow_kgs=10.0, grid=None, name=None)[source]¶
Add a
GasCompressor(unidirectional, fixed ratio).
- monee.express.create_consume_hydr_grid(network: monee.model.network.Network, node_id, mass_flow_kgs=1, pressure_pu=1, t_k=293, grid_key='water', constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
ConsumeHydrGrid(fixed-pressure consumption point).pressure_puis per-unit (relative to the grid’s reference pressure), matchingcreate_ext_hydr_grid()and the model’s own convention.
- monee.express.create_el_branch(network: monee.model.network.Network, from_node_id, to_node_id, model, constraints=None, grid=None, name=None)[source]¶
Add an electrical branch using model. Returns the branch id tuple.
- monee.express.create_el_child(network: monee.model.network.Network, model, node_id, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach an electrical child model to
node_id; missing buses auto-created.
- monee.express.create_ext_hydr_grid(network: monee.model.network.Network, node_id, mass_flow_kgs=1, pressure_pu=1, t_k=356, grid_key='gas', max_import_kgs=None, max_export_kgs=None, pin_temperature=True, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach an
ExtHydrGrid(slack source). Prefer the carrier-specificcreate_gas_ext_grid()/create_water_ext_grid()shortcuts.
- monee.express.create_ext_power_grid(network: monee.model.network.Network, node_id, p_mw=0, q_mvar=0, vm_pu=1, va_degree=0, max_import_mw=None, max_export_mw=None, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach an
ExtPowerGrid(slack bus, pinned vm_pu/va_degree).
- monee.express.create_g2h(network: monee.model.network.Network, gas_node_id, heat_node_id, heat_return_node_id, heat_energy_mw, diameter_m, efficiency, temperature_ext_k=293, constraints=None)[source]¶
Add a Gas-to-Heat compound with an internal water HX branch.
- monee.express.create_g2h_hg(network: monee.model.network.Network, gas_node_id, heat_node_id, heat_energy_mw, efficiency, constraints=None)[source]¶
Single-branch G2H using
GasToHeatHG(heat injected at the to-node).
- monee.express.create_g2p(network: monee.model.network.Network, from_node_id, to_node_id, efficiency, p_mw_setpoint, q_mvar_setpoint=0, regulation=1, constraints=None, grid=None, name=None)[source]¶
Add a Gas-to-Power coupling branch (gas → power).
- monee.express.create_gas_child(network: monee.model.network.Network, model, node_id, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a gas child model to a junction.
- monee.express.create_gas_ext_grid(network: monee.model.network.Network, node_id, mass_flow_kgs=1, pressure_pu=1, t_k=356, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds an external hydraulic grid to a gas node, auto-creating a gas junction if needed.
- monee.express.create_gas_grid_forming_source(network: monee.model.network.Network, node_id, pressure_pu: float = 1.0, t_k: float = 356.0, mass_flow_max_kgs: float = 1000000.0, constraints=None, overwrite_id=None, name=None)[source]¶
Gas-side shortcut for
create_grid_forming_source().
- monee.express.create_gas_junction(network: monee.model.network.Network, grid='gas', constraints=None, overwrite_id=None, name=None, position=None)[source]¶
Add a gas junction. Returns the node id.
- monee.express.create_gas_pipe(network: monee.model.network.Network, from_node_id, to_node_id, diameter_m, length_m, temperature_ext_k=296.15, roughness_m=1e-05, on_off=1, constraints=None, grid=None, name=None)[source]¶
Add a
GasPipe; missing junctions are auto-created.
- monee.express.create_gas_sink(network: monee.model.network.Network, node_id, mass_flow_kgs=1, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds a gas sink (consumption) to a gas node, auto-creating a junction if needed.
- monee.express.create_gas_source(network: monee.model.network.Network, node_id, mass_flow_kgs=1, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds a gas source (injection) to a gas node, auto-creating a junction if needed.
- monee.express.create_grid_forming_generator(network: monee.model.network.Network, node_id, p_mw_max: float, q_mvar_max: float, vm_pu: float = 1.0, constraints=None, overwrite_id=None, name=None)[source]¶
Attach a
GridFormingGenerator(island slack bus). Requiresenable_islanding(net, electricity=True).
- monee.express.create_grid_forming_source(network: monee.model.network.Network, node_id, pressure_pu: float = 1.0, t_k: float = 356.0, mass_flow_max_kgs: float = 1000000.0, grid_key='gas', constraints=None, overwrite_id=None, name=None)[source]¶
Attach a
GridFormingSource(island pressure reference). Requiresenable_islandingfor the relevant carrier.
- monee.express.create_heat_exchanger(network: monee.model.network.Network, from_node_id, to_node_id, q_mw, regulation=1, constraints=None, grid=None, name=None)[source]¶
Add a heat-exchanger branch.
q_mw > 0→HeatExchangerLoad;q_mw < 0→HeatExchangerGenerator.
- monee.express.create_heat_generator(network: monee.model.network.Network, node_id, q_mw, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
HeatGeneratorto a water junction. Positive magnitude.
- monee.express.create_heat_load(network: monee.model.network.Network, node_id, q_mw, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
HeatLoadto a water junction (positive = consumption).
- monee.express.create_junction(network: monee.model.network.Network, grid, constraints=None, overwrite_id=None, name=None, position=None)[source]¶
Add a Junction node on grid. Returns the node id.
- monee.express.create_line(network: monee.model.network.Network, from_node_id, to_node_id, length_m, r_ohm_per_m, x_ohm_per_m, parallel=1, constraints=None, grid=None, name=None, on_off=1)[source]¶
Add a
PowerLinebetween two buses; missing buses are auto-created.
- monee.express.create_multi_energy_network()[source]¶
Empty multi-energy
mm.Network(convenience alias formm.Network()).
- monee.express.create_p2g(network: monee.model.network.Network, from_node_id, to_node_id, efficiency, mass_flow_setpoint_kgs, consume_q_mvar_setpoint=0, regulation=1, constraints=None, grid=None, name=None)[source]¶
Add a Power-to-Gas coupling branch (power → gas).
- monee.express.create_p2h(network: monee.model.network.Network, power_node_id, heat_node_id, heat_return_node_id, heat_energy_mw, diameter_m, efficiency, temperature_ext_k=293, q_mvar_setpoint=0, regulation=1, constraints=None)[source]¶
Add a Power-to-Heat compound with an internal water HX branch.
- monee.express.create_p2h_hg(network: monee.model.network.Network, power_node_id, heat_node_id, heat_energy_mw, efficiency, q_mvar_setpoint=0, constraints=None)[source]¶
Single-branch P2H using
PowerToHeatHG(heat injected at the to-node).
- monee.express.create_passive_heat_exchanger(network: monee.model.network.Network, from_node_id, to_node_id, q_mw, diameter_m, temperature_ext_k=293, constraints=None, grid=None, name=None)[source]¶
Add a passive heat-exchanger branch: a fixed
q_mwinjected into or extracted from the free-flowing water stream, with the temperature change following from the actual mass flow (the surrounding hydraulics determine the flow). Use this for in-line consumers/sources on a distribution run; usecreate_heat_exchanger()for supply/return exchangers that drive their design mass flow.q_mw > 0→PassiveHeatExchangerLoad;q_mw < 0→PassiveHeatExchangerGenerator.
- monee.express.create_power_generator(network: monee.model.network.Network, node_id, p_mw, q_mvar, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
PowerGenerator. Pass positive magnitudes; the constructor negates internally.
- monee.express.create_power_load(network: monee.model.network.Network, node_id, p_mw, q_mvar, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
PowerLoad(positive = consumption).
- monee.express.create_sink(network: monee.model.network.Network, node_id, mass_flow_kgs=1, grid_key='gas', constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
Sink(positive = consumption).
- monee.express.create_source(network: monee.model.network.Network, node_id, mass_flow_kgs=1, grid_key='gas', constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a
Source. Pass positive magnitude; constructor negates internally.
- monee.express.create_trafo(network: monee.model.network.Network, from_node_id, to_node_id, vk_percent=12.2, vkr_percent=0.25, sn_trafo_mva=160, shift=0, constraints=None, grid=None, name=None)[source]¶
Add a two-winding
Trafo. from-node = LV side, to-node = HV side.
- monee.express.create_water_child(network: monee.model.network.Network, model, node_id, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Attach a hydraulic child model to a water/heat junction.
- monee.express.create_water_ext_grid(network: monee.model.network.Network, node_id, mass_flow_kgs=1, pressure_pu=1, t_k=356, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds an external hydraulic grid to a water node, auto-creating a water junction if needed.
- monee.express.create_water_grid_forming_source(network: monee.model.network.Network, node_id, pressure_pu: float = 1.0, t_k: float = 356.0, mass_flow_max_kgs: float = 1000000.0, constraints=None, overwrite_id=None, name=None)[source]¶
Water-side shortcut for
create_grid_forming_source().
- monee.express.create_water_junction(network: monee.model.network.Network, grid='water', constraints=None, overwrite_id=None, name=None, position=None)[source]¶
Add a water/heat junction. Returns the node id.
- monee.express.create_water_pipe(network: monee.model.network.Network, from_node_id, to_node_id, diameter_m, length_m, temperature_ext_k=296.15, roughness_m=0.001, lambda_insulation_w_per_m_k=0.025, insulation_thickness_m=0.2, on_off=1, unidirectional=False, constraints=None, grid=None, name=None)[source]¶
Add a
WaterPipe.unidirectional=Truepins direction=0 (drops the binary on DH trunks with known flow direction).
- monee.express.create_water_sink(network: monee.model.network.Network, node_id, mass_flow_kgs=1, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds a water sink (consumption) to a water node, auto-creating a junction if needed.
- monee.express.create_water_source(network: monee.model.network.Network, node_id, mass_flow_kgs=1, constraints=None, overwrite_id=None, name=None, **kwargs)[source]¶
Adds a water source (injection) to a water node, auto-creating a junction if needed.
Topology structures¶
Bulk builders for common topologies (line, ring, star, and paired
district-heating supply/return structures). The factories
gas_structure(),
water_structure(),
el_structure() and
dhs_structure() return builders that
remember carrier-level defaults; their shape methods return
Segment,
StarSegment or
DhsSegment handles that can be
composed via start_from=. All names are also re-exported from
monee.express.
Bulk-construction helpers for common network topologies.
Each *_structure factory returns a builder that remembers carrier-level
defaults (diameter, length, grid, …) so the shape methods (line,
ring, star) stay short. Shape methods return Segment,
StarSegment, or DhsSegment handles that can be passed
back via start_from= to compose larger structures.
- class monee.express.structures.DhsSegment(supply: monee.express.structures.Segment, return_: monee.express.structures.Segment, heat_exchangers: list = <factory>)[source]¶
Bases:
objectPaired supply/return segments bridged by heat exchangers.
- property branches¶
- property children¶
- property nodes¶
- class monee.express.structures.DhsStructure(network, *, diameter_m, length_m, temperature_ext_k=296.15, roughness_m=0.001, lambda_insulation_w_per_m_k=0.025, insulation_thickness_m=0.2, unidirectional=True, grid=None)[source]¶
Bases:
objectPaired supply/return district-heating builder.
Mirrors every shape on both a supply line/ring/star and a return line/ring/star, then optionally bridges consumer nodes with heat exchangers. Heat exchanger orientation is supply -> return (hot side into cold side), matching the conventional DHS wiring.
- attach_heat_plant(supply_node, return_node, *, t_k=358.0, name=None)[source]¶
Attach a heat plant: external hydr grid on supply, consumer on return.
- line(n, *, start_from_supply=None, start_from_return=None, heat_exchanger_q_mw=None, **kwargs)[source]¶
- class monee.express.structures.ElStructure(network, *, length_m, r_ohm_per_m, x_ohm_per_m, parallel=1, base_kv=1, grid=None)[source]¶
Bases:
_Structure
- class monee.express.structures.GasStructure(network, *, diameter_m, length_m, temperature_ext_k=296.15, roughness_m=1e-05, grid=None)[source]¶
Bases:
_Structure
- class monee.express.structures.Segment(nodes: list, branches: list = <factory>, children: list = <factory>)[source]¶
Bases:
objectOrdered handle to a line/ring of nodes and their branches.
- property first¶
- property last¶
- class monee.express.structures.StarSegment(hub: int, arms: list, hub_children: list = <factory>)[source]¶
Bases:
objectHub + arm-segments. Each arm is itself a
Segmentwhosefirstis the shared hub.- property branches¶
- property children¶
- property nodes¶
- class monee.express.structures.WaterStructure(network, *, diameter_m, length_m, temperature_ext_k=296.15, roughness_m=0.001, lambda_insulation_w_per_m_k=0.025, insulation_thickness_m=0.2, unidirectional=False, grid=None)[source]¶
Bases:
_Structure
- monee.express.structures.dhs_structure(network, **kwargs)[source]¶
Builder for paired supply/return district-heating topologies.
- monee.express.structures.el_structure(network, **kwargs)[source]¶
Builder for electrical-bus topologies.