gcam-doc icon indicating copy to clipboard operation
gcam-doc copied to clipboard

Precise documentation of share-weight calculations

Open robbieorvis opened this issue 4 years ago • 0 comments

Hello,

Is there documentation on exactly how share-weights are calculated in GCAM or a portion of code that lays out the logic for how this is done? @rjplevin are working on implementing policies for electrification, and part of this process requires ensuring that the share-weights for the electric technologies are high enough to ensure the standard can be met. I have a basic understanding of how to manipulate the share-weights and get the desired values, but this has been mostly achieved through trial and error. Any kind of documentation would be helpful (beyond just what is included in the docs and in the tutorial presentations - these are insufficient) so that we can create some scripts that will return desired share-weights.

The issue is less about the actual choice function (which I get) and more about how GCAM converts input data in the XMLs into the share-weights in the models.

There are three types of shareweights – fixed, linear, and s-curve – each of which requires a different set of values but which in practice seem to require the same values.

The challenge is in setting our own interpolation function on top of what is already either in there at the node level for the region of the global-technology-database. I’ve been having to iteratively find a solution every time I want to modify the share-weights.

For example, it seems like the existing interpolation functions remain in place, but for certain years are overridden by anything new that is read in. So if we read in s-curve from 2020-2030 but the default is 2020-2050, the values for 2020-2030 might be correct but then revert back to the original 2035-2050 values. In some instances, certain types of functions have precedence, e.g., it seems like s-curves take highest precedence, but maybe this is wrong. It also appears that the function isn’t actually applied in the “fromYear”, only in the next timestep. And if you change a share-weight value for a year that an interpolation function references, it will change how that function works, even if you use the toValue function in the function, i.e., it appears that you only need a toValue when the share-weight in the toYear is undefined. But if you leave the toValue blank, then sometimes the function doesn’t work. Etc.. These are all just "findings" of mine but are likely wrong.

This is all relevant because I’ve noticed the model is failing in some of the electrification scenarios because the default share-weights are below the target share. I’m manually adding the functions to adjust this, but am wondering if at some point down the road this can be automated – but we can’t do that unless we know the logic behind how the share-weights are estimated and then how to update them accordingly. Of course, the easiest thing would be that if GCAM just overrode the share-weight value when a policy is read-in, but that may not be possible.

Thanks.

robbieorvis avatar Jun 24 '20 20:06 robbieorvis