VedaSupport Forum
Extremely high marginal costs on CO2 constraint - Printable Version

+- VedaSupport Forum (
+-- Forum: VEDA Front End (
+--- Forum: Questions and Observations (
+--- Thread: Extremely high marginal costs on CO2 constraint (/showthread.php?tid=76)

Pages: 1 2

Extremely high marginal costs on CO2 constraint - dlmccollum - 13-10-2010

Dear Antti, Amit, et al.,

I've been struggling the past couple of days trying to understand why my CO2 prices are so high in the later model periods.  I'm reading off the "EQ_CombalM" values for CO2, for which I specify annual caps that decrease over time.  The caps are formulated using the "COM_BNDNET" attribute.  The CO2 prices gradually rise over time to $100-200/tonne, depending on the scenario.  But then in 2050, the prices skyrocket to about $10,000/tonne.  The question is why.

Obviously, the model is built on thousands of assumptions, and each of these are candidates for causing the prices to increase to such high levels.  However, I've tried to make many, many changes, and many combinations of changes, yet nothing seems to work.  I'm pretty sure that none of the technologies in my model actually have a marginal cost of CO2 abatement that is actually on the order of several thousand dollars per tonne.  So I'm starting to think that something else might be causing the price spike.  The interesting thing is that if I run a much less stringent climate scenario (say, -40% vs. -80% reductions from 1990), I still get the price spike, though maybe it is not quite as high.  This is surprising since in the less stringent climate scenario, the model is not using the most costly technologies that it is using in the more stringent scenario.  Therefore, one would expect the CO2 prices to be dramatically reduced.

One thought I had is that the price spike could be related to the fact that my model only goes to 2055.  Perhaps something funny is happening because 2050 and 2055 are the last two periods.  I never seem to see a CO2 price spike in 2045 or before.

A second thought is that some of my negative emissions technologies are causing the problem.  For example, I have some Fischer-Tropsch liquid fuels plants in the model that consume biomass and also utilize CCS.  Thus, the model would like to use these technologies as much as possible.  Perhaps this changes how I should think about the EQ_CombalM value on CO2. 

A third thought has to do with my observation that TIMES seems to like to bring sectoral CO2 emissions exactly to zero, if they are hovering around zero.  For example, in my supply sector I have some negative emissions technologies.  Therefore, emissions from the supply sector could be less than zero (say, -5 Mt).  Or they could be slightly more than zero (say, +2 Mt).  It simply depends on what technology and fuel choices the model wants to make.  The point is that when emissions from a given sector get close to zero, the model forces them to zero, rather than allowing them to be slightly higher or lower.  This behavior is observed in 2050 and 2055, when I see the CO2 price spikes.  (Note that in my TIMES model, I do not specify CO2 caps for sectoral emissions.  Instead, I only specify a total economy-wide cap, and these sectoral emissions all feed in to the total economy-wide emissions.)  Maybe I see a price spike because the model really wants to hold emissions from a couple sectors at zero, even though total economy-wide emissions are definitely non-zero.  I don't know why I'm observing this behavior.

Clearly, I don't fully understand what is going on at the moment.  And while I don't expect anyone, who is not familiar with my model, to be able to diagnose the problem,  I wonder if you've seen this kind of behavior in the past when running other models. 


Extremely high marginal costs on CO2 constraint - AKanudia - 13-10-2010

The primal solution will give you the answer. Look at the dummy imports and tech-wise emissions. You will probably spot something that is firing up only in the period with this price spike.


Amit, which file are you suggesting that I take a look at ?

Also, I should have mentioned that I don't have any dummy imports entering the model.  This was one of the first things I checked when I noticed the problem with the CO2 price spikes.


I meant to make a VBE table with Attribute=VAR_FOUT / commodity=CO2 and compare the flows in the periods with and without the price spike.


Nothing seems too unusual.  Hmm.  Do you think it could have something to do with my biomass supply curves?  I will explain.  I have supply curves for 12 different types of biomass.  Each curve has somewhere between 5 and 20 cost steps.  If you were to look at the curves, you would see that costs gradually increase, then the last few PJ of biomass (which makes up less than 1% of the total supply) increases dramatically (i.e., the typical straight vertical cost increase of a supply curve for the very last resources).  The model doesn't like to use these high-cost biomass supplies at these final steps on the supply curves, but perhaps this is leading to the CO2 price spikes. 

Just to give you a feel for the numbers, most of my biomass is in the range of $1 to $12 per GJ.  Then, the last few steps shoot the cost up to $435/GJ, and even up to $782/GJ.  Obviously, such high biomass costs would lead to extremely high CO2 prices, if this biomass were consumed.  But in fact, this high-cost biomass is not being consumed.  Thus, I wouldn't expect it to enter into the model's calculation of the marginal cost of CO2. 

I should mention that I have had some other indications that my biomass resources and biomass conversion technologies are responsible for the high CO2 prices, so I'm kind of expecting this to be the source of the problem.  However, I just can't put my finger on exactly what the problem is.

Extremely high marginal costs on CO2 constraint - AKanudia - 14-10-2010

Comparing the emissions with an alternate run might reveal something: run a tax case where the tax is equal to the observed CO2 marginal. Just replace the spike with a lower value that looks like a reasonable extrapolation of the previous periods.

If the emission constraint is violated, you will have your basic culprit identified.... check who is emitting more than the emission cap case.
If the constraint is not violated, then the spike would be more mechanical than organic. A consequence of how the emissions have been aggregated, who is sitting on which bound etc.

Extremely high marginal costs on CO2 constraint - AKanudia - 19-10-2010

Did you give up on this line of investigation for now?

Extremely high marginal costs on CO2 constraint - dlmccollum - 20-10-2010

Well, yes and no.  Thanks for following up.  After spending ALL of last week trying to figure out the problem, I eventually told myself that I had to move on to other things.  First, I followed your advice about implementing a CO2 tax trajectory similar to the marginal cost trajectory, but with lower values in the years where there was a price spike.  However, the emissions constraint was violated.  I looked around everywhere and played with I don't know how many assumptions and constraints, but nothing I did seemed to solve the problem.  I think I identified that hydrogen production/consumption could be a problem, especially for light-duty vehicles.  The lower the tax I implemented, the less hydrogen FCVs I saw entering in the later years.  This was informative, but I still do not believe the result that the marginal cost of reducing CO2 emissions using H2FCV cars and trucks (including all the upstream processes to produce hydrogen) is on the order of $10,000/tCO2.  I checked and re-checked to make sure that I hadn't mis-specified a cost or efficiency somewhere (an extra zero here or there could increase costs by an order of magnitude for a particular technology), but nothing seemed evident.  Otherwise, the emissions trajectory looks fine.  It rises from about $20 in 2025 to $350 in 2045, but then it spikes in 2050 to $10,000 and falls again to $3000 in 2055, the last time period.  This is for an 80% reduction scenario.  Note that total system costs do not dramatically increase in this scenario, only the marginal CO2 price spikes.  At this point, I have no idea what the problem could be, and I'd still like to know, so if you got any brilliant ideas for how to do some detective work, I'm all ears.  Thanks.

Extremely high marginal costs on CO2 constraint - dlmccollum - 10-11-2010

For a given scenario, in which file can I find the shadow prices of equations and reduced costs of variables?  In other words, the typical type of LP output from GAMS showing the equation/variable and then its values under the following columns:  Lower, Level, Upper, and Marginal.  I thought I would be able to find this in the .gdx file, but when I try to open my .gdx files using a simple text editor (e.g., Notepad), I just get a bunch of nonsense symbols.

Extremely high marginal costs on CO2 constraint - Antti-L - 10-11-2010

The GDX files are not text files, but binary files.  The GAMS installation includes a GDX Viewer, which you can use exactly for the purpose you described, and you will also see there all the TIMES reporting parameters, input parameters, and even internal parameters and sets etc.

However, note that the "raw" equation marginals and shadow prices shown in the GDX file are discounted values, and, in the case of e.g. activities, flows, or period-wise equations, they correspod to the model periods. The TIMES reporting parameters provide you with the undiscounted and annualized values, which are much more useful and easier to process further.


Antti, thanks for the tip.  By the way, have you had a chance to look at the rest of this thread?  I still haven't solved this problem with the spike I'm seeing in CO2 marginal costs in the later years.  Amit gave me some good ideas for debugging, but nothing I've done so far seems to reveal any obvious problem.  As Amit said, the problem could be more mechanical than organic, but if it is organic, then I simply have trouble believing the result that I have any technologies in the model with marginal abatement costs of several thousand dollars per tonne CO2. 

One other thing I've thought of has to do with the dominance of light-duty vehicle investment costs in total system costs.  I know that other modeling groups have seen the same thing.  Because LDV costs are so huge, and because this is one of the last subsectors to undergo significant decarbonization in my scenarios (which look at 80% GHG reductions by 2050), do you think this could be leading to such high CO2 prices?

Extremely high marginal costs on CO2 constraint - Antti-L - 11-11-2010

I would have to be given the exact definitions of "organic" and "mechanic" problems to comment on that particular qualification by Amit. Big smile  However, I think that the marginal cost of 10,000 USD/tonne is very high indeed, and I would not expect to get such high costs in my models.  The symptoms you have described lead me to suspect that you may have modeled some constraint(s) (e.g. user constraints or market-share constraints) that don't work well anymore in the context where the emissions should be very tightly constrained.  In other words, I suspect that some of the constraint(s) you have modeled force the model to choose unrealistically high-cost options for further emission reductions, by preventing lower cost solutions. In particular, the fact that you said that the model forces the emissions to zero when they get close to zero seems to me as an indication of likely problems in some constraint(s), which can nonetheless be satisfied if the emissions are forced to zero.

It is very difficult to give any definitely good advice to analyse the problem, in addition to what Amit has already given. But I would myself first check the marginals of all user constraints, to see if some of them are very high, and then investigate whether those constraints really work well. If nothing is found there, then I would go on to check the marginals of other constraints. Debugging a model can sometimes be very tricky and tedious...

Also, note that most of the TIMES variables are declared as non-negative, and depending on how you have modeled things, that may constitute a problem preventing the full utilization of your negative emission options. When necessary, you'll need to define a negative lower bound for e.g. VAR_COMNET.

Extremely high marginal costs on CO2 constraint - dlmccollum - 11-11-2010

In VEDA-BE, how can I check the marginals of the non-UC constraints?  When I pull up a table with "User_con" and "User_conFXM", the only thing that comes up are the user constraints that I've defined in scenario files.  This is expected.  However, which attributes should I look at to analyze the marginals on all other model constraints, for example, a simple "Share~UP" constraint that is defined at the technology level (i.e., in the BY or SubRES workbooks)?


Well, in general you can't, from the standard TIMES reports.  The standard reporting parameters include only the marginals for the commodity balance equations, peaking constraints, trade equations, cumulative constraints and user constraints. This is so because normally one doesn't need the marginals of other constraints, and for really big models one would not want to pollute the VEDA-BE database with huge amounts of unnecessary data.

But when such a need arises, you can, for example, use the GDXViewer, selecting any constraint type of interest there, and export all the data (levels, marginals, bounds) for the constraints into an Access mdb file.  With Access you can then very easily find any constraints with large marginal values, using the Access Query facilities.  However, when looking at the raw solution marginals, you also need to remember that they are discounted values and usually correspond to the period aggregates. But the GDX file includes also the parameter that can be used for the undiscounting: COEF_PVT.  For example, the marginals of the Share constraints (EQ(l)_INSHR, EQ(l)_OUTSHR) should be undiscounted using this paramater.

Of course, if you know GAMS well enough, you could also load the GDX file into GAMS and manipulate the marginals there.  But I think using the GDX viewer and exporting to Access is a reasonably easy method for detailed model debugging.


Just to make sure that you didn't overlook my remark about non-negative variables: Re-reading you first posts, you mentioned that "For example, in my supply sector I have some negative emissions technologies.  Therefore, emissions from the supply sector could be less than zero (say, -5 Mt)."
Does this mean that you have actually seen negative emissions in the results for the supply sector? If not, and your emission constraints are very stringent, I can well understand that your model might run out of options to reduce emissions at reasonable cost. In that case the light-duty vehicles might well become the marginal technologies, and your comments about the high costs of the LDVs might be quite relevant with respect to emission reduction, depending on your assumptions on the costs of e.g. electric cars.  However, if you have enabled negative sectoral emissions by defining negative lower bounds for them, then I would not expect you to get such high marginal costs with a 80% reduction constraint.