Segments¶
Segments are the building blocks that define connection behavior. Each connection composes an ordered segment chain to apply limits, efficiency losses, pricing, or internal balancing.
Composing connections¶
Connection composition follows a few rules:
- Segments are provided as an ordered mapping in the connection configuration.
- Mapping keys become segment names and appear under the
segmentsoutput. - If no segments are provided, a passthrough segment is created automatically.
- Adjacent segments are linked by equality constraints on their in/out flows.
- Segments receive references to the source and target elements for context.
This pattern keeps the connection model simple while making behavior explicit and reusable.
Segment types¶
- SOC pricing segment for battery SOC penalty costs.
- Efficiency segment for direction-specific loss modeling.
- Power limit segment for directional limits and time-slice coupling.
- Pricing segment for transfer costs and fees.
- Passthrough segment for lossless flow with no constraints or cost.
Next steps¶
-
Connection model
Segment-based connection formulation.
-
Elements
Battery and Node model elements.
-
Implementation
View segment source code.