Simple grid tariffs (ex. 53)

Overview

The relevant section of the top-level YAML looks like this:

components:
  # ... other stuff ...

  grid_market:
    type: Node
    carrier: electricity

  grid_internal:
    type: Node
    carrier: electricity
  
  # NOTE: `0.05` (here ct/kWh) is the energy related tariff for consumption.
  grid_connection_buy:
    type: Connection
    node_from: grid_market
    node_to: grid_internal
    lb: 0
    ub: tariff_power_consumption:value
    cost: 0.05
  
  # NOTE: No power peak related cost for feeding electricity back to the grid.
  grid_connection_sell:
    type: Connection
    node_from: grid_internal
    node_to: grid_market
    lb: 0
    ub: 1000
    cost: 0.07

  # NOTE: This assumes `1000` (here kW) as maximum grid connection. `1.15` is the power peak related tariff.
  tariff_power_consumption:
    type: Decision
    lb: 0
    ub: 1000
    cost: 1.15

This is a simple grid tariff model. The grid_market and grid_internal nodes represent the grid and the internal grid respectively. The grid_connection_buy and grid_connection_sell connections represent the flow of electricity from the grid to the internal grid and vice versa. The tariff_power_consumption decision represents the power peak related tariff for consumption. The grid_connection_buy connection has a cost of 0.05 ct/kWh and the grid_connection_sell connection has a cost of 0.07 ct/kWh. The tariff_power_consumption decision has a cost of 1.15 ct/kW.

Note that the numbers are completely arbitrary and are only used for demonstration purposes.

Running the example

First, import iesopt.

import iesopt

Then, create a local copy of the IESopt example.

config = iesopt.make_example("53_grid_tariffs", "opt")
INFO:iesopt:Data folder for examples already exists; NOT copying ANY contents
INFO:iesopt:Creating example ('53_grid_tariffs') at: 'opt/53_grid_tariffs.iesopt.yaml'
INFO:iesopt:Set write permissions for example ('opt/53_grid_tariffs.iesopt.yaml'), and data folder ('opt/files')

Finally, run the model and observe some results.

model = iesopt.run(config, config={"general.verbosity.core": "error"})

model.results.to_pandas().query(
    "component == 'ev' and field == 'state' and mode == 'primal'"
)
snapshot component fieldtype field value mode
654 t1 ev var state 32.016632 primal
655 t2 ev var state 36.590437 primal
656 t3 ev var state 41.164241 primal
657 t4 ev var state 45.738046 primal
658 t5 ev var state 50.311850 primal
659 t6 ev var state 54.885655 primal
660 t7 ev var state 59.459459 primal
661 t8 ev var state 54.054054 primal
662 t9 ev var state 48.648649 primal
663 t10 ev var state 43.243243 primal
664 t11 ev var state 37.837838 primal
665 t12 ev var state 32.432432 primal
666 t13 ev var state 27.027027 primal
667 t14 ev var state 21.621622 primal
668 t15 ev var state 16.216216 primal
669 t16 ev var state 10.810811 primal
670 t17 ev var state 5.405405 primal
671 t18 ev var state -0.000000 primal
672 t19 ev var state 4.573805 primal
673 t20 ev var state 9.147609 primal
674 t21 ev var state 13.721414 primal
675 t22 ev var state 18.295218 primal
676 t23 ev var state 22.869023 primal
677 t24 ev var state 27.442827 primal
model.results.to_pandas().query(
    "component == 'tariff_power_consumption' and fieldtype == 'var' and mode == 'primal'"
)
snapshot component fieldtype field value mode
289 None tariff_power_consumption var value 4.573805 primal