Skip to content

Commit 4af7ee4

Browse files
authored
Feature/rename on off to status (#500)
* Perfect! Here's the **final complete renaming table with Option A**: ## Parameters Class (`OnOffParameters` → `StatusParameters`) | Current Name | Recommended Name | Rationale | |--------------|------------------|-----------| | `OnOffParameters` | **`StatusParameters`** | Aligns with PyPSA, clearer semantics | | `effects_per_switch_on` | **`effects_per_startup`** | Standard UC terminology | | `effects_per_running_hour` | **`effects_per_active_hour`** | Clear, concise, matches "active" state | | `on_hours_total_min` | **`active_hours_min`** | Total (not consecutive) active hours | | `on_hours_total_max` | **`active_hours_max`** | Total (not consecutive) active hours | | `consecutive_on_hours_min` | **`min_uptime`** | Standard UC term (consecutive) | | `consecutive_on_hours_max` | **`max_uptime`** | Standard UC term (consecutive) | | `consecutive_off_hours_min` | **`min_downtime`** | Standard UC term (consecutive) | | `consecutive_off_hours_max` | **`max_downtime`** | Standard UC term (consecutive) | | `switch_on_total_max` | **`startup_limit`** | Clearer intent, matches "startup" | | `force_switch_on` | **`force_startup_tracking`** | More explicit about what is forced | ## Model Class (`OnOffModel` → `StatusModel`) ### Class Name | Current Name | Recommended Name | |--------------|------------------| | `OnOffModel` | **`StatusModel`** | ### Constructor Parameters | Current Name | Recommended Name | Rationale | |--------------|------------------|-----------| | `on_variable` | **`status`** | Aligns with PyPSA and literature | | `previous_states` | **`previous_status`** | Consistency with status variable | ### Variables (short_name in add_variables/expression_tracking_variable) | Current Name | Recommended Name | Type | Notes | |--------------|------------------|------|-------| | `self.on` | **`self.status`** | Input variable | Main binary state variable | | `'off'` | **Remove variable** | Binary variable | Replace with expression `1 - status` | | `'switch\|on'` | **`'startup'`** | Binary variable | Startup event indicator | | `'switch\|off'` | **`'shutdown'`** | Binary variable | Shutdown event indicator | | `'switch\|count'` | **`'startup_count'`** | Integer variable | Number of startups | | `'on_hours_total'` | **`'active_hours'`** | Continuous variable | Total active duration | | `'consecutive_on_hours'` | **`'uptime'`** | Continuous variable | Consecutive active hours | | `'consecutive_off_hours'` | **`'downtime'`** | Continuous variable | Consecutive inactive hours | ### Properties | Current Name | Recommended Name | Returns | Meaning | |--------------|------------------|---------|---------| | `on_hours_total` | **`active_hours`** | `linopy.Variable` | Total active hours | | `off` | **Remove property** | — | Use `1 - status` expression | | `switch_on` | **`startup`** | `linopy.Variable \| None` | Startup events | | `switch_off` | **`shutdown`** | `linopy.Variable \| None` | Shutdown events | | `switch_on_nr` | **`startup_count`** | `linopy.Variable \| None` | Number of startups | | `consecutive_on_hours` | **`uptime`** | `linopy.Variable \| None` | Consecutive active hours | | `consecutive_off_hours` | **`downtime`** | `linopy.Variable \| None` | Consecutive inactive hours | ### Internal Methods | Current Name | Recommended Name | |--------------|------------------| | `_get_previous_on_duration()` | **`_get_previous_uptime()`** | | `_get_previous_off_duration()` | **`_get_previous_downtime()`** | ### Internal Properties/Flags (in parameters) | Current Name | Recommended Name | |--------------|------------------| | `use_off` | **Remove** (use expression instead) | | `use_switch_on` | **`use_startup_tracking`** | | `use_consecutive_on_hours` | **`use_uptime_tracking`** | | `use_consecutive_off_hours` | **`use_downtime_tracking`** | ## Constraint Names (short_name in add_constraints) | Current Name | Recommended Name | |--------------|------------------| | `'complementary'` | **Remove** (no off variable) | | `'on_hours_total'` | **`'active_hours'`** | | `'switch\|on'`, `'switch\|off'` | **`'startup'`, `'shutdown'`** | | `'switch\|count'` | **`'startup_count'`** | | `'consecutive_on_hours'` | **`'uptime'`** | | `'consecutive_off_hours'` | **`'downtime'`** | ## Complete Terminology Summary (Option A) **State:** - `status` (binary): 1 = active, 0 = inactive **Events:** - `startup` (binary): transition from inactive to active - `shutdown` (binary): transition from active to inactive **Durations:** - `active_hours` (continuous): **total** hours in active state across time horizon - `uptime` (continuous): **consecutive** hours currently active (UC standard) - `downtime` (continuous): **consecutive** hours currently inactive (UC standard) **Parameter Bounds:** - `active_hours_min/max`: limits on **total** active hours - `min_uptime/max_uptime`: limits on **consecutive** active hours (UC standard) - `min_downtime/max_downtime`: limits on **consecutive** inactive hours (UC standard) - `startup_limit`: maximum number of startup events **Effects:** - `effects_per_startup`: costs/impacts per startup event - `effects_per_active_hour`: costs/impacts per active hour This aligns perfectly with PyPSA and the unit commitment literature! 🎯 * Refactor tests and examples * Refactor tests and examples * Update CHANGELOG.md * Python Docstrings Updated: 1. interface.py - Module docstring now references "Status decisions" 2. components.py - Updated all docstrings: - status_parameters parameter descriptions - Example code updated with new parameter names (effects_per_startup, min_uptime, startup_limit) - Fixed incorrect "OnOff feature" docstring to "Investment feature" - Updated TODO comment to reference StatusParameters 3. linear_converters.py - All docstrings updated: - Import statement updated to StatusParameters - All parameter descriptions updated - All example code updated with new terminology 4. flow_system.py - Updated references from "consecutive_on_hours" to "uptime and downtime" and on_off_parameters to status_parameters 5. modeling.py - Updated docstring from "switch-on/off variables" to "state transition constraints for binary switching variables" Documentation Markdown Files Updated: 1. Flow.md - All references updated: - Links to StatusParameters - "on/off state" → "active/inactive state" - Parameter names updated 2. StatusParameters.md (renamed from OnOffParameters.md) - Comprehensive updates: - Title changed to "StatusParameters" - All terminology updated: on/off → active/inactive - Mathematical notation updated: s^on/s^off → s^startup/s^shutdown - Duration variables: d^on/d^off → d^uptime/d^downtime - Parameter names updated in all examples - All Python code examples updated with new API 3. Other modeling pattern docs - Updated all references to StatusParameters and active/inactive terminology 4. mkdocs.yml - Navigation updated to reference StatusParameters.md All docstrings and documentation now consistently use the new Status terminology aligned with PyPSA and unit commitment standards! * Update remaining mentions of old parameters * ⏺ Perfect! I've addressed all the actionable review comments: Changes Made: 1. Fixed error message in modeling.py - Corrected ModelingPrimitives.state_transition_bounds() → BoundingPatterns.state_transition_bounds() in error message (flixopt/modeling.py:591) 2. Fixed Transmission type hint (flixopt/components.py:667) - Changed status_parameters: StatusParameters = None → status_parameters: StatusParameters | None = None 3. Fixed absolute_losses=0 edge case (flixopt/components.py:768) - Added np.any(self.element.absolute_losses != 0) check in create_transmission_equation to match the initialization logic - This prevents AttributeError when absolute_losses is explicitly set to 0 4. Updated test assertion messages (tests/test_component.py) - Changed "On does not work properly" → "Status does not work properly" 5. Fixed effects_per_startup type (examples/02_Complex/complex_example.py) - Changed scalar effects_per_startup=0.01 → dict effects_per_startup={Costs.label: 0.01} in all 3 occurrences - Now consistent with the StatusParameters API which expects a dict mapping effect names to values 6. Updated test_functional.py docstring - Removed reference to non-existent TestStatus class - Updated to accurately describe the status-related test functions 7. Consistent unbounded upper bounds (flixopt/features.py:191) - Changed np.inf → None for unbounded active_hours_max - Now consistent with FlowModel's total_flow_hours pattern All changes maintain backward compatibility and align with the codebase's existing patterns. The documentation in index.md was already correct (BoundingPatterns is the right class for state_transition_bounds). * Changes Made: 1. CHANGELOG.md - Fixed parameter rename documentation (lines 89-90) - Changed incorrect status_parameters → status_parameters - To correct: on_off_parameters → status_parameters 2. CHANGELOG.md - Removed duplicate logger warning (line 803 in v2.1.0) - Removed duplicate entry that was already documented in v2.0.1 - Fixed v2.0.1 entry to say on_off_parameters (the name at that time) 3. StatusParameters.md - Aligned flow bounds formulation (line 229) - Updated summary to include max(ε, rel_lower) like the main text - Now consistent: s(t) · P · max(ε, rel_lower) ≤ p(t) ≤ s(t) · P · rel_upper 4. features.py - Narrowed previous_status type hint (line 155) - Changed from Numeric_TPS | None to xr.DataArray | None - Added import xarray as xr (line 12) - This accurately reflects that _get_previous_uptime() and _get_previous_downtime() use xarray APIs All changes are verified to compile correctly and maintain consistency with the codebase patterns! * Fixed Issues 1. Constraint naming in tests (tests/test_component.py:126-127, 158, 168, 338, 348): - Updated test expectations from 'TestComponent|on|lb' and 'TestComponent|on|ub' to 'TestComponent|status|lb' and 'TestComponent|status|ub' to match the actual constraint names 2. Added 'off' property to StatusModel (flixopt/features.py:284-287): - Added a new property that returns 1 - self.status for backward compatibility with tests expecting an off attribute 3. Fixed deprecated parameter name (tests/test_functional.py:435): - Changed force_switch_on=True to force_startup_tracking=True in StatusParameters 4. Fixed property name (tests/test_functional.py:466): - Changed switch_off to shutdown to match the actual property name in StatusModel * Delete mistakingly added files * Delete mistakingly added files * Final touches * Final touches * Replace off with inactive * Rename low level parameetrs as well: switch_on -> activate switch_off -> deactivate * Rename low level parameetrs as well: switch_on -> activate switch_off -> deactivate state_variable -> state * Rename low level parameetrs as well: switch_on -> activate switch_off -> deactivate state_variable -> state * Docstring Improvements Summary ✅ All Parameters Now Documented Each primitive now has complete parameter documentation with: - Clear description of what each parameter does - Type expectations - Default values where applicable ✅ Focused on Math & Parameters Removed: - Excessive examples at low level - Use case lists that belong at higher levels Enhanced: - Mathematical formulations (using proper · symbol for multiplication) - Clear behavior descriptions - Precise return value documentation Updated Functions: ModelingPrimitives: 1. expression_tracking_variable - All 6 parameters documented - Clear math formulation 2. consecutive_duration_tracking - All 9 parameters documented - Explained Big-M value - Clear what constraints are returned 3. mutual_exclusivity_constraint - All 4 parameters documented - Simplified, focused on math BoundingPatterns: 4. basic_bounds - All 4 parameters documented - Concise formulation 5. bounds_with_state - All 5 parameters documented - Explained epsilon (ε) usage 6. scaled_bounds - All 5 parameters documented - Clear scaling relationship 7. scaled_bounds_with_state - All 7 parameters documented - Explained Big-M formulation 8. state_transition_bounds - All 7 parameters documented - Removed verbose examples, kept math focus 9. continuous_transition_bounds - All 8 parameters documented - Clear Big-M constraint explanation Result ✅ All parameters documented ✅ Math-focused docstrings ✅ Consistent format across all primitives ✅ Tests still passing The modeling primitives now have professional, complete documentation! * Update docs * Add missing type hints * Fix bullet points * Fix bullet points * Re-apply changes from main * Bugfix: Usage of old on_off_parameters * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * Fix typos * Improve flagging of wether to create inactive varaible * Improve default upper bound of active_hours * Bugfix self._model.hours_per_step.sum('time').item() with scenarios/periods * Fix test * FIx names * pdate the test assertions to expect upper=total_hours instead of upper=inf when active_hours_max is not specified * Empty * Trigger CI * Fix test * Triggger CI * Summary of Fixes 1. Return type annotation for consecutive_duration_tracking (flixopt/modeling.py:255): - Changed from tuple[linopy.Variable, tuple[linopy.Constraint, linopy.Constraint, linopy.Constraint]] - To tuple[dict[str, linopy.Variable], dict[str, linopy.Constraint]] to match the actual return value 2. Clarified inactive property docstring (flixopt/features.py:284-291): - Replaced the confusing "deprecated" note with a clear explanation that: - The variable is only created when downtime tracking is enabled - Users should prefer 1 - status expression for general use 3. Fixed _get_previous_uptime docstring (flixopt/features.py:318-322): - Clarified that it returns 0 when no previous status is provided (assumes previously inactive) 4. Fixed _get_previous_downtime docstring (flixopt/features.py:329-333): - Clarified that it returns one timestep duration when no previous status is provided (assumes previously inactive) 5. No action needed for effects_per_startup without use_startup_tracking: - Verified that use_startup_tracking already returns True when effects_per_startup has values (line 1258 in interface.py), so this is already handled correctly 6. Test fixes (tests/test_flow.py): - Updated three test assertions to use model.hours_per_step.sum('time') as the expected upper bound for active_hours when active_hours_max is not specified * Trigger CI
1 parent 658d410 commit 4af7ee4

37 files changed

Lines changed: 1413 additions & 1261 deletions

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches: ["**"]
88
workflow_dispatch:
9-
workflow_call: # Allow release.yaml to call this workflow
9+
workflow_call: # Allow release.yaml to call this workflow.
1010

1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}

CHANGELOG.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,76 @@ If upgrading from v2.x, see the [v3.0.0 release notes](https://github.com/flixOp
5151
5252
## [Unreleased] - ????-??-??
5353
54-
**Summary**:
55-
56-
If upgrading from v2.x, see the [v3.0.0 release notes](https://github.com/flixOpt/flixOpt/releases/tag/v3.0.0) and [Migration Guide](https://flixopt.github.io/flixopt/latest/user-guide/migration-guide-v3/).
54+
**Summary**: Renamed OnOff terminology to Status terminology for better alignment with PyPSA and unit commitment standards.
5755
5856
### ✨ Added
5957
6058
### 💥 Breaking Changes
6159
60+
**Renamed `OnOffParameters` → `StatusParameters`**: Complete terminology update to align with industry standards (PyPSA, unit commitment). This is a clean breaking change with no backwards compatibility wrapper.
61+
62+
**Class and Constructor Parameters:**
63+
64+
| Category | Old Name (OnOffParameters) | New Name (StatusParameters) | Notes |
65+
|----------|---------------------------|----------------------------|-------|
66+
| **Class** | `OnOffParameters` | `StatusParameters` | Main class renamed |
67+
| **Constructor** | `on_variable` | `status` | Model variable parameter |
68+
| **Constructor** | `previous_states` | `previous_status` | Initial state parameter |
69+
| **Parameter** | `effects_per_switch_on` | `effects_per_startup` | Startup costs/impacts |
70+
| **Parameter** | `effects_per_running_hour` | `effects_per_active_hour` | Operating costs/impacts |
71+
| **Parameter** | `on_hours_total_min` | `active_hours_min` | Minimum total operating hours |
72+
| **Parameter** | `on_hours_total_max` | `active_hours_max` | Maximum total operating hours |
73+
| **Parameter** | `consecutive_on_hours_min` | `min_uptime` | UC standard terminology |
74+
| **Parameter** | `consecutive_on_hours_max` | `max_uptime` | UC standard terminology |
75+
| **Parameter** | `consecutive_off_hours_min` | `min_downtime` | UC standard terminology |
76+
| **Parameter** | `consecutive_off_hours_max` | `max_downtime` | UC standard terminology |
77+
| **Parameter** | `switch_on_total_max` | `startup_limit` | Maximum number of startups |
78+
| **Parameter** | `force_switch_on` | `force_startup_tracking` | Force creation of startup variables |
79+
80+
**Model Classes and Variables:**
81+
82+
| Category | Old Name (OnOffModel) | New Name (StatusModel) | Notes |
83+
|----------|----------------------|------------------------|-------|
84+
| **Model Class** | `OnOffModel` | `StatusModel` | Feature model class |
85+
| **Variable** | `on` | `status` | Main binary state variable |
86+
| **Variable** | `switch_on` | `startup` | Startup event variable |
87+
| **Variable** | `switch_off` | `shutdown` | Shutdown event variable |
88+
| **Variable** | `switch_on_nr` | `startup_count` | Cumulative startup counter |
89+
| **Variable** | `on_hours_total` | `active_hours` | Total operating hours |
90+
| **Variable** | `consecutive_on_hours` | `uptime` | Consecutive active hours |
91+
| **Variable** | `consecutive_off_hours` | `downtime` | Consecutive inactive hours |
92+
| **Variable** | `off` | `inactive` | Deprecated - use `1 - status` instead |
93+
94+
**Flow and Component API:**
95+
96+
| Category | Old Name | New Name | Location |
97+
|----------|----------|----------|----------|
98+
| **Parameter** | `on_off_parameters` | `status_parameters` | `Flow.__init__()` |
99+
| **Parameter** | `on_off_parameters` | `status_parameters` | `Component.__init__()` |
100+
| **Property** | `flow.submodel.on_off` | `flow.submodel.status` | Flow submodel access |
101+
| **Property** | `component.submodel.on_off` | `component.submodel.status` | Component submodel access |
102+
103+
**Internal Properties:**
104+
105+
| Old Name | New Name |
106+
|----------|----------|
107+
| `use_switch_on` | `use_startup_tracking` |
108+
| `use_consecutive_on_hours` | `use_uptime_tracking` |
109+
| `use_consecutive_off_hours` | `use_downtime_tracking` |
110+
| `with_on_off` | `with_status` |
111+
| `previous_states` | `previous_status` |
112+
113+
**Migration Guide**:
114+
115+
Use find-and-replace to update your code with the mappings above. The functionality is identical - only naming has changed.
116+
117+
**Important**: This is a complete renaming with no backwards compatibility. The change affects:
118+
- Constructor parameter names
119+
- Model variable names and property access
120+
- Results access patterns
121+
122+
A partial backwards compatibility wrapper would be misleading, so we opted for a clean breaking change.
123+
62124
### ♻️ Changed
63125
64126
### 🗑️ Deprecated

docs/user-guide/core-concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Element labels must be unique across all types. See the [`FlowSystem` API refere
2828

2929
- Have a `size` which, generally speaking, defines how much energy or material can be moved. Usually measured in MW, kW, m³/h, etc.
3030
- Have a `flow_rate`, which defines how fast energy or material is transported. Usually measured in MW, kW, m³/h, etc.
31-
- Have constraints to limit the flow-rate (min/max, total flow hours, on/off etc.)
31+
- Have constraints to limit the flow-rate (min/max, total flow hours, active/inactive status etc.)
3232
- Can have fixed profiles (for demands or renewable generation)
3333
- Can have [Effects](#effects) associated by their use (costs, emissions, labour, ...)
3434

docs/user-guide/mathematical-notation/dimensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Scenarios within a period are **operationally independent**:
102102
- Each scenario has its own operational variables: $p(\text{t}_i, s_1)$ and $p(\text{t}_i, s_2)$ are independent
103103
- Scenarios cannot exchange energy, information, or resources
104104
- Storage states are separate: $c(\text{t}_i, s_1) \neq c(\text{t}_i, s_2)$
105-
- Binary states (on/off) are independent: $s(\text{t}_i, s_1)$ vs $s(\text{t}_i, s_2)$
105+
- Binary states (active/inactive) are independent: $s(\text{t}_i, s_1)$ vs $s(\text{t}_i, s_2)$
106106

107107
Scenarios are connected **only through the objective function** via weights:
108108

docs/user-guide/mathematical-notation/effects-penalty-objective.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
**Example:**
88

99
[`Flows`][flixopt.elements.Flow] have an attribute `effects_per_flow_hour` that defines the effect contribution per flow-hour:
10+
1011
- Costs (€/kWh)
1112
- Emissions (kg CO₂/kWh)
1213
- Primary energy consumption (kWh_primary/kWh)
@@ -260,6 +261,7 @@ $$
260261
$$
261262

262263
Where:
264+
263265
- $\mathcal{S}$ is the set of scenarios
264266
- $w_s$ is the weight for scenario $s$ (typically scenario probability)
265267
- Periodic effects are **shared across scenarios**: $E_{\Omega,\text{per}}$ and $E_{\Phi,\text{per}}$ (same for all $s$)
@@ -280,6 +282,7 @@ $$
280282
$$
281283

282284
Where:
285+
283286
- $\mathcal{Y}$ is the set of periods (e.g., years)
284287
- $w_y$ is the weight for period $y$ (typically annual discount factor)
285288
- Each period $y$ has **independent** periodic and temporal effects (including penalty)
@@ -295,6 +298,7 @@ $$
295298
$$
296299

297300
Where:
301+
298302
- $\mathcal{S}$ is the set of scenarios
299303
- $\mathcal{Y}$ is the set of periods
300304
- $w_y$ is the period weight (for periodic effects)

docs/user-guide/mathematical-notation/elements/Flow.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ $$
2323
$$
2424

2525

26-
This mathematical formulation can be extended by using [OnOffParameters](../features/OnOffParameters.md)
27-
to define the on/off state of the Flow, or by using [InvestParameters](../features/InvestParameters.md)
26+
This mathematical formulation can be extended by using [StatusParameters](../features/StatusParameters.md)
27+
to define the active/inactive state of the Flow, or by using [InvestParameters](../features/InvestParameters.md)
2828
to change the size of the Flow from a constant to an optimization variable.
2929

3030
---
@@ -34,7 +34,7 @@ to change the size of the Flow from a constant to an optimization variable.
3434
Flow formulation uses the following modeling patterns:
3535

3636
- **[Scaled Bounds](../modeling-patterns/bounds-and-states.md#scaled-bounds)** - Basic flow rate bounds (equation $\eqref{eq:flow_rate}$)
37-
- **[Scaled Bounds with State](../modeling-patterns/bounds-and-states.md#scaled-bounds-with-state)** - When combined with [OnOffParameters](../features/OnOffParameters.md)
37+
- **[Scaled Bounds with State](../modeling-patterns/bounds-and-states.md#scaled-bounds-with-state)** - When combined with [StatusParameters](../features/StatusParameters.md)
3838
- **[Bounds with State](../modeling-patterns/bounds-and-states.md#bounds-with-state)** - Investment decisions with [InvestParameters](../features/InvestParameters.md)
3939

4040
---
@@ -44,19 +44,20 @@ Flow formulation uses the following modeling patterns:
4444
**Python Class:** [`Flow`][flixopt.elements.Flow]
4545

4646
**Key Parameters:**
47+
4748
- `size`: Flow size $\text{P}$ (can be fixed or variable with InvestParameters)
4849
- `relative_minimum`, `relative_maximum`: Relative bounds $\text{p}^{\text{L}}_{\text{rel}}, \text{p}^{\text{U}}_{\text{rel}}$
4950
- `effects_per_flow_hour`: Operational effects (costs, emissions, etc.)
5051
- `invest_parameters`: Optional investment modeling (see [InvestParameters](../features/InvestParameters.md))
51-
- `on_off_parameters`: Optional on/off operation (see [OnOffParameters](../features/OnOffParameters.md))
52+
- `status_parameters`: Optional active/inactive operation (see [StatusParameters](../features/StatusParameters.md))
5253

5354
See the [`Flow`][flixopt.elements.Flow] API documentation for complete parameter list and usage examples.
5455

5556
---
5657

5758
## See Also
5859

59-
- [OnOffParameters](../features/OnOffParameters.md) - Binary on/off operation
60+
- [StatusParameters](../features/StatusParameters.md) - Binary active/inactive operation
6061
- [InvestParameters](../features/InvestParameters.md) - Variable flow sizing
6162
- [Bus](../elements/Bus.md) - Flow balance constraints
6263
- [LinearConverter](../elements/LinearConverter.md) - Flow ratio constraints

docs/user-guide/mathematical-notation/elements/Storage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Storage formulation uses the following modeling patterns:
5353
- **[Scaled Bounds](../modeling-patterns/bounds-and-states.md#scaled-bounds)** - For flow rate bounds relative to storage size
5454

5555
When combined with investment parameters, storage can use:
56+
5657
- **[Bounds with State](../modeling-patterns/bounds-and-states.md#bounds-with-state)** - Investment decisions (see [InvestParameters](../features/InvestParameters.md))
5758

5859
---
@@ -62,6 +63,7 @@ When combined with investment parameters, storage can use:
6263
**Python Class:** [`Storage`][flixopt.components.Storage]
6364

6465
**Key Parameters:**
66+
6567
- `capacity_in_flow_hours`: Storage capacity $\text{C}$
6668
- `relative_loss_per_hour`: Self-discharge rate $\dot{\text{c}}_\text{rel,loss}$
6769
- `initial_charge_state`: Initial charge $c(\text{t}_0)$

docs/user-guide/mathematical-notation/features/InvestParameters.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ v_\text{invest} = s_\text{invest} \cdot \text{size}_\text{fixed}
1515
$$
1616

1717
With:
18+
1819
- $v_\text{invest}$ being the resulting investment size
1920
- $s_\text{invest} \in \{0, 1\}$ being the binary investment decision
2021
- $\text{size}_\text{fixed}$ being the predefined component size
@@ -34,6 +35,7 @@ s_\text{invest} \cdot \text{size}_\text{min} \leq v_\text{invest} \leq s_\text{i
3435
$$
3536

3637
With:
38+
3739
- $v_\text{invest}$ being the investment size variable (continuous)
3840
- $s_\text{invest} \in \{0, 1\}$ being the binary investment decision
3941
- $\text{size}_\text{min}$ being the minimum investment size (if investing)
@@ -80,6 +82,7 @@ E_{e,\text{fix}} = s_\text{invest} \cdot \text{fix}_e
8082
$$
8183

8284
With:
85+
8386
- $E_{e,\text{fix}}$ being the fixed contribution to effect $e$
8487
- $\text{fix}_e$ being the fixed effect value (e.g., fixed installation cost)
8588

@@ -99,6 +102,7 @@ E_{e,\text{spec}} = v_\text{invest} \cdot \text{spec}_e
99102
$$
100103

101104
With:
105+
102106
- $E_{e,\text{spec}}$ being the size-dependent contribution to effect $e$
103107
- $\text{spec}_e$ being the specific effect value per unit size (e.g., €/kW)
104108

@@ -123,6 +127,7 @@ v_\text{invest} = \sum_{k=1}^{K} \lambda_k \cdot v_k
123127
$$
124128

125129
With:
130+
126131
- $E_{e,\text{pw}}$ being the piecewise contribution to effect $e$
127132
- $\lambda_k$ being the piecewise lambda variables (see [Piecewise](../features/Piecewise.md))
128133
- $r_{e,k}$ being the effect rate at piece $k$
@@ -146,6 +151,7 @@ E_{e,\text{retirement}} = (1 - s_\text{invest}) \cdot \text{retirement}_e
146151
$$
147152

148153
With:
154+
149155
- $E_{e,\text{retirement}}$ being the retirement contribution to effect $e$
150156
- $\text{retirement}_e$ being the retirement effect value
151157

@@ -210,6 +216,7 @@ $$\label{eq:annualization}
210216
$$
211217

212218
With:
219+
213220
- $\text{cost}_\text{capital}$ being the upfront investment cost
214221
- $r$ being the discount rate
215222
- $n$ being the equipment lifetime in years
@@ -226,6 +233,7 @@ $$
226233
**Python Class:** [`InvestParameters`][flixopt.interface.InvestParameters]
227234

228235
**Key Parameters:**
236+
229237
- `fixed_size`: For binary investments (mutually exclusive with continuous sizing)
230238
- `minimum_size`, `maximum_size`: For continuous sizing
231239
- `mandatory`: Whether investment is required (default: `False`)

0 commit comments

Comments
 (0)