FlixOpt Configuration
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.DataPointFlixoptLogLevel[source]
Bases:
DataPointGeneralDataPoint for Flixopt log level
Show JSON schema
{ "title": "DataPointFlixoptLogLevel", "description": "DataPoint for Flixopt log level", "type": "object", "properties": { "value": { "allOf": [ { "$ref": "#/$defs/FlixoptLogLevel" } ], "default": "silent", "description": "Log level for the flixopt framework" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "$defs": { "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)", "enum": [ "SEC", "HUR", "MIN", "DAY", "MON", "ANN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "KWT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "FlixoptLogLevel": { "description": "Log-Levels from flixopt configuration - see: flixopt.CONFIG \n\nFLIXOPT_CONFIG_MAP is used to map the enum values to the actual flixopt configuration functions", "enum": [ "exploring", "debug", "production", "silent" ], "title": "FlixoptLogLevel", "type": "string" } } }
-
field value:
FlixoptLogLevel= FlixoptLogLevel.SILENT Log level for the flixopt framework
-
field value:
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.DataPointFlixoptModelConfig[source]
Bases:
DataPointGeneralDataPoint for Flixopt model configuration. Can be a dict or a path to a json file.
Show JSON schema
{ "title": "DataPointFlixoptModelConfig", "description": "DataPoint for Flixopt model configuration.\nCan be a dict or a path to a json file.", "type": "object", "properties": { "value": { "anyOf": [ { "type": "object" }, { "type": "string" } ], "description": "Flixopt model configuration as dict or a path to a json file", "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "$defs": { "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)", "enum": [ "SEC", "HUR", "MIN", "DAY", "MON", "ANN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "KWT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" } }, "required": [ "value" ] }
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.DataPointFlixoptSolverSettings[source]
Bases:
DataPointGeneralDataPoint for Flixopt solver settings. Leaves solver parameters unset so flixopt can use its own defaults.
Show JSON schema
{ "title": "DataPointFlixoptSolverSettings", "description": "DataPoint for Flixopt solver settings.\nLeaves solver parameters unset so flixopt can use its own defaults.", "type": "object", "properties": { "value": { "allOf": [ { "$ref": "#/$defs/FlixoptSolverSettings" } ], "default": { "name": "HighsSolver", "mip_rel_gap": null, "time_limit": null, "threads": null, "mip_focus": null, "heuristics": null, "presolve": null, "cuts": null, "additional_options": null }, "description": "Solver settings for the flixopt framework" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "$defs": { "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)", "enum": [ "SEC", "HUR", "MIN", "DAY", "MON", "ANN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "KWT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "FlixOptSolverName": { "description": "Names of the available Flixopt solvers\n\nSee flixopt.solvers for available solvers", "enum": [ "GurobiSolver", "HighsSolver" ], "title": "FlixOptSolverName", "type": "string" }, "FlixoptSolverSettings": { "additionalProperties": false, "description": "Base model for Flixopt solver settings.\nOnly non-None values override the flixopt defaults.", "properties": { "name": { "allOf": [ { "$ref": "#/$defs/FlixOptSolverName" } ], "description": "Name of the solver (e.g. 'HighsSolver' or 'GurobiSolver')" }, "mip_rel_gap": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional relative optimality gap in [0.0, 1.0]", "title": "Mip Rel Gap" }, "time_limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional time limit in seconds", "title": "Time Limit" }, "threads": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional solver thread limit", "title": "Threads" }, "mip_focus": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional MIP search focus (solver-specific)", "title": "Mip Focus" }, "heuristics": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional heuristic intensity (solver-specific)", "title": "Heuristics" }, "presolve": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional presolve level (solver-specific)", "title": "Presolve" }, "cuts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional cut generation level (solver-specific)", "title": "Cuts" }, "additional_options": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "number" }, { "type": "string" }, { "type": "boolean" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Optional additional solver options forwarded directly to the selected flixopt solver constructor.", "title": "Additional Options" } }, "required": [ "name" ], "title": "FlixoptSolverSettings", "type": "object" } } }
-
field value:
FlixoptSolverSettings= FlixoptSolverSettings(name=<FlixOptSolverName.HIGHS: 'HighsSolver'>, mip_rel_gap=None, time_limit=None, threads=None, mip_focus=None, heuristics=None, presolve=None, cuts=None, additional_options=None) Solver settings for the flixopt framework
-
field value:
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.FlixoptModelComponentConfigData[source]
Bases:
ConfigDataConfig data model for the FlixOpt model component
Show JSON schema
{ "title": "FlixoptModelComponentConfigData", "description": "Config data model for the FlixOpt model component", "type": "object", "properties": { "log_level": { "allOf": [ { "$ref": "#/$defs/DataPointFlixoptLogLevel" } ], "default": { "value": "silent", "unit": null, "time": null }, "description": "Log level for the flixopt framework" }, "solver_settings": { "allOf": [ { "$ref": "#/$defs/DataPointFlixoptSolverSettings" } ], "default": { "value": { "additional_options": null, "cuts": null, "heuristics": null, "mip_focus": null, "mip_rel_gap": null, "name": "HighsSolver", "presolve": null, "threads": null, "time_limit": null }, "unit": null, "time": null }, "description": "Solver settings for the flixopt framework" }, "excess_penalty": { "allOf": [ { "$ref": "#/$defs/DataPointNumber" } ], "default": { "value": 100000.0, "unit": null, "time": null }, "description": "Penalty cost for excess of limits in the flixopt model" }, "flixopt_model": { "allOf": [ { "$ref": "#/$defs/DataPointFlixoptModelConfig" } ], "description": "\n Flixopt model configuration as dict or a path to a json file as ``DataPointFlixoptModelConfig``.\n Default to None. A valid flixopt model configuration must be provided.\n " } }, "$defs": { "DataPointFlixoptLogLevel": { "description": "DataPoint for Flixopt log level", "properties": { "value": { "allOf": [ { "$ref": "#/$defs/FlixoptLogLevel" } ], "default": "silent", "description": "Log level for the flixopt framework" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "title": "DataPointFlixoptLogLevel", "type": "object" }, "DataPointFlixoptModelConfig": { "description": "DataPoint for Flixopt model configuration.\nCan be a dict or a path to a json file.", "properties": { "value": { "anyOf": [ { "type": "object" }, { "type": "string" } ], "description": "Flixopt model configuration as dict or a path to a json file", "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "required": [ "value" ], "title": "DataPointFlixoptModelConfig", "type": "object" }, "DataPointFlixoptSolverSettings": { "description": "DataPoint for Flixopt solver settings.\nLeaves solver parameters unset so flixopt can use its own defaults.", "properties": { "value": { "allOf": [ { "$ref": "#/$defs/FlixoptSolverSettings" } ], "default": { "name": "HighsSolver", "mip_rel_gap": null, "time_limit": null, "threads": null, "mip_focus": null, "heuristics": null, "presolve": null, "cuts": null, "additional_options": null }, "description": "Solver settings for the flixopt framework" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "title": "DataPointFlixoptSolverSettings", "type": "object" }, "DataPointNumber": { "description": "Model for datapoints of the controller component.\n\nAttributes:\n value (float | int): The value of the datapoint, which is a number (float, int).\n unit (Optional[DataUnits]): Optional unit of the datapoint, if applicable.\n time (Optional[datetime]): Optional timestamp of the datapoint, if applicable.", "properties": { "value": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "time": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Time" } }, "required": [ "value" ], "title": "DataPointNumber", "type": "object" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)", "enum": [ "SEC", "HUR", "MIN", "DAY", "MON", "ANN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "KWT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "FlixOptSolverName": { "description": "Names of the available Flixopt solvers\n\nSee flixopt.solvers for available solvers", "enum": [ "GurobiSolver", "HighsSolver" ], "title": "FlixOptSolverName", "type": "string" }, "FlixoptLogLevel": { "description": "Log-Levels from flixopt configuration - see: flixopt.CONFIG \n\nFLIXOPT_CONFIG_MAP is used to map the enum values to the actual flixopt configuration functions", "enum": [ "exploring", "debug", "production", "silent" ], "title": "FlixoptLogLevel", "type": "string" }, "FlixoptSolverSettings": { "additionalProperties": false, "description": "Base model for Flixopt solver settings.\nOnly non-None values override the flixopt defaults.", "properties": { "name": { "allOf": [ { "$ref": "#/$defs/FlixOptSolverName" } ], "description": "Name of the solver (e.g. 'HighsSolver' or 'GurobiSolver')" }, "mip_rel_gap": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional relative optimality gap in [0.0, 1.0]", "title": "Mip Rel Gap" }, "time_limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional time limit in seconds", "title": "Time Limit" }, "threads": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional solver thread limit", "title": "Threads" }, "mip_focus": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional MIP search focus (solver-specific)", "title": "Mip Focus" }, "heuristics": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional heuristic intensity (solver-specific)", "title": "Heuristics" }, "presolve": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional presolve level (solver-specific)", "title": "Presolve" }, "cuts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional cut generation level (solver-specific)", "title": "Cuts" }, "additional_options": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "number" }, { "type": "string" }, { "type": "boolean" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Optional additional solver options forwarded directly to the selected flixopt solver constructor.", "title": "Additional Options" } }, "required": [ "name" ], "title": "FlixoptSolverSettings", "type": "object" } }, "required": [ "flixopt_model" ] }
-
field log_level:
DataPointFlixoptLogLevel= DataPointFlixoptLogLevel(value=<FlixoptLogLevel.SILENT: 'silent'>, unit=None, time=None) Log level for the flixopt framework
-
field solver_settings:
DataPointFlixoptSolverSettings= DataPointFlixoptSolverSettings(value=FlixoptSolverSettings(name=<FlixOptSolverName.HIGHS: 'HighsSolver'>, mip_rel_gap=None, time_limit=None, threads=None, mip_focus=None, heuristics=None, presolve=None, cuts=None, additional_options=None), unit=None, time=None) Solver settings for the flixopt framework
-
field excess_penalty:
DataPointNumber= DataPointNumber(value=100000.0, unit=None, time=None) Penalty cost for excess of limits in the flixopt model
-
field flixopt_model:
DataPointFlixoptModelConfig[Required] Flixopt model configuration as dict or a path to a json file as
DataPointFlixoptModelConfig. Default to None. A valid flixopt model configuration must be provided.
-
field log_level:
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.FlixoptModelComponentInputData[source]
Bases:
InputDataInput model for the Flixopt model component
The model_config field is set to allow flexible input of model parameters, so the required parameters can be defined in the flixopt model itself. This way, the component can be used with different flixopt models without needing to change the input data model.
Show JSON schema
{ "title": "FlixoptModelComponentInputData", "description": "Input model for the Flixopt model component\n\nThe `model_config` field is set to allow flexible input of model parameters, \nso the required parameters can be defined in the flixopt model itself.\nThis way, the component can be used with different flixopt models \nwithout needing to change the input data model.", "type": "object", "properties": {}, "additionalProperties": true }
- pydantic model encodapy.components.flixopt_model_component.flixopt_model_component_config.FlixoptModelComponentOutputData[source]
Bases:
OutputDataOutput model for the Flixopt model component
The model_config field is set to allow flexible output of model parameters, so the output parameters can be defined in the flixopt model itself.
The component provide this output variables: - Storage levels for all storages in the model like this: {storage_label}_soc - For all converters in the model, the thermal power like this: {converter_label}_thermal_power - For all CHP converters in the model, the electrical power like this: {converter_label}_electrical_power
Show JSON schema
{ "title": "FlixoptModelComponentOutputData", "description": "Output model for the Flixopt model component\n\nThe `model_config` field is set to allow flexible output of model parameters, \nso the output parameters can be defined in the flixopt model itself.\n\nThe component provide this output variables:\n- Storage levels for all storages in the model like this: `{storage_label}_soc`\n- For all converters in the model, the thermal power like this: `{converter_label}_thermal_power`\n- For all CHP converters in the model, the electrical power like this: `{converter_label}_electrical_power`", "type": "object", "properties": {}, "additionalProperties": true }
FlixOpt MPC Models
- class encodapy.components.flixopt_model_component.flixopt_models.EnergyDirection(*values)[source]
Bases:
EnumEnum to define the energy direction for a sink or source in the flixopt model
- BIDIRECTIONAL = 'bidirectional'
- SINK = 'sink'
- SOURCE = 'source'
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptBus[source]
Bases:
BaseModelModel to define a flow in the flixopt model, like it is used in the flixopt library https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Bus/
Show JSON schema
{ "title": "FlixOptBus", "description": "Model to define a flow in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Bus/", "type": "object", "properties": { "label": { "description": "Label of the flow", "title": "Label", "type": "string" }, "penalty": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Penalty cost for the flow", "title": "Penalty" } }, "additionalProperties": false, "required": [ "label" ] }
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptCHPConverter[source]
Bases:
FlixOptConverterModel to define a CHP converter in the flixopt model, which inherits from the FlixOptConverter model and adds specific parameters for the CHP converter type
Keep in mind, the nominal_power parameter in the FlixOptConverter model is the nominal thermal power of the CHP converter, while the nominal electrical power can be calculated from the thermal efficiency and the electrical efficiency of the CHP converter.
Show JSON schema
{ "title": "FlixOptCHPConverter", "description": "Model to define a CHP converter in the flixopt model, \nwhich inherits from the FlixOptConverter model\nand adds specific parameters for the CHP converter type\n\nKeep in mind, the `nominal_power` parameter in the FlixOptConverter model is the \nnominal thermal power of the CHP converter, while the nominal electrical power can be \ncalculated from the thermal efficiency and the electrical efficiency of the CHP converter.", "type": "object", "properties": { "label": { "description": "Label / Name of the converter", "title": "Label", "type": "string" }, "converter_type": { "allOf": [ { "$ref": "#/$defs/FlixOptConverterTypes" } ], "description": "Type of the converter, from the FlixOptConverterTypes enum" }, "thermal_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Thermal efficiency of the converter [0 ... 1]", "title": "Thermal Efficiency" }, "input_flow": { "description": "Label of the fuel flow to the converter", "title": "Input Flow", "type": "string" }, "thermal_flow": { "description": "Label of the thermal flow from the converter", "title": "Thermal Flow", "type": "string" }, "thermal_nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal thermal power of the converter", "title": "Thermal Nominal Power" }, "thermal_power_range": { "allOf": [ { "$ref": "#/$defs/PowerRange" } ], "default": { "min_power": 0.0, "max_power": 100.0 }, "description": "Thermal power range of the boiler converter in percentages" }, "status_parameters": { "allOf": [ { "$ref": "#/$defs/FlixOptStatusParameters" } ], "default": { "min_up_time": null, "max_up_time": null, "min_down_time": null, "max_down_time": null, "startup_effects": null }, "description": "\n Optional status parameters for the converter which includes information \n about startup and shutdown limitations" }, "previous_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Previous power of the converter in kW\n or as label of an input value, used to define the previous flow rate", "title": "Previous Power" }, "operation_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Operation time of the converter in hours\n or as label of an input value, used to define the operation time for startup costs", "title": "Operation Time" }, "electrical_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Electrical efficiency of the CHP converter", "title": "Electrical Efficiency" }, "electrical_flow": { "description": "Label of the electrical flow for the CHP converter", "title": "Electrical Flow", "type": "string" } }, "$defs": { "FlixOptConverterTypes": { "description": "Types of FlixOpt converters, supported by encodapy FlixOpt model component\nTODO: describe the converter types and add more types if needed", "enum": [ "boiler", "power2heat", "chp", "substation", "bidirectional_substation" ], "title": "FlixOptConverterTypes", "type": "string" }, "FlixOptStatusParameters": { "additionalProperties": false, "description": "Model to define the status parameters of a converter in the flixopt model", "properties": { "min_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum up time of the converter in hours", "title": "Min Up Time" }, "max_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum up time of the converter in hours", "title": "Max Up Time" }, "min_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum down time of the converter in hours", "title": "Min Down Time" }, "max_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum down time of the converter in hours", "title": "Max Down Time" }, "startup_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Startup effects of the converter,\n where the key is the label of the effect \n and the value is the amount of the effect per startup", "title": "Startup Effects" } }, "title": "FlixOptStatusParameters", "type": "object" }, "PowerRange": { "additionalProperties": false, "description": "Model to define the power range of a converter in the flixopt model in percentages", "properties": { "min_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 0, "description": "Minimum power of the converter, default is 0", "title": "Min Power" }, "max_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 100, "description": "Maximum power of the converter, default is 100", "title": "Max Power" } }, "title": "PowerRange", "type": "object" } }, "additionalProperties": false, "required": [ "label", "converter_type", "thermal_efficiency", "input_flow", "thermal_flow", "thermal_nominal_power", "electrical_efficiency", "electrical_flow" ] }
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptConverter[source]
Bases:
BaseModelModel to define a converter in the flixopt model, like it is used in the flixopt library https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Converter/
Show JSON schema
{ "title": "FlixOptConverter", "description": "Model to define a converter in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Converter/", "type": "object", "properties": { "label": { "description": "Label / Name of the converter", "title": "Label", "type": "string" }, "converter_type": { "allOf": [ { "$ref": "#/$defs/FlixOptConverterTypes" } ], "description": "Type of the converter, from the FlixOptConverterTypes enum" }, "thermal_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Thermal efficiency of the converter [0 ... 1]", "title": "Thermal Efficiency" }, "input_flow": { "description": "Label of the fuel flow to the converter", "title": "Input Flow", "type": "string" }, "thermal_flow": { "description": "Label of the thermal flow from the converter", "title": "Thermal Flow", "type": "string" }, "thermal_nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal thermal power of the converter", "title": "Thermal Nominal Power" }, "thermal_power_range": { "allOf": [ { "$ref": "#/$defs/PowerRange" } ], "default": { "min_power": 0.0, "max_power": 100.0 }, "description": "Thermal power range of the boiler converter in percentages" }, "status_parameters": { "allOf": [ { "$ref": "#/$defs/FlixOptStatusParameters" } ], "default": { "min_up_time": null, "max_up_time": null, "min_down_time": null, "max_down_time": null, "startup_effects": null }, "description": "\n Optional status parameters for the converter which includes information \n about startup and shutdown limitations" }, "previous_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Previous power of the converter in kW\n or as label of an input value, used to define the previous flow rate", "title": "Previous Power" }, "operation_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Operation time of the converter in hours\n or as label of an input value, used to define the operation time for startup costs", "title": "Operation Time" } }, "$defs": { "FlixOptConverterTypes": { "description": "Types of FlixOpt converters, supported by encodapy FlixOpt model component\nTODO: describe the converter types and add more types if needed", "enum": [ "boiler", "power2heat", "chp", "substation", "bidirectional_substation" ], "title": "FlixOptConverterTypes", "type": "string" }, "FlixOptStatusParameters": { "additionalProperties": false, "description": "Model to define the status parameters of a converter in the flixopt model", "properties": { "min_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum up time of the converter in hours", "title": "Min Up Time" }, "max_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum up time of the converter in hours", "title": "Max Up Time" }, "min_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum down time of the converter in hours", "title": "Min Down Time" }, "max_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum down time of the converter in hours", "title": "Max Down Time" }, "startup_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Startup effects of the converter,\n where the key is the label of the effect \n and the value is the amount of the effect per startup", "title": "Startup Effects" } }, "title": "FlixOptStatusParameters", "type": "object" }, "PowerRange": { "additionalProperties": false, "description": "Model to define the power range of a converter in the flixopt model in percentages", "properties": { "min_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 0, "description": "Minimum power of the converter, default is 0", "title": "Min Power" }, "max_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 100, "description": "Maximum power of the converter, default is 100", "title": "Max Power" } }, "title": "PowerRange", "type": "object" } }, "additionalProperties": false, "required": [ "label", "converter_type", "thermal_efficiency", "input_flow", "thermal_flow", "thermal_nominal_power" ] }
-
field converter_type:
FlixOptConverterTypes[Required] Type of the converter, from the FlixOptConverterTypes enum
-
field thermal_power_range:
PowerRange= PowerRange(min_power=0, max_power=100) Thermal power range of the boiler converter in percentages
-
field status_parameters:
FlixOptStatusParameters= FlixOptStatusParameters(min_up_time=None, max_up_time=None, min_down_time=None, max_down_time=None, startup_effects=None) Optional status parameters for the converter which includes information about startup and shutdown limitations
-
field converter_type:
- class encodapy.components.flixopt_model_component.flixopt_models.FlixOptConverterTypes(*values)[source]
Bases:
EnumTypes of FlixOpt converters, supported by encodapy FlixOpt model component TODO: describe the converter types and add more types if needed
- BIDIRECTIONAL_SUBSTATION = 'bidirectional_substation'
- BOILER = 'boiler'
- CHP = 'chp'
- POWER2HEAT = 'power2heat'
- SUBSTATION = 'substation'
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptEffect[source]
Bases:
BaseModelModel to define a single effect in the flixopt model, like it is used in the flixopt library https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Effect/
Show JSON schema
{ "title": "FlixOptEffect", "description": "Model to define a single effect in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Effect/", "type": "object", "properties": { "label": { "description": "Label of the effect", "title": "Label", "type": "string" }, "description": { "default": "", "description": "Description of the effect, default is empty string", "title": "Description", "type": "string" }, "unit": { "description": "Unit of the effect", "title": "Unit", "type": "string" }, "objective": { "default": false, "description": "\n Whether the effect is part of the objective function, only one effect can be objective\n ", "title": "Objective", "type": "boolean" } }, "additionalProperties": false, "required": [ "label", "unit" ] }
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptModel[source]
Bases:
BaseModelModel to hold the flixopt Model used in the component
# Specific constraints To add constraints to the FlixOpt model, a Python file or module can be defined in the ‘constraints_function’ field. This needs to include a function called ‘add_constraints(optimization: fx.Optimization, config: FlixOptModel)’ that adds additional constraints to the FlixOpt optimization model. This function is then called in the component after the FlixOpt model has been built. You can add more subfunctions to this function to add constraints.
Show JSON schema
{ "title": "FlixOptModel", "description": "Model to hold the flixopt Model used in the component\n\n# Specific constraints\nTo add constraints to the FlixOpt model, a Python file or module can be defined in the\n'constraints_function' field. This needs to include a function called \n'add_constraints(optimization: fx.Optimization, config: FlixOptModel)' \nthat adds additional constraints to the FlixOpt optimization model.\nThis function is then called in the component after the FlixOpt model has been built.\nYou can add more subfunctions to this function to add constraints.", "type": "object", "properties": { "buses": { "description": "\n List of buses in in the model, which are required to build the flixopt model\n (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Bus/)\n ", "items": { "$ref": "#/$defs/FlixOptBus" }, "title": "Buses", "type": "array" }, "effects": { "description": "\n List of effects in in the model, which are required to build the flixopt optimization model \n (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Effect/)\n ", "items": { "$ref": "#/$defs/FlixOptEffect" }, "title": "Effects", "type": "array" }, "converters": { "description": "\n List of converters in in the model, which are required to build the flixopt model\n (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Converter/)\n ", "items": { "anyOf": [ { "$ref": "#/$defs/FlixOptConverter" }, { "$ref": "#/$defs/FlixOptCHPConverter" } ] }, "title": "Converters", "type": "array" }, "exchangers": { "description": "\n List of sinks and sources in in the model, which are required to build the flixopt model\n ", "items": { "$ref": "#/$defs/FlixOptSinkSource" }, "title": "Exchangers", "type": "array" }, "storages": { "description": "\n List of storages in in the model, which are required to build the flixopt model \n (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Storage/)\n ", "items": { "$ref": "#/$defs/FlixOptStorage" }, "title": "Storages", "type": "array" }, "manual_elements_function": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Path to a python file or python module which includes a function `add_elements`\n used to add additional elements to the flixopt optimization model.\n\n The function needs to return a list of flixopt components which should be added to the model.\n\n For an example for such a function, see `add_elements.py` in the same folder as this file.\n ", "title": "Manual Elements Function" }, "constraints_function": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Path to a python file or python module which includes a function `add_constraints`\n used to add additional constraints to the flixopt optimization model\n \n The function needs to have the following signature: `add_constraints(optimization:\n fx.Optimization, config: FlixOptModel)` and needs to add constraints to the optimization\n model based on the configuration of the FlixOptModel.\n \n For an example for such a function, see `add_constraints.py`\n in the same folder as this file.\n ", "title": "Constraints Function" } }, "$defs": { "EnergyDirection": { "description": "Enum to define the energy direction for a sink or source in the flixopt model", "enum": [ "sink", "source", "bidirectional" ], "title": "EnergyDirection", "type": "string" }, "FlixOptBus": { "additionalProperties": false, "description": "Model to define a flow in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Bus/", "properties": { "label": { "description": "Label of the flow", "title": "Label", "type": "string" }, "penalty": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Penalty cost for the flow", "title": "Penalty" } }, "required": [ "label" ], "title": "FlixOptBus", "type": "object" }, "FlixOptCHPConverter": { "additionalProperties": false, "description": "Model to define a CHP converter in the flixopt model, \nwhich inherits from the FlixOptConverter model\nand adds specific parameters for the CHP converter type\n\nKeep in mind, the `nominal_power` parameter in the FlixOptConverter model is the \nnominal thermal power of the CHP converter, while the nominal electrical power can be \ncalculated from the thermal efficiency and the electrical efficiency of the CHP converter.", "properties": { "label": { "description": "Label / Name of the converter", "title": "Label", "type": "string" }, "converter_type": { "allOf": [ { "$ref": "#/$defs/FlixOptConverterTypes" } ], "description": "Type of the converter, from the FlixOptConverterTypes enum" }, "thermal_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Thermal efficiency of the converter [0 ... 1]", "title": "Thermal Efficiency" }, "input_flow": { "description": "Label of the fuel flow to the converter", "title": "Input Flow", "type": "string" }, "thermal_flow": { "description": "Label of the thermal flow from the converter", "title": "Thermal Flow", "type": "string" }, "thermal_nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal thermal power of the converter", "title": "Thermal Nominal Power" }, "thermal_power_range": { "allOf": [ { "$ref": "#/$defs/PowerRange" } ], "default": { "min_power": 0.0, "max_power": 100.0 }, "description": "Thermal power range of the boiler converter in percentages" }, "status_parameters": { "allOf": [ { "$ref": "#/$defs/FlixOptStatusParameters" } ], "default": { "min_up_time": null, "max_up_time": null, "min_down_time": null, "max_down_time": null, "startup_effects": null }, "description": "\n Optional status parameters for the converter which includes information \n about startup and shutdown limitations" }, "previous_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Previous power of the converter in kW\n or as label of an input value, used to define the previous flow rate", "title": "Previous Power" }, "operation_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Operation time of the converter in hours\n or as label of an input value, used to define the operation time for startup costs", "title": "Operation Time" }, "electrical_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Electrical efficiency of the CHP converter", "title": "Electrical Efficiency" }, "electrical_flow": { "description": "Label of the electrical flow for the CHP converter", "title": "Electrical Flow", "type": "string" } }, "required": [ "label", "converter_type", "thermal_efficiency", "input_flow", "thermal_flow", "thermal_nominal_power", "electrical_efficiency", "electrical_flow" ], "title": "FlixOptCHPConverter", "type": "object" }, "FlixOptConverter": { "additionalProperties": false, "description": "Model to define a converter in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Converter/", "properties": { "label": { "description": "Label / Name of the converter", "title": "Label", "type": "string" }, "converter_type": { "allOf": [ { "$ref": "#/$defs/FlixOptConverterTypes" } ], "description": "Type of the converter, from the FlixOptConverterTypes enum" }, "thermal_efficiency": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Thermal efficiency of the converter [0 ... 1]", "title": "Thermal Efficiency" }, "input_flow": { "description": "Label of the fuel flow to the converter", "title": "Input Flow", "type": "string" }, "thermal_flow": { "description": "Label of the thermal flow from the converter", "title": "Thermal Flow", "type": "string" }, "thermal_nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal thermal power of the converter", "title": "Thermal Nominal Power" }, "thermal_power_range": { "allOf": [ { "$ref": "#/$defs/PowerRange" } ], "default": { "min_power": 0.0, "max_power": 100.0 }, "description": "Thermal power range of the boiler converter in percentages" }, "status_parameters": { "allOf": [ { "$ref": "#/$defs/FlixOptStatusParameters" } ], "default": { "min_up_time": null, "max_up_time": null, "min_down_time": null, "max_down_time": null, "startup_effects": null }, "description": "\n Optional status parameters for the converter which includes information \n about startup and shutdown limitations" }, "previous_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Previous power of the converter in kW\n or as label of an input value, used to define the previous flow rate", "title": "Previous Power" }, "operation_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Operation time of the converter in hours\n or as label of an input value, used to define the operation time for startup costs", "title": "Operation Time" } }, "required": [ "label", "converter_type", "thermal_efficiency", "input_flow", "thermal_flow", "thermal_nominal_power" ], "title": "FlixOptConverter", "type": "object" }, "FlixOptConverterTypes": { "description": "Types of FlixOpt converters, supported by encodapy FlixOpt model component\nTODO: describe the converter types and add more types if needed", "enum": [ "boiler", "power2heat", "chp", "substation", "bidirectional_substation" ], "title": "FlixOptConverterTypes", "type": "string" }, "FlixOptEffect": { "additionalProperties": false, "description": "Model to define a single effect in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Effect/", "properties": { "label": { "description": "Label of the effect", "title": "Label", "type": "string" }, "description": { "default": "", "description": "Description of the effect, default is empty string", "title": "Description", "type": "string" }, "unit": { "description": "Unit of the effect", "title": "Unit", "type": "string" }, "objective": { "default": false, "description": "\n Whether the effect is part of the objective function, only one effect can be objective\n ", "title": "Objective", "type": "boolean" } }, "required": [ "label", "unit" ], "title": "FlixOptEffect", "type": "object" }, "FlixOptSinkSource": { "additionalProperties": false, "description": "Model to define a sink or source in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Element/", "properties": { "label": { "description": "Label of the sink/source", "title": "Label", "type": "string" }, "direction": { "allOf": [ { "$ref": "#/$defs/EnergyDirection" } ], "description": "Direction of the energy flow, either 'sink', 'source' or 'bidirectional'" }, "nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Nominal power of the sink/source in kW, only required for sources", "title": "Nominal Power" }, "input_bus": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Label of the flow for the sink, for the source with an input flow", "title": "Input Bus" }, "input_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the input time series for the sink (heat demand ...), \n if the sink has a time series input", "title": "Input Label" }, "input_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "\n Optional dictionary to define the effect of the sink\n on the defined effects in the model, where the key is the label of the effect\n and the value is the amount of the effect per kWh of energy flow\n\n Only used, if input_label is None and the input bus is defined.\n\n Example::\n\n {\n \"costs\": 0.15\n }\n\n The value can also be defined as a label of an input value, which is then used to read the effect from the input data \n (for timeseries or a variable value).\n ", "title": "Input Effects" }, "output_bus": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the output flow for the source, only required for source with an output flow\n ", "title": "Output Bus" }, "output_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the output time series for the source, if the source has a time series output", "title": "Output Label" }, "output_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "\n Optional dictionary to define the effect of the source\n on the defined effects in the model, where the key is the label of the effect\n and the value is the amount of the effect per kWh of energy flow\n\n Only used, if output_label is None and the output bus is defined.\n\n Example::\n\n {\n \"costs\": 0.15\n }\n\n The value can also be defined as a label of an input value, which is then used to read the effect from the input data \n (for timeseries or a variable value).\n ", "title": "Output Effects" } }, "required": [ "label", "direction" ], "title": "FlixOptSinkSource", "type": "object" }, "FlixOptStatusParameters": { "additionalProperties": false, "description": "Model to define the status parameters of a converter in the flixopt model", "properties": { "min_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum up time of the converter in hours", "title": "Min Up Time" }, "max_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum up time of the converter in hours", "title": "Max Up Time" }, "min_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum down time of the converter in hours", "title": "Min Down Time" }, "max_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum down time of the converter in hours", "title": "Max Down Time" }, "startup_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Startup effects of the converter,\n where the key is the label of the effect \n and the value is the amount of the effect per startup", "title": "Startup Effects" } }, "title": "FlixOptStatusParameters", "type": "object" }, "FlixOptStorage": { "additionalProperties": false, "description": "Model to define a storage in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Storage/", "properties": { "label": { "title": "Label", "type": "string" }, "bus": { "description": "Label of the flow for the storage", "title": "Bus", "type": "string" }, "nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal power of the storage in kW", "title": "Nominal Power" }, "nominal_capacity": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "description": "Nominal capacity of the storage in kWh\n or as label of an input value, which is then used to read the nominal capacity", "title": "Nominal Capacity" }, "relative_self_discharge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 0.0, "description": "Relative self-discharge of the storage in percentage per hour", "title": "Relative Self Discharge" }, "eta_charge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 100.0, "description": "Charging efficiency of the storage in percentage", "title": "Eta Charge" }, "eta_discharge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 100.0, "description": "Discharging efficiency of the storage in percentage", "title": "Eta Discharge" }, "start_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 0, "description": "\n Starting state of charge (SOC) of the storage at the beginning of the optimization period,\n can be defined as a percentage of the nominal capacity (e.g. 50) or as an label\n of a input value (e.g. `initial_soc`) which is then used to read the starting SOC \n from the input data and is required there in Percentage of the nominal capacity as well\n ", "title": "Start Soc" }, "minimal_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 0, "description": "\n Minimal state of charge (SOC) of the storage in percentage of the nominal capacity\n Defined via number or as label of an input value,\n which is then used to read the minimal SOC from the input data", "title": "Minimal Soc" }, "maximal_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 100, "description": "\n Maximal state of charge (SOC) of the storage in percentage of the nominal capacity\n Defined via number or as label of an input value,\n which is then used to read the maximal SOC from the input data", "title": "Maximal Soc" }, "final_soc_percentage": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 50.0, "description": "Percentage of the start_soc which should be reached at the end\n of the optimization period, used to define the required final SOC at the end\n of the optimization period (final_soc = start_soc * final_soc_percentage / 100)", "title": "Final Soc Percentage" } }, "required": [ "label", "bus", "nominal_power", "nominal_capacity" ], "title": "FlixOptStorage", "type": "object" }, "PowerRange": { "additionalProperties": false, "description": "Model to define the power range of a converter in the flixopt model in percentages", "properties": { "min_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 0, "description": "Minimum power of the converter, default is 0", "title": "Min Power" }, "max_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 100, "description": "Maximum power of the converter, default is 100", "title": "Max Power" } }, "title": "PowerRange", "type": "object" } }, "additionalProperties": true, "required": [ "buses", "effects", "converters", "exchangers", "storages" ] }
-
field buses:
list[FlixOptBus] [Required] List of buses in in the model, which are required to build the flixopt model (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Bus/)
-
field effects:
list[FlixOptEffect] [Required] List of effects in in the model, which are required to build the flixopt optimization model (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Effect/)
-
field converters:
list[FlixOptConverter|FlixOptCHPConverter] [Required] List of converters in in the model, which are required to build the flixopt model (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Converter/)
-
field exchangers:
list[FlixOptSinkSource] [Required] List of sinks and sources in in the model, which are required to build the flixopt model
-
field storages:
list[FlixOptStorage] [Required] List of storages in in the model, which are required to build the flixopt model (https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Storage/)
-
field manual_elements_function:
Optional[str] = None Path to a python file or python module which includes a function add_elements used to add additional elements to the flixopt optimization model.
The function needs to return a list of flixopt components which should be added to the model.
For an example for such a function, see add_elements.py in the same folder as this file.
-
field constraints_function:
Optional[str] = None Path to a python file or python module which includes a function add_constraints used to add additional constraints to the flixopt optimization model
The function needs to have the following signature: add_constraints(optimization: fx.Optimization, config: FlixOptModel) and needs to add constraints to the optimization model based on the configuration of the FlixOptModel.
For an example for such a function, see add_constraints.py in the same folder as this file.
-
field buses:
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptSinkSource[source]
Bases:
BaseModelModel to define a sink or source in the flixopt model, like it is used in the flixopt library https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Element/
Show JSON schema
{ "title": "FlixOptSinkSource", "description": "Model to define a sink or source in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Element/", "type": "object", "properties": { "label": { "description": "Label of the sink/source", "title": "Label", "type": "string" }, "direction": { "allOf": [ { "$ref": "#/$defs/EnergyDirection" } ], "description": "Direction of the energy flow, either 'sink', 'source' or 'bidirectional'" }, "nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Nominal power of the sink/source in kW, only required for sources", "title": "Nominal Power" }, "input_bus": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Label of the flow for the sink, for the source with an input flow", "title": "Input Bus" }, "input_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the input time series for the sink (heat demand ...), \n if the sink has a time series input", "title": "Input Label" }, "input_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "\n Optional dictionary to define the effect of the sink\n on the defined effects in the model, where the key is the label of the effect\n and the value is the amount of the effect per kWh of energy flow\n\n Only used, if input_label is None and the input bus is defined.\n\n Example::\n\n {\n \"costs\": 0.15\n }\n\n The value can also be defined as a label of an input value, which is then used to read the effect from the input data \n (for timeseries or a variable value).\n ", "title": "Input Effects" }, "output_bus": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the output flow for the source, only required for source with an output flow\n ", "title": "Output Bus" }, "output_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\n Label of the output time series for the source, if the source has a time series output", "title": "Output Label" }, "output_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "\n Optional dictionary to define the effect of the source\n on the defined effects in the model, where the key is the label of the effect\n and the value is the amount of the effect per kWh of energy flow\n\n Only used, if output_label is None and the output bus is defined.\n\n Example::\n\n {\n \"costs\": 0.15\n }\n\n The value can also be defined as a label of an input value, which is then used to read the effect from the input data \n (for timeseries or a variable value).\n ", "title": "Output Effects" } }, "$defs": { "EnergyDirection": { "description": "Enum to define the energy direction for a sink or source in the flixopt model", "enum": [ "sink", "source", "bidirectional" ], "title": "EnergyDirection", "type": "string" } }, "additionalProperties": false, "required": [ "label", "direction" ] }
-
field direction:
EnergyDirection[Required] Direction of the energy flow, either ‘sink’, ‘source’ or ‘bidirectional’
-
field nominal_power:
Optional[Union[float,int]] = None Nominal power of the sink/source in kW, only required for sources
-
field input_bus:
Optional[str] = None Label of the flow for the sink, for the source with an input flow
-
field input_label:
Optional[str] = None Label of the input time series for the sink (heat demand …), if the sink has a time series input
-
field input_effects:
Optional[dict[str,float|int|str]] = None Optional dictionary to define the effect of the sink on the defined effects in the model, where the key is the label of the effect and the value is the amount of the effect per kWh of energy flow
Only used, if input_label is None and the input bus is defined.
Example:
{ "costs": 0.15 }
- The value can also be defined as a label of an input value, which is then used to read the effect from the input data
(for timeseries or a variable value).
-
field output_bus:
Optional[str] = None Label of the output flow for the source, only required for source with an output flow
-
field output_label:
Optional[str] = None Label of the output time series for the source, if the source has a time series output
-
field output_effects:
Optional[dict[str,float|int|str]] = None Optional dictionary to define the effect of the source on the defined effects in the model, where the key is the label of the effect and the value is the amount of the effect per kWh of energy flow
Only used, if output_label is None and the output bus is defined.
Example:
{ "costs": 0.15 }
- The value can also be defined as a label of an input value, which is then used to read the effect from the input data
(for timeseries or a variable value).
-
field direction:
- class encodapy.components.flixopt_model_component.flixopt_models.FlixOptSolverName(*values)[source]
Bases:
EnumNames of the available Flixopt solvers
See flixopt.solvers for available solvers
- GUROBI = 'GurobiSolver'
- HIGHS = 'HighsSolver'
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptStatusParameters[source]
Bases:
BaseModelModel to define the status parameters of a converter in the flixopt model
Show JSON schema
{ "title": "FlixOptStatusParameters", "description": "Model to define the status parameters of a converter in the flixopt model", "type": "object", "properties": { "min_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum up time of the converter in hours", "title": "Min Up Time" }, "max_up_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum up time of the converter in hours", "title": "Max Up Time" }, "min_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Minimum down time of the converter in hours", "title": "Min Down Time" }, "max_down_time": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Maximum down time of the converter in hours", "title": "Max Down Time" }, "startup_effects": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "integer" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Startup effects of the converter,\n where the key is the label of the effect \n and the value is the amount of the effect per startup", "title": "Startup Effects" } }, "additionalProperties": false }
-
field min_down_time:
Optional[Union[float,int]] = None Minimum down time of the converter in hours
-
field min_down_time:
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixOptStorage[source]
Bases:
BaseModelModel to define a storage in the flixopt model, like it is used in the flixopt library https://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Storage/
Show JSON schema
{ "title": "FlixOptStorage", "description": "Model to define a storage in the flixopt model, like it is used in the flixopt library\nhttps://flixopt.github.io/flixopt/latest/user-guide/mathematical-notation/elements/Storage/", "type": "object", "properties": { "label": { "title": "Label", "type": "string" }, "bus": { "description": "Label of the flow for the storage", "title": "Bus", "type": "string" }, "nominal_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "description": "Nominal power of the storage in kW", "title": "Nominal Power" }, "nominal_capacity": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "description": "Nominal capacity of the storage in kWh\n or as label of an input value, which is then used to read the nominal capacity", "title": "Nominal Capacity" }, "relative_self_discharge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 0.0, "description": "Relative self-discharge of the storage in percentage per hour", "title": "Relative Self Discharge" }, "eta_charge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 100.0, "description": "Charging efficiency of the storage in percentage", "title": "Eta Charge" }, "eta_discharge": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "null" } ], "default": 100.0, "description": "Discharging efficiency of the storage in percentage", "title": "Eta Discharge" }, "start_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 0, "description": "\n Starting state of charge (SOC) of the storage at the beginning of the optimization period,\n can be defined as a percentage of the nominal capacity (e.g. 50) or as an label\n of a input value (e.g. `initial_soc`) which is then used to read the starting SOC \n from the input data and is required there in Percentage of the nominal capacity as well\n ", "title": "Start Soc" }, "minimal_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 0, "description": "\n Minimal state of charge (SOC) of the storage in percentage of the nominal capacity\n Defined via number or as label of an input value,\n which is then used to read the minimal SOC from the input data", "title": "Minimal Soc" }, "maximal_soc": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "string" } ], "default": 100, "description": "\n Maximal state of charge (SOC) of the storage in percentage of the nominal capacity\n Defined via number or as label of an input value,\n which is then used to read the maximal SOC from the input data", "title": "Maximal Soc" }, "final_soc_percentage": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 50.0, "description": "Percentage of the start_soc which should be reached at the end\n of the optimization period, used to define the required final SOC at the end\n of the optimization period (final_soc = start_soc * final_soc_percentage / 100)", "title": "Final Soc Percentage" } }, "additionalProperties": false, "required": [ "label", "bus", "nominal_power", "nominal_capacity" ] }
-
field nominal_capacity:
float|int|str[Required] Nominal capacity of the storage in kWh or as label of an input value, which is then used to read the nominal capacity
-
field relative_self_discharge:
Optional[Union[float,int]] = 0.0 Relative self-discharge of the storage in percentage per hour
-
field eta_charge:
Optional[Union[float,int]] = 100.0 Charging efficiency of the storage in percentage
-
field eta_discharge:
Optional[Union[float,int]] = 100.0 Discharging efficiency of the storage in percentage
-
field start_soc:
float|int|str= 0 Starting state of charge (SOC) of the storage at the beginning of the optimization period, can be defined as a percentage of the nominal capacity (e.g. 50) or as an label of a input value (e.g. initial_soc) which is then used to read the starting SOC from the input data and is required there in Percentage of the nominal capacity as well
-
field minimal_soc:
float|int|str= 0 Minimal state of charge (SOC) of the storage in percentage of the nominal capacity Defined via number or as label of an input value, which is then used to read the minimal SOC from the input data
-
field nominal_capacity:
- class encodapy.components.flixopt_model_component.flixopt_models.FlixoptLogLevel(*values)[source]
Bases:
EnumLog-Levels from flixopt configuration - see: flixopt.CONFIG
FLIXOPT_CONFIG_MAP is used to map the enum values to the actual flixopt configuration functions
- DEBUG = 'debug'
- EXPLORING = 'exploring'
- PRODUCTION = 'production'
- SILENT = 'silent'
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.FlixoptSolverSettings[source]
Bases:
BaseModelBase model for Flixopt solver settings. Only non-None values override the flixopt defaults.
Show JSON schema
{ "title": "FlixoptSolverSettings", "description": "Base model for Flixopt solver settings.\nOnly non-None values override the flixopt defaults.", "type": "object", "properties": { "name": { "allOf": [ { "$ref": "#/$defs/FlixOptSolverName" } ], "description": "Name of the solver (e.g. 'HighsSolver' or 'GurobiSolver')" }, "mip_rel_gap": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional relative optimality gap in [0.0, 1.0]", "title": "Mip Rel Gap" }, "time_limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional time limit in seconds", "title": "Time Limit" }, "threads": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional solver thread limit", "title": "Threads" }, "mip_focus": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional MIP search focus (solver-specific)", "title": "Mip Focus" }, "heuristics": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Optional heuristic intensity (solver-specific)", "title": "Heuristics" }, "presolve": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional presolve level (solver-specific)", "title": "Presolve" }, "cuts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Optional cut generation level (solver-specific)", "title": "Cuts" }, "additional_options": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "number" }, { "type": "string" }, { "type": "boolean" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "description": "Optional additional solver options forwarded directly to the selected flixopt solver constructor.", "title": "Additional Options" } }, "$defs": { "FlixOptSolverName": { "description": "Names of the available Flixopt solvers\n\nSee flixopt.solvers for available solvers", "enum": [ "GurobiSolver", "HighsSolver" ], "title": "FlixOptSolverName", "type": "string" } }, "additionalProperties": false, "required": [ "name" ] }
-
field name:
FlixOptSolverName[Required] Name of the solver (e.g. ‘HighsSolver’ or ‘GurobiSolver’)
-
field name:
- pydantic model encodapy.components.flixopt_model_component.flixopt_models.PowerRange[source]
Bases:
BaseModelModel to define the power range of a converter in the flixopt model in percentages
Show JSON schema
{ "title": "PowerRange", "description": "Model to define the power range of a converter in the flixopt model in percentages", "type": "object", "properties": { "min_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 0, "description": "Minimum power of the converter, default is 0", "title": "Min Power" }, "max_power": { "anyOf": [ { "type": "number" }, { "type": "integer" } ], "default": 100, "description": "Maximum power of the converter, default is 100", "title": "Max Power" } }, "additionalProperties": false }