Battery

Graph structure

A battery is a storage technology that is represented in Macro by the following graph structure:

%%{init: {'theme': 'base', 'themeVariables': { 'background': '#D1EBDE' }}}%% flowchart LR subgraph Battery direction BT A((Electricity)):::node1 A--Charge--> B[Storage] --Discharge--> A end legend@{img: "../../images/battery.png", w: 120, h: 100, constraint: "off"} Battery ~~~ legend style A r:40,fill:orange,stroke:black,color:black,stroke-dasharray: 3,5; style B fill:orange,stroke:black,color:black; linkStyle 0,1 stroke:orange, stroke-width: 3px; style legend fill:white

Therefore, a battery asset is made of:

  • 1 Storage component, representing the battery storage.
  • 2 Electricity Edge components:
    • one incoming representing the charge edge from the electricity network to the storage.
    • one outgoing representing the discharge edge from the storage to the electricity network.

Attributes

As for all the other assets, the structure of the input file for a battery asset follows the graph representation. Each global_data and instance_data will look like this:

{
    "storage":{
        // ... storage-specific attributes ...
    },
    "edges":{
        "charge_edge": {
            // ... charge_edge-specific attributes ...
        },
        "discharge_edge": {
            // ... discharge_edge-specific attributes ...
        }
    }
}

where the possible attributes that the user can set are reported in the following tables.

Storage component

The definition of the Storage object can be found here MacroEnergy.Storage.

AttributeTypeValuesDefaultDescription
commodityStringElectricityRequiredCommodity being stored.
constraintsDict{String,Bool}Any Macro constraint type for storageBalanceConstraint, StorageCapacityConstraint, StorageSymmetricCapacityConstraintList of constraints applied to the storage. E.g. {"BalanceConstraint": true}.
can_expandBoolBoolfalseWhether the storage is eligible for capacity expansion.
can_retireBoolBoolfalseWhether the storage is eligible for capacity retirement.
charge_discharge_ratioFloat64Float641.0Ratio between charging and discharging rates.
existing_capacityFloat64Float640.0Initial installed storage capacity (MWh).
fixed_om_costFloat64Float640.0Fixed operations and maintenance cost (USD/MWh-year).
investment_costFloat64Float640.0Annualized investment cost of the energy capacity for a storage technology (USD/MWh-year).
long_durationBoolBoolfalseWhether the storage is a long-duration storage. (Note: if true, the model will add the long-duration storage constraints to the storage).
loss_fractionFloat64Number $\in$ [0,1]0.0Fraction of stored commodity lost per timestep.
max_capacityFloat64Float64InfMaximum allowed storage capacity (MWh).
max_durationFloat64Float640.0Maximum ratio of installed energy to discharged capacity that can be installed (hours).
max_storage_levelFloat64Float641.0Maximum storage level as a fraction of capacity.
min_capacityFloat64Float640.0Minimum allowed storage capacity (MWh).
min_durationFloat64Float640.0Minimum ratio of installed energy to discharged capacity that can be installed (hours).
min_outflow_fractionFloat64Float640.0Minimum outflow as a fraction of capacity.
min_storage_levelFloat64Float640.0Minimum storage level as a fraction of capacity.
Default constraints

As noted in the above table, the default constraints for the storage component of the battery are the following:

If the storage is a long-duration storage, the following additional constraints are applied:

Charge and discharge edges

Both the charge and discharge edges are represented by the same set of attributes. The definition of the Edge object can be found here MacroEnergy.Edge.

AttributeTypeValuesDefaultDescription
typeStringElectricityRequiredCommodity of the edge. E.g. "Electricity".
start_vertexStringAny electricity node id present in the systemRequiredID of the starting vertex of the edge. The node must be present in the nodes.json file. E.g. "elec_node_1".
end_vertexStringAny electricity node id present in the systemRequiredID of the ending vertex of the edge. The node must be present in the nodes.json file. E.g. "elec_node_2".
constraintsDict{String,Bool}Any Macro constraint type for EdgesEmpty for charge edge, check box below for discharge edgeList of constraints applied to the edge. E.g. {"CapacityConstraint": true}.
can_expandBoolBoolfalseWhether the edge is eligible for capacity expansion.
can_retireBoolBoolfalseWhether the edge is eligible for capacity retirement.
efficiencyFloat64Number $\in$ [0,1]1.0Efficiency of the charging/discharging process.
existing_capacityFloat64Float640.0Existing capacity of the edge in MW.
fixed_om_costFloat64Float640.0Fixed operations and maintenance cost (USD/MW-year).
has_capacityBoolBoolfalseWhether capacity variables are created for the edge.
integer_decisionsBoolBoolfalseWhether capacity variables are integers.
investment_costFloat64Float640.0Annualized capacity investment cost (USD/MW-year)
max_capacityFloat64Float64InfMaximum allowed capacity of the edge (MW). Note: add the MaxCapacityConstraint to the constraints dictionary to activate this constraint.
min_capacityFloat64Float640.0Minimum allowed capacity of the edge (MW). Note: add the MinCapacityConstraint to the constraints dictionary to activate this constraint.
min_flow_fractionFloat64Number $\in$ [0,1]0.0Minimum flow of the edge as a fraction of the total capacity. Note: add the MinFlowConstraint to the constraints dictionary to activate this constraint.
ramp_down_fractionFloat64Number $\in$ [0,1]1.0Maximum decrease in flow between two time steps, reported as a fraction of the capacity. Note: add the RampingLimitConstraint to the constraints dictionary to activate this constraint.
ramp_up_fractionFloat64Number $\in$ [0,1]1.0Maximum increase in flow between two time steps, reported as a fraction of the capacity. Note: add the RampingLimitConstraint to the constraints dictionary to activate this constraint.
unidirectionalBoolBoolfalseWhether the edge is unidirectional.
variable_om_costFloat64Float640.0Variable operation and maintenance cost (USD/MWh).
Efficiency

The efficiency of the charging/discharging process can be set in the charge_edge and discharge_edge parts of the input file. These parameters are used, for example, in the Balance constraint to balance the charge and discharge flows.

Default constraints - discharge edge

The default constraints for the discharge edge are the following:

Example

The following is an example of the input file for a battery asset that creates three batteries, one in each of the SE, MIDAT and NE regions.

{
    "elec_stor": [
        {
            "type": "Battery",
            "global_data": {
                "storage": {
                    "commodity": "Electricity",
                    "can_expand": true,
                    "can_retire": false,
                    "constraints": {
                        "BalanceConstraint": true,
                        "StorageCapacityConstraint": true,
                        "StorageSymmetricCapacityConstraint": true,
                        "StorageMinDurationConstraint": true,
                        "StorageMaxDurationConstraint": true,
                    }
                },
                "edges": {
                    "discharge_edge": {
                        "type": "Electricity",
                        "unidirectional": true,
                        "has_capacity": true,
                        "can_expand": true,
                        "can_retire": false,
                        "constraints": {
                            "CapacityConstraint": true,
                            "StorageDischargeLimitConstraint": true
                        }
                    },
                    "charge_edge": {
                        "type": "Electricity",
                        "unidirectional": true,
                        "has_capacity": false
                    }
                }
            },
            "instance_data": [
                {
                    "id": "battery_SE",
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "elec_SE",
                            "capacity_size": 1.0,
                            "existing_capacity": 0.0,
                            "fixed_om_cost": 4536.98,
                            "investment_cost": 17239.56121,
                            "variable_om_cost": 0.15,
                            "efficiency": 0.92
                        },
                        "charge_edge": {
                            "start_vertex": "elec_SE",
                            "efficiency": 0.92,
                            "variable_om_cost": 0.15
                        }
                    },
                    "storage": {
                        "existing_capacity_storage": 0.0,
                        "fixed_om_cost_storage": 2541.19,
                        "investment_cost_storage": 9656.002735,
                        "max_duration": 10,
                        "min_duration": 1
                    }
                },
                {
                    "id": "battery_MIDAT",
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "elec_SE",
                            "capacity_size": 1.0,
                            "existing_capacity": 0.0,
                            "fixed_om_cost": 4536.98,
                            "investment_cost": 17239.56121,
                            "variable_om_cost": 0.15,
                            "efficiency": 0.92
                        },
                        "charge_edge": {
                            "start_vertex": "elec_SE",
                            "efficiency": 0.92,
                            "variable_om_cost": 0.15
                        }
                    },
                    "storage": {
                        "existing_capacity_storage": 0.0,
                        "fixed_om_cost_storage": 2541.19,
                        "investment_cost_storage": 9656.002735,
                        "max_duration": 10,
                        "min_duration": 1
                    }
                },
                {
                    "id": "battery_NE",
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "elec_SE",
                            "capacity_size": 1.0,
                            "existing_capacity": 0.0,
                            "fixed_om_cost": 4536.98,
                            "investment_cost": 17239.56121,
                            "variable_om_cost": 0.15,
                            "efficiency": 0.92
                        },
                        "charge_edge": {
                            "start_vertex": "elec_SE",
                            "efficiency": 0.92,
                            "variable_om_cost": 0.15
                        }
                    },
                    "storage": {
                        "existing_capacity_storage": 0.0,
                        "fixed_om_cost_storage": 2541.19,
                        "investment_cost_storage": 9656.002735,
                        "max_duration": 10,
                        "min_duration": 1
                    }
                }
            ]
        }
    ]
}