open-plan-tool / gui

Energy Planning Application
Other
6 stars 4 forks source link

bug in optimizing PV capacity #248

Closed mstich0 closed 11 months ago

mstich0 commented 1 year ago

When having an actual timeseries for PV-Generation instead of [1 for all timesteps] the optimization does not build maximum capacity, though maximum capacity is clearly the real optimum. When increasing the maximum capacity the optimization is also increasing the built capacity but again not up to the maximum. This seems to happen when the minimum of the PV-timeseries is below 1. When I add one value that is eaxactly 1 at any single timestep of the timeseries, optimization results indeed in the maximium PV-capacity allowed. If any value in the timeseries is above 1 it will exceed the given limit. It seems that MVS internally norming the timeseries in some kind of way, while the timeseries given in open-plan should already have the correct value in kWh/kWp.

e.g. with 1 timeseries value at 1.5 --> optimization exceed limit of 100,000 Image

Bachibouzouk commented 1 year ago

instead of [1 for all timesteps]

I am not sure what you mean by this: do you mean that the value does not exceed 1 at any given timestep? Or that the value is a constant (1) at all timesteps? EDIT: it was the second option

If you could provide the json file of your example it would be easier to debug :)

Bachibouzouk commented 1 year ago

I found the origin of the behavior : https://github.com/rl-institut/multi-vector-simulator/issues/962 now the question is how to change it, I will wait for more comment of the initial developers of MVS

Bachibouzouk commented 1 year ago

It seems that MVS internally norming the timeseries in some kind of way, while the timeseries given in open-plan should already have the correct value in kWh/kWp.

In that case when you set the timeseries to 0.5 constant value, it should comply with kWh/KWp, yet the result is investment in only 0.5 of the maximum capacity.

We need to consider a test case with initial capacity as well to make sure MVS provides correct behavior not overshooting maximum cap when adding optimized cap and installed cap.

I think the answer lies exactly where you thought it would : there seem to be a confusion between timeseries peak taken before or after the normalization. I think oemof requires values between 0 and 1 but does not require that 1 is there in the timeseries.

This means that the open_plan user could provide a timeseries in kWh and additionally a kWp parameter to format the timeseries to kWh/kWp before sending it to MVS, otherwise the timeseries would by default be normalized by its max

mstich0 commented 11 months ago

Alright the fix seems to have solved the issue, thanks a lot!