Integral of demand function

Problems with modeling
Post Reply
a.thiesmeier
User
User
Posts: 1
Joined: 3 years ago

Integral of demand function

Post by a.thiesmeier »

Hey everyone,
I need some help calculation the integrals of my demand and supply functions.

I am currently writing a small PE model for my masters thesis and I want to evaluate the welfare changes in percentage between different scenarios. So far I have calculated them under the assumption that my functions are linear, just calculation triangles and rectangles. However,
I actually have exponential demand and supply functions witch makes this not very realistic.

I was wondering if it is possible in GAMS to calculate the integral of these function with varying integration limits?
I found some documentation on the simpson rule but found that very confusing and am not quite sure how to relate that back to my case.

q_dem(hh,c,k).. DEMAND(hh,c,k) =E= int_dem(hh,c,k) *
prod(cc,((PRICE(c,k)*tax(c,k)+ excise(c,k))**el_dem(hh,c,cc,k)))
;

q_supply(c,k).. SUPPLY(c,k) =E= int_supply(c,k) *
prod(cc,PRICE(c,k)**el_supply(c,cc,k));

These are the two functions.

Any help would be greatly appreciated!
SapperDoc
User
User
Posts: 13
Joined: 4 years ago

Re: Integral of demand function

Post by SapperDoc »

Don't bother with Simpson's Rule. Just use either the Left Hand Rule or Right Hand Rule. They're easier to implement and, as the width of the intervals approaches zero, the numerical integration approaches the exact value, anyway. (Just use a very small interval.)
Post Reply