arfc / pride

(P)lan for (R)ap(I)d (DE)carbonization
BSD 3-Clause "New" or "Revised" License
3 stars 7 forks source link

2050 extend #149

Closed yardasol closed 3 years ago

yardasol commented 3 years ago

This PR adds two new scenarios:

  1. UIUC_2050_cost, a cost-constrained scenario based on 11_uiuc extended to 2050
  2. UIUC_2050_land, a land-constrained scenario based on 12_uiuc extended to 2050

This PR partially addresses #140 This is an active PR and I will be adding note and question here as comments.

yardasol commented 3 years ago

Note: commit f32e095 also extends MinActivity of IMPSOL, CHWS, and MaxCapacity of IMPWIND

yardasol commented 3 years ago

@samgdotson @robfairh I'm finished with the databases. Some notes:

yardasol commented 3 years ago
  1. The next error I got was
source error message="Index '('uiuc', 2046, 'IMPWIND', 2016)' is not valid for indexed component 'CostVariable'"

This error occurred because the specified vintage for that year was beyond the lifetime of the technology. I went into the CostVariable table and updated the vintages such that the years would work out.

@samgdotson What values did you set the vintages to?

yardasol commented 3 years ago

@samgdotson see my above comment

samgdotson commented 3 years ago

@yardasol It doesn't really matter as long as the cost for a particular year doesn't rely on a vintage that older than the lifetime of the technology. Pick your favorite.

E.g. Wind lasts for 25 years (check?), then 2046-2016 > 25. So those don't work. But as long as YEAR - VINTAGE < LIFETIME then it will work.

yardasol commented 3 years ago

@samgdotson I'm running into a similar issue with IMPSOL regarding vintages and technology lifetimes. I assume the simulation does this because it at the end of the technology lifetime, it wants to buy more but sees a vintage from a year in the past instead of a vintage for the current year. Is that correct?

samgdotson commented 3 years ago

It's okay for the vintage and the year to be different, but for a given year you cannot have a vintage that is older than the lifetime of the technology.

yardasol commented 3 years ago

What I'm asking is why the simulation behaves this way.

samgdotson commented 3 years ago

You can't buy, use, nor maintain a technology that has exceeded its lifetime. I'm not really understanding your question.

yardasol commented 3 years ago

My understanding after browsing the TEMOA docs and forums (I found this post to be particularly helpful) is that the pairing of a technology and a vintage is called a process. The process is the fundamental unit that TEMOA operates with. In the case of our IMPWIND and IMPSOLAR technologies, there exists a corresponding process for each vintage that exists. Currently we only have one vintage -- and therefore one process -- each for IMPWIND and IMPSOLAR. When these processes reach the end of their lifetimes specified by LifetimeTech, they end.

With this in mind, I do not see the logic in just changing the vintage of the processes we have been working with. I would like to understand your reasoning a bit @samgdotson for why changing to vintage to get around the technology lifetime constraint is a valid fix in the context of modeling the UIUC microgrid.

An alternative solution would be to add a new process for IMPWIND and IMPSOLAR with a new vintage corresponding to the end of their respective technology lifetimes. That being said, we would need to list our assumptions we make about these new processes as the technologies will have advanced in cost and efficiency that far into the future.

samgdotson commented 3 years ago

You're right. We need to add a new vintage. "Changing the vintage" is equivalent to adding a new vintage. This does not mean adding "existing capacity," it means just changing the vintage that is referenced. It doesn't force the model to build a particular vintage. It just makes one available for a given year, if Temoa decides that's what it wants to do. I believe I've been explicit throughout that we are assuming the costs do not change through time. This is precisely the function of Temoa -- dealing with future uncertainty. We can make an infinite number of assumptions about the future of technology costs and we could argue about them until we're blue in the face, so let's not do that.

robfairh commented 3 years ago

By reading your comments @yardasol and @samgdotson, I can think of the following strategies to solve this issue.

a- Extend LifetimeTech for IMPWIND and IMPSOL b- Remove the entries for years beyond Vintage + LifetimeTech

I believe @samgdotson is suggesting something else, maybe: c- change Vintage so that Vintage + LifetimeTech is greater than 2051 or d- add a new entry in ExistingCapacity for IMPWIND and IMPSOL

Which strategy do you think is the best? @samgdotson If your suggestion is not included in this list, then I don't understand how to solve the issue.

yardasol commented 3 years ago

@robfairh I don't think we need to add new ExistingCapacity entry because that would make TEMOA avoid paying the investment costs for the new process. What we want is (I think), in the tables where there is a vintage entry for IMPWIND and IMPSOLAR, change the vintage entry for periods that are beyond LifetimeTech + the current process' vintage to a newer vintage.

For example, in CostVariable, we have the <IMPWIND, 2016> process as an entry for all periods. We could, say, add entries for a <IMPWIND, 2040> process in the table for all periods >= 2040. For all periods >= 2046, we would delete the <IMPWIND, 2016> process entries, forcing TEMOA to consider the costs of the new <IMPWIND, 2040> process in its model. We would do the same for any other tables that have both a period and vintage column.

samgdotson commented 3 years ago

Ok, let's look at wind power, IMPWIND.

INSERT INTO "CostVariable" VALUES('uiuc', 2021, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2022, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2023, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2024, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2025, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2026, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2027, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2028, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2029, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2030, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');

Notice that the variable cost is the same for each year. In our model, we are assuming the following

Now we have to extend this table to the year 2050, rather than 2030. Seems easy enough:

INSERT INTO "CostVariable" VALUES('uiuc', 2021, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2022, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2023, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2024, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2025, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2026, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2027, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2028, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2029, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2030, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
-- Add years
INSERT INTO "CostVariable" VALUES('uiuc', 2031, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2032, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2033, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2034, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2035, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2036, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2037, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2038, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2039, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2040, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2041, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2042, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2043, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2044, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2045, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2046, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2047, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2048, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2049, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2050, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');

But this will produce the error @yardasol mentions above. Why? Because each entry references the vintage 2016. This works for the 2030 case because the technology is built in 2016 (the first vintage) and will last until (2016+25 = 2041) 2041. At that point that vintage is retired. We want to give Temoa the option to use wind power. So how do we fix this? Change the vintage.

INSERT INTO "CostVariable" VALUES('uiuc', 2021, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2022, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2023, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2024, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2025, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2026, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2027, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2028, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2029, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2030, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
-- Add years
INSERT INTO "CostVariable" VALUES('uiuc', 2031, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2032, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2033, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2034, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2035, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2036, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2037, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2038, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2039, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2040, 'IMPWIND', 2016, 0.0384, 'M$/GWh', 'wind farm PPA');
-- Change the vintage to a year that will work, like 2026.
INSERT INTO "CostVariable" VALUES('uiuc', 2041, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2042, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2043, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2044, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2045, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2046, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2047, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2048, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2049, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');
INSERT INTO "CostVariable" VALUES('uiuc', 2050, 'IMPWIND', 2026, 0.0384, 'M$/GWh', 'wind farm PPA');

Now it should run. All the way out to 2050. Why did I pick 2026? Because that was the first year that would cover everything until 2050. It was a fairly arbitrary choice, I could have picked a different year for each entry with no change in the solution. I didn't have to start in 2041, either. I could have started in 2027, for example. Why doesn't this change the solution?

  1. We aren't paying the fixed costs for wind.
  2. Every year is the same price. Why is every year the same price? It is impossible to know the future. Literally impossible. Maybe it will get cheaper, maybe the government will require wind farms to build a certain amount of energy storage which would make it more expensive. We have no idea. We could do a sensitivity analysis on it, which I think would be a good idea, but we should not make more complicated assumptions about cost because we literally don't know.

We should not add ExistingCapacity because that's not true. That table also only works for existing time periods. In this model the existing time periods are (2000, 2016, 2020). Otherwise we'd have to start our simulation in 2026 or later, which kind of defeats the purpose of our analysis.

robfairh commented 3 years ago

Can you try that @yardasol ? And let us know if it works.

robfairh commented 3 years ago

Probably when you updated your branch by merging the master branch, there were some conflicts. Those conflicts haven't been fixed entirely yet. I believe you created UIUC_2050_cost.sql from your 11_uiuc.sql with conflicts.

robfairh commented 3 years ago

@yardasol you should spend some time trying to figure out what happened and fix it.

yardasol commented 3 years ago

@robfairh I looked through the UIUC_2050_cost.sql and UIUC_2050_land.sql files and didn't see any other differences between my version and the current main version here other than the vehicle technology lifetimes, which I fixed with the most recent commit.

robfairh commented 3 years ago

@robfairh I looked through the UIUC_2050_cost.sql and UIUC_2050_land.sql files and didn't see any other differences between my version and the current main version here other than the vehicle technology lifetimes, which I fixed with the most recent commit.

You should diff the files. You should diff UIUC_2050_cost.sql against 11_uiuc.sql (from the master branch) and make sure that you haven't introduced any more changes.

yardasol commented 3 years ago

@robfairh a few questions

  1. Currently, MinActivitiy for GSLVCL, DSLVCL, and E85VCL, Efficiency for IMPNATGAS, IMPGSL, IMPDSL, IMPE85, and IMPH2 are not extended to 2050. Should I add entries in the table for these up to 2050?
yardasol commented 3 years ago

Commit 134462b resolves Issue #140

samgdotson commented 3 years ago

@yardasol There are merge conflicts that need to be addressed. Please also adapt and extend the new implementation of the geothermal plant.

yardasol commented 3 years ago

@samgdotson I'm not seeing the merge conflicts you are talking about. Unless you mean 11_uiuc.sql, which I do still need to fix (I think),

samgdotson commented 3 years ago

The merge conflicts are in 11_uiuc.sql. But the land case and the cost case scenarios do not include the updates to geothermal or the chilled water system. Those need to be changed as well. The changes were to added in 13_uiuc.sql.

robfairh commented 3 years ago

@yardasol I am working on implementing these changes. I'll let you know when I am done. Also, if you want to change anything, remember to do git pull before doing so.

robfairh commented 3 years ago

@yardasol and @samgdotson I have implemented the update of both scenarios. However, TEMOA is missing to find a solution. Could I get some help with the debugging? I am trying to find the error, but so far I haven't been able to.

samgdotson commented 3 years ago

@robfairh scenario14 seems to run fine for me. It's clear that you didn't extend the model but it does have a solution.

robfairh commented 3 years ago

The scenarios run. However, the accuracy of some results is dubious. I think this PR can be merged after @samgdotson review. I made issue #155 to understand the results.