Electric Heating
Contents
Overview | Asset Structure | Flow Equations | Input File (Standard Format) | Types - Asset Structure | Constructors | Examples | Best Practices | Input File (Advanced Format)
Overview
Electric Heating assets in MacroEnergy.jl represent resistive or heat pump–based systems that convert electricity into heat for district or building heating applications. These assets can represent electric boilers, heat pumps, or other electrical heating devices supplying district or building heating networks. They are defined using either JSON or CSV input files placed in the assets directory, typically named with descriptive identifiers like electric_heating.json.
Asset Structure
An electric heating asset consists of three main components:
- Transformation Component: Balances the electricity and heat flows
- Electricity Edge: Represents the electricity supply to the heating unit
- Heat Edge: Represents the heat production (can have unit commitment operations)
Here is a graphical representation of the electric heating asset:
Flow Equations
The electric heating asset follows these stoichiometric relationships:
\[\begin{aligned} \phi_{elec} &= \phi_{heat} \cdot \epsilon_{elec\_consumption} \\ \end{aligned}\]
Where:
- $\phi$ represents the flow of each commodity
- $\epsilon$ represents the stoichiometric coefficients defined in the Conversion Process Parameters section.
Input File (Standard Format)
Techno-economic analysis background is recommended for updating or adding conversion process parameters. For users not familiar with TEA, they can refer to this guide.
The easiest way to include a electric heating asset in a model is to create a new file (either JSON or CSV) and place it in the assets directory together with the other assets.
your_case/
├── assets/
│ ├── electric_heating.json # or electric_heating.csv
│ ├── other_assets.json
│ └── ...
├── system/
├── settings/
└── ...This file can either be created manually, or using the template_asset function, as shown in the Adding an Asset to a System section of the User Guide. The file will be automatically loaded when you run your Macro model.
The following is an example of a electric heating asset input file:
{
"ElectricHeating": [
{
"type": "ElectricHeating",
"instance_data": [
{
"id": "SE_electric_boiler_1",
"location": "SE",
"timedata": "Electricity",
"capacity_size": 50,
"elec_consumption": 1.0,
"investment_cost": 20000,
"fixed_om_cost": 1200,
"variable_om_cost": 2.0,
"ramp_up_fraction": 0.8,
"ramp_down_fraction": 0.8
}
]
}
]
}
When working with JSON input files, the global_data field can be used to group data that is common to all instances of the same asset type. This is useful for setting constraints that are common to all instances of the same asset type and avoid repeating the same data for each instance. See the Examples section below for an example.
The following tables outline the attributes that can be set for a electric heating asset.
Essential Attributes
| Field | Type | Description |
|---|---|---|
Type | String | Asset type identifier: "electricheating" |
id | String | Unique identifier for the heating unit instance |
location | String | Geographic location/node identifier |
elec_commodity | String | Electricity commodity identifier |
uc | Boolean | Whether unit commitment is enabled (default: false) |
timedata | String | Time resolution for time series data (default: "Heat") |
elec_start_vertex | String | Electricity start vertex identifier. This is not required if the elec commodity is present in the location. |
Conversion Process Parameters
The following set of parameters control the conversion process and stoichiometry of the electric heating asset (see Flow Equations for more details).
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
elec_consumption | Float64 | Electricity consumption rate | $MWh_{electricity}/MWh_{heat}$ | 1.0 |
Constraints Configuration
Electric Heating assets can have different constraints applied to them, and the user can configure them using the following fields:
| Field | Type | Description |
|---|---|---|
transform_constraints | Dict{String,Bool} | List of constraints applied to the transformation component. |
heat_constraints | Dict{String,Bool} | List of constraints applied to the heat edge. |
elec_constraints | Dict{String,Bool} | List of constraints applied to the electricity edge. |
For example, if the user wants to apply the BalanceConstraint to the transformation component and the CapacityConstraint to the heat edge, the constraints fields should be set as follows:
{
"transform_constraints": {
"BalanceConstraint": true
},
"heat_constraints": {
"CapacityConstraint": true
}
}Users can refer to the Adding Asset Constraints to a System section of the User Guide for a list of all the constraints that can be applied to the different components of a electric heating asset.
Default constraints
To simplify the input file and the asset configuration, the following constraints are applied to the electric heating asset by default:
- Balance constraint (applied to the transformation component)
- Capacity constraint (applied to the heat edge)
- Ramping limits constraint (applied to the heat edge)
Unit commitment constraints (when uc is set to true):
- Minimum up and down time constraint (applied to the heat edge)
Investment Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
can_retire | Boolean | Whether capacity can be retired | - | true |
can_expand | Boolean | Whether capacity can be expanded | - | true |
existing_capacity | Float64 | Initial installed capacity | MW | 0.0 |
capacity_size | Float64 | Unit size for capacity decisions | - | 1.0 |
Additional Investment Parameters
Maximum and minimum capacity constraints
If MaxCapacityConstraint or MinCapacityConstraint are added to the constraints dictionary for the heat edge, the following parameters are used by Macro:
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
max_capacity | Float64 | Maximum allowed capacity | MW | Inf |
min_capacity | Float64 | Minimum allowed capacity | MW | 0.0 |
Economic Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
investment_cost | Float64 | CAPEX per unit capacity | $/MW | 0.0 |
annualized_investment_cost | Union{Nothing,Float64} | Annualized CAPEX | $/MW/yr | calculated |
fixed_om_cost | Float64 | Fixed O&M costs | $/MW/yr | 0.0 |
variable_om_cost | Float64 | Variable O&M costs | $/MWh | 0.0 |
startup_cost | Float64 | Cost per MW of capacity to start a generator | $/MW per start | 0.0 |
wacc | Float64 | Weighted average cost of capital | fraction | 0.0 |
lifetime | Int | Asset lifetime in years | years | 1 |
capital_recovery_period | Int | Investment recovery period | years | 1 |
retirement_period | Int | Retirement period | years | 0 |
Operational Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
availability | Dict | Availability file path and header | - | Empty |
Additional Operational Parameters
Unit commitment parameters (when uc is set to true)
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
startup_elec_consumption | Float64 | Electricity consumption per unit heat to start the plant | $MWh_{electricity}/MWh_{elec}$ | 0.0 |
Minimum flow constraint
If MinFlowConstraint is added to the constraints dictionary for the heat edge, the following parameter is used:
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
min_flow_fraction | Float64 | Minimum flow as fraction of capacity | fraction | 0.0 |
Ramping limit constraint
If RampingLimitConstraint is added to the constraints dictionary for the heat edge, the following parameters are used:
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
ramp_up_fraction | Float64 | Maximum increase in flow between timesteps | fraction | 1.0 |
ramp_down_fraction | Float64 | Maximum decrease in flow between timesteps | fraction | 1.0 |
Minimum up and down time constraints
If MinUpTimeConstraint or MinDownTimeConstraint are added to the constraints dictionary for the heat edge, the following parameters are used:
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
min_up_time | Int64 | Minimum time the plant must remain committed | hours | 0 |
min_down_time | Int64 | Minimum time the plant must remain shutdown | hours | 0 |
Types - Asset Structure
The electricheating asset is defined as follows:
struct electricheating{T} <: AbstractAsset
id::AssetId
heating_transform::Transformation
heat_edge::Union{Edge{<:Heat},EdgeWithUC{<:Heat}}
elec_edge::Edge{<:T}
endConstructors
Default constructor
electricheating(id::AssetId, heating_transform::Transformation, heat_edge::Union{Edge{<:Heat},EdgeWithUC{<:Heat}}, elec_edge::Edge{<:Electricity})Factory constructor
make(asset_type::Type{electricheating}, data::AbstractDict{Symbol,Any}, system::System)| Field | Type | Description |
|---|---|---|
asset_type | Type{electricheating} | Macro type of the asset |
data | AbstractDict{Symbol,Any} | Dictionary containing the input data for the asset |
system | System | System to which the asset belongs |
Examples
This section contains examples of how to use the electric heating asset in a Macro model.
Example of electric heat pump
This example shows an electric heat pump. The asset has no capacity and can be expanded. The asset has an availability time series loaded from a CSV file.
JSON Format:
Note that the global_data field is used to set the fields and constraints that are common to all instances of the same asset type.
{
"ElectricHeatPump": [
{
"type": "ElectricHeating",
"instance_data": [
{
"id": "SE_electric_heating_1",
"location": "SE",
"timedata": "Electricity",
"elec_commodity": "Electricity",
"elec_start_vertex": "elec_SE",
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"capacity_size": 50.0,
"elec_consumption": 1.2,
"fixed_om_cost": 6000,
"variable_om_cost": 5.0
}
]
}
]
}
CSV Format:
| Type | id | location | time_data | electricity_commodity | electricity_start_vertex | can_retire | can_expand | existing_capacity | capacity_size | heat_constraints–MinFlowConstraint | electricity_consumption | fixed_om_cost | variable_om_cost |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ElectricHeating | SE_electric_heating_1 | SE | Electricity | Electricity | elec_source | true | true | 0.0 | 50.0 | true | 1.2 | 6000 | 5.0 |
Multiple Electric Heating Units in Different Zones
This example shows three electric heating units. Each asset has no capacity and can be expanded. The assets are configured without unit commitment variables.
JSON Format:
{
"ElectricHeating": [
{
"type": "ElectricHeating",
"global_data": {
"timedata": "Electricity",
"elec_commodity": "Electricity",
"heat_constraints": {
"MinFlowConstraint": true
}
},
"instance_data": [
{
"id": "MIDAT_electric_heating_1",
"location": "MIDAT",
"elec_consumption": 1.85,
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 8000,
"variable_om_cost": 4.5,
"capacity_size": 100.0
},
{
"id": "NE_electric_heating_1",
"location": "NE",
"elec_consumption": 1.90,
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 8200,
"variable_om_cost": 4.7,
"capacity_size": 120.0
},
{
"id": "SE_electric_heating_1",
"location": "SE",
"elec_consumption": 1.75,
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 7000,
"variable_om_cost": 3.9,
"capacity_size": 500.0
}
]
}
]
}CSV Format:
| Type | id | location | time_data | electricity_commodity | can_retire | can_expand | existing_capacity | capacity_size | heat_constraints–MinFlowConstraint | electricity_consumption | fixed_om_cost | variable_om_cost |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ElectricHeating | MIDAT_electric_heating_1 | MIDAT | Electricity | Electricity | true | true | 0.0 | 100.0 | true | 1.85 | 8000 | 4.5 |
| ElectricHeating | NE_electric_heating_1 | NE | Electricity | Electricity | true | true | 0.0 | 120.0 | true | 1.90 | 8200 | 4.7 |
| ElectricHeating | SE_electric_heating_1 | SE | Electricity | Electricity | true | true | 0.0 | 500.0 | true | 1.75 | 7000 | 3.9 |
Best Practices
- Use global data for common parameters: Use the
global_datafield to set the fields and constraints that are common to all instances of the same asset type. - Set realistic efficiency parameters: Ensure electricity consumption are accurate for the technology being modeled
- Use meaningful IDs: Choose descriptive identifiers that indicate location and technology type
- Consider unit commitment carefully: Enable unit commitment only when detailed operational modeling is needed
- Use constraints selectively: Only enable constraints that are necessary for your modeling needs
- Validate costs: Ensure investment and O&M costs are in appropriate units and time periods
- Test configurations: Start with simple configurations and gradually add complexity
- Set appropriate ramp rates: Consider the actual operational characteristics of the technology
Input File (Advanced Format)
Macro provides an advanced format for defining electric heating assets, offering users and modelers detailed control over asset specifications. This format builds upon the standard format and is ideal for those who need more comprehensive customization.
To understand the advanced format, consider the graph representation and the type definition of a electric heating asset. The input file mirrors this hierarchical structure.
A electric heating asset in Macro is composed of a transformation component, represented by a Transformation object, and multiple edges (electricity, heat), each represented by an Edge object. The input file for a electric heating asset is therefore organized as follows:
{
"transforms":{
// ... transformation-specific attributes ...
},
"edges":{
"elec_edge": {
// ... elec_edge-specific attributes ...
},
"heat_edge": {
// ... heat_edge-specific attributes ...
}
}
}Each top-level key (e.g., "transforms" or "edges") denotes a component type. The second-level keys either specify the attributes of the component (when there is a single instance) or identify the instances of the component when there are multiple instances.
Below is an example of an input file for a electric heating asset that sets up multiple electric heating plants across different regions:
{
"ElectricHeating": [
{
"type": "electricheating",
"global_data": {
"transforms": {
"timedata": "Electricity",
"constraints": {
"BalanceConstraint": true
}
},
"edges": {
"heat_edge": {
"commodity": "Heat",
"unidirectional": true,
"has_capacity": true,
"constraints": {
"CapacityConstraint": true,
"RampingLimitConstraint": true,
"MinFlowConstraint": true
}
},
"elec_edge": {
"commodity": "Electricity",
"unidirectional": true,
"has_capacity": false
}
}
},
"instance_data": [
{
"id": "MIDAT_electric_heating_1",
"transforms": {
"elec_consumption": 1.85,
},
"edges": {
"heat_edge": {
"end_vertex": "heat_MIDAT",
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 8000,
"variable_om_cost": 4.5,
"capacity_size": 100.0
},
"elec_edge": {
"start_vertex": "elec_MIDAT"
}
}
},
{
"id": "NE_electric_heating_1",
"transforms": {
"elec_consumption": 1.90,
},
"edges": {
"heat_edge": {
"end_vertex": "heat_NE",
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 8200,
"variable_om_cost": 4.7,
"capacity_size": 120.0
},
"elec_edge": {
"start_vertex": "elec_NE"
}
}
},
{
"id": "SE_electric_heating_1",
"transforms": {
"elec_consumption": 1.75,
},
"edges": {
"heat_edge": {
"end_vertex": "heat_SE",
"can_retire": true,
"can_expand": true,
"existing_capacity": 0,
"investment_cost": 0.0,
"fixed_om_cost": 7000,
"variable_om_cost": 3.9,
"capacity_size": 500.0
},
"elec_edge": {
"start_vertex": "elec_SE"
}
}
}
]
}
]
}Key Points
- The
global_datafield is utilized to define attributes and constraints that apply universally to all instances of a particular asset type. - The
start_vertexandend_vertexfields indicate the nodes to which the edges are connected. These nodes must be defined in thenodes.jsonfile. - By default, only the heat edge is allowed to expand as a modeling decision (see note below)
- The heat edge can have unit commitment operations enabled by setting the
ucattribute totrue. - For a comprehensive list of attributes that can be configured for the transformation and edge components, refer to the transformation and edges pages of the Macro manual.
The has_capacity attribute is a flag that indicates whether a specific edge of an asset has a capacity variable, allowing it to be expanded or retired. Typically, users do not need to manually adjust this flag, as the asset creators in Macro have already configured it correctly for each edge. However, advanced users can use this flag to override the default settings for each edge if needed.
Users can apply prefixes to adjust parameters for the components of a electric heating asset, even when using the standard format. For instance, elec_can_retire will adjust the can_retire parameter for the electricity edge, and elec_existing_capacity will adjust the existing_capacity parameter for the electricity edge. Below are the prefixes available for modifying parameters for the components of a electric heating asset:
transform_for the transformation componentheat_for the heat edgeelec_for the electricity edge