Code Monkey home page Code Monkey logo

Comments (4)

pkyle avatar pkyle commented on May 28, 2024

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.

from gcam-core.

Youyi77 avatar Youyi77 commented on May 28, 2024

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!

from gcam-core.

pkyle avatar pkyle commented on May 28, 2024

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.

from gcam-core.

Youyi77 avatar Youyi77 commented on May 28, 2024

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!

from gcam-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.