flixOpt.components
This module contains the basic components of the flixOpt framework.
Classes
LinearConverter
LinearConverter(label: str, inputs: List[Flow], outputs: List[Flow], on_off_parameters: OnOffParameters = None, conversion_factors: List[Dict[Flow, Numeric_TS]] = None, segmented_conversion_factors: Dict[Flow, List[Tuple[Numeric_TS, Numeric_TS]]] = None, meta_data: Optional[Dict] = None)
              Bases: Component
Converts one FLow into another via linear conversion factors
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| label | str | name. | required | 
| meta_data | Optional[Dict] | used to store more information about the element. Is not used internally, but saved in the results | None | 
| inputs | input flows. |  | required | 
| outputs | output flows. |  | required | 
| on_off_parameters | OnOffParameters |  | None | 
| conversion_factors | linear relation between flows. | Either 'conversion_factors' or 'segmented_conversion_factors' can be used! example heat pump: | None | 
| segmented_conversion_factors |  Segmented linear relation between flows. | Each Flow gets a List of Segments assigned. If FLows need to be 0 (or Off), include a "Zero-Segment" "(0, 0)", or use on_off_parameters Either 'segmented_conversion_factors' or 'conversion_factors' can be used! --> "gaps" can be expressed by a segment not starting at the end of the prior segment : [(1,3), (4,5)] --> "points" can expressed as segment with same begin and end : [(3,3), (4,4)] | None | 
Storage
Storage(label: str, charging: Flow, discharging: Flow, capacity_in_flow_hours: Union[Skalar, InvestParameters], relative_minimum_charge_state: Numeric = 0, relative_maximum_charge_state: Numeric = 1, initial_charge_state: Optional[Union[Skalar, Literal['lastValueOfSim']]] = 0, minimal_final_charge_state: Optional[Skalar] = None, maximal_final_charge_state: Optional[Skalar] = None, eta_charge: Numeric = 1, eta_discharge: Numeric = 1, relative_loss_per_hour: Numeric = 0, prevent_simultaneous_charge_and_discharge: bool = True, meta_data: Optional[Dict] = None)
              Bases: Component
Klasse Storage
constructor of storage
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| label | str | description. | required | 
| meta_data | Optional[Dict] | used to store more information about the element. Is not used internally, but saved in the results | None | 
| charging | Flow | ingoing flow. | required | 
| discharging | Flow | outgoing flow. | required | 
| capacity_in_flow_hours | Skalar or InvestParameter | nominal capacity of the storage | required | 
| relative_minimum_charge_state | float or TS | minimum relative charge state. The default is 0. | 0 | 
| relative_maximum_charge_state | float or TS | maximum relative charge state. The default is 1. | 1 | 
| initial_charge_state | None, float (0...1), 'lastValueOfSim',  optional | storage charge_state at the beginning. The default is 0. float: defined charge_state at start of first timestep None: free to choose by optimizer 'lastValueOfSim': chargeState0 is equal to chargestate of last timestep ("closed simulation") | 0 | 
| minimal_final_charge_state | float or None | minimal value of chargeState at the end of timeseries. | None | 
| maximal_final_charge_state | float or None | maximal value of chargeState at the end of timeseries. | None | 
| eta_charge | float | efficiency factor of charging/loading. The default is 1. | 1 | 
| eta_discharge | TYPE | efficiency factor of uncharging/unloading. The default is 1. | 1 | 
| relative_loss_per_hour | float or optional | loss per chargeState-Unit per hour. The default is 0. | 0 | 
| prevent_simultaneous_charge_and_discharge | boolean | should simultaneously Loading and Unloading be avoided? (Attention, Performance maybe becomes worse with avoidInAndOutAtOnce=True). The default is True. | True | 
Transmission
Transmission(label: str, in1: Flow, out1: Flow, in2: Optional[Flow] = None, out2: Optional[Flow] = None, relative_losses: Optional[Numeric_TS] = None, absolute_losses: Optional[Numeric_TS] = None, on_off_parameters: OnOffParameters = None, prevent_simultaneous_flows_in_both_directions: bool = True)
              Bases: Component
Initializes a Transmission component (Pipe, cable, ...) that models the flows between two sides with potential losses.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| label | str | The name of the transmission component. | required | 
| in1 | Flow | The inflow at side A. Pass InvestmentParameters here. | required | 
| out1 | Flow | The outflow at side B. | required | 
| in2 | Optional[Flow] | The optional inflow at side B. If in1 got Investmentparameters, the size of this Flow will be equal to in1 (with no extra effects!) | None | 
| out2 | Optional[Flow] | The optional outflow at side A. | None | 
| relative_losses | Optional[Numeric_TS] | The relative loss between inflow and outflow, e.g., 0.02 for 2% loss. | None | 
| absolute_losses | Optional[Numeric_TS] | The absolute loss, occur only when the Flow is on. Induces the creation of the ON-Variable | None | 
| on_off_parameters | OnOffParameters | Parameters defining the on/off behavior of the component. | None | 
| prevent_simultaneous_flows_in_both_directions | bool | If True, prevents simultaneous flows in both directions. | True | 
TransmissionModel
              Bases: ComponentModel
SourceAndSink
SourceAndSink(label: str, source: Flow, sink: Flow, prevent_simultaneous_flows: bool = True, meta_data: Optional[Dict] = None)
              Bases: Component
class for source (output-flow) and sink (input-flow) in one commponent
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| label | str | name of sourceAndSink | required | 
| meta_data | Optional[Dict] | used to store more information about the element. Is not used internally, but saved in the results | None | 
| source | Flow | output-flow of this component | required | 
| sink | Flow | input-flow of this component | required | 
| prevent_simultaneous_flows | bool | True: inflow and outflow are not allowed to be both non-zero at same timestep. False: inflow and outflow are working independently. | True |