TulipaEnergy / TulipaEnergyModel.jl

An energy system optimization model that is flexible, computationally efficient, and academically robust.
Apache License 2.0
17 stars 18 forks source link

Add the dual solutions to `energy_problem.dataframes[:highest_in_out]` #637

Open datejada opened 1 month ago

datejada commented 1 month ago

What and Why

While eating our food (meaning, using the results of Tulipa to plot them), I realized that it is better to have the results of the duals in the dataframe, too (as the flows and storage levels).

We get the duals from the hubs and consumer balances. These constraints are built using the energy_problem.dataframes[:highest_in_out]. So, we can add an extra column to this dataframe with the duals that are stored in energy_problem.solution.duals[:hub_balance] and energy_problem.solution.duals[:consumer_balance].

After this, it will be necessary to update the documentation and how to access the results for the duals.

Possible Drawbacks

The same data is stored twice (in the solution structure and the dataframes). So, if we move to dataframes all the way along, we will avoid this. So, either we do it before the issue below or we do this change when tackling it.

Related Issues

115