rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

[Bug] investment costs and project duration #289

Closed Piranias closed 4 years ago

Piranias commented 4 years ago

The investment costs are apparently not calculated correctly regarding the project duration. I noticed that changing the project duration changes the installation of pv plants (in my case) completely. (With a project duration of 15 years no pv plants are installed, while with a project duration of one year only pv is used and no grid electricity.) Maybe this is connected to what @smartie2076 posted in #247 ?

smartie2076 commented 4 years ago

I don´t think that this is the issue. Can you upload your simulation data and also summarize the output in more detail here? Can you check the json_processed.json for "simulation_annuity" for both simulations?

Piranias commented 4 years ago

what simulation data would be helpful? I left all parameters the same in both simulations. Only the project duration was changed in economic_data.csv. In both cases the json_processed.json shows a "simulation_annuity" of 0.0.

Outputs:

for 1 year project duration Bildschirmfoto_2020-04-29_12-45-10

for 10 year project duration Bildschirmfoto_2020-04-29_13-07-56

smartie2076 commented 4 years ago

what simulation data would be helpful?

I was thinking of the whole input data zipped, or the json_processed zipped. Then I can check if there is anything wrong with the data.

I left all parameters the same in both simulations. Only the project duration was changed in economic_data.csv. In both cases the json_processed.json shows a "simulation_annuity" of 0.0.

That does not sound ideal. I did find the ´simulation_annuity´ to be something else then 0 however in the appropriate assets, so I would need to check your csv/json input files to know what´s going on.

Outputs:

for 1 year project duration Bildschirmfoto_2020-04-29_12-45-10

Here, there is PV implemented - but it not completely replace grid consumption, which means that at least storage still has a cost to implement.

for 10 year project duration Bildschirmfoto_2020-04-29_13-07-56

Here there is neither of the components PV or storage implemented, which should not be the case. We will have to recheck this.

Piranias commented 4 years ago

ok, I sent you the zip via mail

smartie2076 commented 4 years ago

Hi Inia! It was actually not attached to the mail. Ideally, it would be better to post it here anyway, to make it available to all and forever to reference.

Piranias commented 4 years ago

csv_elements_test.zip

here you go ;)

Piranias commented 4 years ago

Hi @smartie2076 , did you take a look at the issue and the csv's yet? It would be great to know if this is solved already or if you have a clue what the behaviour is about.

smartie2076 commented 4 years ago

Sorry about that @Piranias, I forgot about this issue as we were developing so many tests. I will take your input and run it through tomorrow.

smartie2076 commented 4 years ago

Hi @Piranias! I am step by step looking into this issue today.

First of all: I found out that the changing project lifetime has nothing to do with a weirdly changing specific capex per unit to be installed:

image

When lifetime asset == project lifetime the specific costs are always the same, otherwise, iflifetime < project lifetime the specific costs increase, as the asset has to be replaced. The specific costs decrease if the lifetime > project life, as replacement costs benefit the calculation. They close in asymptotically to the 0-cost-axis.

The following calculations - translating this into an annuity and simulation annuity - should not change this trend, as they are only multiplying by a factor.

The code for this test is this one: test_289.py.zip

So, that is not the issue. I will search some more.

smartie2076 commented 4 years ago

I am documenting what I did from here on out.

Preparing input files

Overall, this is the input data I will use: inputs_bug_289.zip

This results in following energy system: network_graph

smartie2076 commented 4 years ago

I notice the same issues as you do with the updated input files, @Piranias:

project life of 1 year

I do have some generation from the cheapest PV panel 1 over the whole year:

Electricity bus_flows_365_days

And the battery is used as a seasonal storage: ESS Li-Ion bus_flows_365_days

project life of 20 years

Only electricity consumption from the grid is used to meet demand:

Electricity bus_flows_365_days

Other project lifetimes

Electricity bus_flows_365_days

Explanation

I think that what happens here is that the simulation_annuity (or, as we simulate a year, the specific annuity per installed CAP) of the assets to be installed increases with increasing project lifetime. Reasons for this are:

You can also see this relation in the table above.

To check this issue further, it would be best if we would output the specific (simulation) annuity in a table format in each of our simulations. I will create an issue for this.

Another point could be the amortization type we use (linear). With this, the residual value / re-sales value is much higher for the first investment in a simulation (as it is related to year 0). I think this results in a disproportional repay with short project lives, as the time value of money is not included... (discuss in #247). Sill, the benefit of the re-sales seem to wear off after 5 years in this case.

@SabineHaas this also has implications for the idea we had to simulate degradation of solar panels by "simulating 20 years in a row".

smartie2076 commented 4 years ago

Okay. I think this is all I have to say for now ;)

Do you have comments @Piranias, @SabineHaas?

Piranias commented 4 years ago

Hi @smartie2076, sorry for the late reply and thanks for this detailed reply. So overall I cannot follow exactly all the steps about the annuity as I am not familiar with the costs calculation.

With a longer project lifetime, reinvestments into the capacities are necessary, ie. into solar inverters (project lifetime > 15 a) and batteries (project lifetime > 10 a).

this makes sense for me

With a shorter project lifetime, the residual value that is subtracted from the costs is very high, and the annuity therefore really low. With the increasing project duration, the value of the assets at project lifetime decreases - and so the annuity increases.

I do not fully understand this point or what this residual is. But in my point of view the costs should be split equally on all years within this life time and not change in beteen the years.

So do you agree in the end that this is actually a bug that needs to be fixed? Is there somebody working on this already? I am afraid that I'm not a big help here, since I have no idea how the costs are calculated. But I'd aapreciate if somebody could look into this as I think it's of major importance for all simulations.

Just one point about the storage price:

* I think I mentioned it before in an issue but I think that below very low cost for installing storage capacities are somewhat unexpected from me. 0.2 €/kWh installed Li-Ion battery?
  I would say something like 700-900. You ran into some strange optimization resutls last time because of this.

I don't know where you got that number of 700-900 from. Can you share the reference? I looked into this and here the storage price is defined by 0.2 Euros/kWh. I'd be interested in why you think this is not correct!

smartie2076 commented 4 years ago

Hi @Piranias I feel like this is not really a bug - @SabineHaas what is your take on this?

I have the number from the top of my head, but you can compare eg. this trader. Example: One AGM/PB Battery 12 V x 160 Ah = 1920 Wh = 1.9 kWh costs 290 €. I was citing Li prices, approx.

The 0.2 €/kWh that you found are not the investment costs, but the costs of storing 1 kWh electricity in a battery, judging from the title "Stromspeicher-Preise pro gespeicherter Kilowattstunde" and also the calculation of this value 16.500 € / (10 kWh * 1 Entladetiefe * 10.000 Zyklen * 0,98 Systemwirkungsgrad) = 16,83 Cent pro Kilowattstunde These are the approximate costs per stored 1 kWh electricity based on the whole lifetime.

smartie2076 commented 4 years ago

@SabineHaas I know we also talked about using the MVS sucessively for multiple years of operation in your case. I think, this would only make sense in an iterative way:

  1. Optimize over a project lifetime, 15 or 20 years
  2. Fix capacities and do a dispatch optimization for each of the operational years while applying degratation ie. efficiency loss to battery and PV.
smartie2076 commented 4 years ago

We think that the residual value calculation is incorrect as it does not consider the time value of money when the asset is sold, but a even share of the investment at the lates investment time. This connects to #247 and will fix that issue.

Outcome: @Piranias, please change the residual value calculation here to payment of present value:

    capex = capex - linear_depreciation_last_investment * (
        number_of_investments * lifetime - project_life
    )/(1 + discount_factor) ** (project_life)

With (1 + discount_factor) ** (project_life) calculating the present value of the sales revenue at the end of the project. Please update the docstrings as well then.

You will also have to change the tests for this function here, specifically 1, 2, 3.