Page 1 of 1

How to compute endogenous cost expressions in GAMs

Posted: Fri Jul 06, 2018 10:56 am
by lixlz51
Capture.PNG
Hi everyone,

I saw some papers using GAMs to optimize a MINLP model(attached the obj for your consideration in the example of Liu et al (2010)). For the inventory holding cost, the computation is very complex involving calculus, normal distribution and then square root with decision variables. how do you write those expressions in GAMS?

in the last term of the objective function TC, the square root value depends on decision variable Yij as well. how to compute those? Also, for the value of R(Z), how to write it in GAMs?

Thank you very much for your help!

Re: How to compute endogenous cost expressions in GAMs

Posted: Sat Jul 14, 2018 10:41 am
by Renger
Hi
As in most modeling and programming languages there is a way to write the square root. In Gams there is an explicit function SQRT(x) or you can use x**0.5.

Cheers
Renger

Re: How to compute endogenous cost expressions in GAMs

Posted: Mon Jul 16, 2018 9:28 am
by lixlz51
Hi Renger,
Thank you very much for your reply.
Is there any math function to calculate the calculus expression I posted before? What I did was to compute the calculus and reverse function of the standard normal distribution in Mathematica before I put all those values are known scalar in GAMs. It would be ideal to write all in the GAMs file.

Re: How to compute endogenous cost expressions in GAMs

Posted: Tue Jul 17, 2018 3:02 pm
by dirkse
Hi,

GAMS ships with stolib, an extrinsic function library full of functions relevant to probability and statistics. For example, the CDF and inverse-CDF functions for many distributions (including the normal distribution) are contained in this library. Details and examples are in the docs:

https://www.gams.com/latest/docs/UG_Ext ... tions.html
https://www.gams.com/latest/docs/UG_Ext ... rch=stolib

That should allow you to use the inverse CDF with endogenous arguments.

-Steve