macroenergy / Dolphyn.jl

DOLPHYN: Decision Optimization for Low Carbon Power and Hydrogen Nexus
https://macroenergy.github.io/Dolphyn.jl/
GNU General Public License v2.0
36 stars 20 forks source link

Speed up writing HSC and LFSC duals #233

Closed RuaridhMacd closed 4 months ago

RuaridhMacd commented 5 months ago

Description

Two places in the code require the duals to be accessed, transposed, and multiplied by the time weights and model scaling factor. This is currently done with two quite slow loops. This PR replaces the loops with broadcast methods and the transpose function.

Liquid fuels currently balances supply and demand on an annual basis. These functions will need to be changed if we change this to hourly or another time basis.

Fixes issue \

No associated issue

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Test Configuration:

Checklist: