JGCRI / gcam-core

GCAM -- The Global Change Analysis Model
http://jgcri.github.io/gcam-doc/
Other
263 stars 159 forks source link

Can No hydrogen scenario be possible? #409

Closed Youyi77 closed 3 months ago

Youyi77 commented 3 months ago

Hi team,

I am trying on a very extreme scenario (which might not make any sense but just curious) where there is no H2 production in the USA, running GCAM not GCAM-USA.

  1. I turned down the shareweight for all H2 central production technologies in hydrogen.xml to 0, starting from 2020.
  2. Also changed the iteration to 10000.
  3. Currently only changed H2 central production and left all forecourt unchanged.

The model failed to solve.

But if I just left one H2 central production tech open, the model can be solved.

I am trying to reconcile this: GCAM should be able to find H2 substitutions to fulfill the same services in the end-use sector when no hydrogen is available. But it didn't because the end-use sectors that consume hydrogen have their H2-specific pathway pre-defined. So there must be H2 produced. Otherwise, the end-use sectors cannot solve themselves.

If my understanding is incorrect, what could be the reason? (or is it possible to build this No H2 scenario?)

Thanks for any help!!

pkyle commented 3 months ago

Interesting question! Really the best way to shut off a commodity in GCAM is at the demand rather than the supply. The model doesn't seem to have any problem zero-ing out the supply of something whose demand is zero, but when you shut off the supply but not the demands, then it sets up a situation where the model is trying to compute the logit share of hydrogen-consuming technologies in the demand sectors, but it can't compute their prices because they consume inputs (e.g. H2 wholesale delivery) whose output is zero and therefore whose price can't be calculated. Prices of any commodity are calculated as the weighted average of all production technologies. Anyways you can keep the supply shut off or not, but the thing I'd recommend doing is shutting off the demand, using share-weights and share-weight interpolation rules, applied only to the USA region, generally using stub-technology because most hydrogen-consuming technologies have their attributes assigned in inst/extdata/energy where the R code then assigns them to the global-technology-database in the XML files. So, I don't know how much luck you'll have working with the files in inst/extdata/energy though this folder, and the grep function, can be helpful. All hydrogen commodities in GCAM start with the string H2 so that can be helpful for identifying them. I think this would need to be done either in the R code or in extra add-on files, that just set all technology-level share-weights in all model time periods to zero, for all hydrogen-consuming technologies, but only in the USA region. If you figure out a simple/clean way to do this, go ahead and post the method here because others might want to do this sort of thing.

Youyi77 commented 3 months ago

Hi Page, thanks so much for the suggestions!!

As I am not very sure about all the R code changing part and kept getting errors, so I tried a brutal way - changing the shareweight to 0 for H2 technology in all H2-related sectors in the xmlfiles for USA. It is a laborious work but luckily it worked!

203 This one helps a lot while I was changing the shareweight as the overwriting rules are a bit tricky.

I kept the H2 supply on. So shutting off the demand solved this! Thanks again!

pkyle commented 3 months ago

Oh yeah I should have warned you, with the share-weights, you don't want to be trying to over-write share-weights or interpolation rules after-the-fact, for subsectors and/or technologies that have interpolation rules assigned in the base XML files. You want to change or delete those interpolation rules in the base XML files. Even interpolation rules assigned as global defaults, in the global-technology-database, will over-write share-weight values assigned to stub-technology objects within a region, and attempting to over-write one interpolation rule in the global-technology-database with another interpolation rule is a frustrating exercise.

Youyi77 commented 2 months ago

Hi Page, thanks so much for the explanation! There are indeed some tricks in these!!

Recalling what I had done - for H2 related sectors, I didn't change any global-technology-database but made all changes in the stub-tehcnology in USA region.

For stub-tech that has yearly shareweight assignment, change it to 0. For stub-tech that has "fillout=1" , just added shareweight = 0 to each year. For stub-tech that has interpolation rule, more complicated. If it's within the stub-tech, just change the rule or delete the rule & add yearly shareweight. If the interpolation rule is not for this specific technology, basically have to re-write all the rules for each tech within the sector/subsector.

Luckily, there are too many sectors related to H2!