polca / premise

Coupling Integrated Assessment Models output with Life Cycle Assessment.
BSD 3-Clause "New" or "Revised" License
110 stars 48 forks source link

custom scenarios: ratio scaling does not work as intended? #155

Closed simb-sdu closed 6 months ago

simb-sdu commented 7 months ago

I am building a "market for energy" consisting of 20% electricity, 40% district heat, and 40% oil. All processes are given in MJ except for the electricity, which is given in kWh

as suggested in the documentation, the ratio feature can be used to multiply by a factor to account for different units. i use the ratio 0.278 to transform - i.e., the "market for energy" should have an input of 0.4 district heat, 0.4 oil, and 0.2*0.278 electricity. This means that the technosphere inputs will be <1, because 0.2 MJ is only 0.05 kWh - but we know that the total energy input correspons to 1MJ.

THE PROBLEM is that it seems that premise just scales all three technosphere inputs, so the sum of them is 100% - but I just told via the ratio command that we have different units?!

Am I missing some point, or is the ratio feature in fact faulty?

romainsacchi commented 6 months ago

Suppose the following shares:

If we give ratio: 0.278 to electricity, the shares become:

and indeed, premise will normalize the shares so they become:

So the issue is that the energy input from electricity is no longer 20% (but 28.8%) and the total energy input is now superior to 1 MJ.

Commit https://github.com/polca/premise/commit/ef13736183c90b8c894933f10bde522cfdc43d01 should fix this, as it applies the ratio AFTER normalizing the shares to 1.

simb-sdu commented 6 months ago

thanks romain, I can confirm that it now behaves as expected when building markets on my pc