Hi friends, I have some problems in programming some equations in gams, I am new using gams and I don’t have very clear how to program equation with trigonometric functions.
One of the equations that I am having problems with is this:
P=∑ ViVj(Gijcos(Oi-Oj)+Bijsin(Oi-Oj))
j=1
The tutorial says that gams Currently have no support for other functions, including the trigonometric functions cos(x),sin(x), etc.
GAMS does support the math functions you have identified. Go to the McCarl’s guide and search on functions and select Other Mathematical functions and you will see a broad list of supported math functions. You can calculate these values using gams outside of an optimization model, however if you are using the equation inside the optimization you will need a non linear solver.
When we have problems of these types we usually calculate these equations in the pre-model for all possible combinations and then write an optimization to select the values that either minimize or maximize the objective function. Then you can use a traditional solver which is always a lot faster than a non linear solver approach.
Regards,
John
On Tue, Jan 6, 2015 at 11:33 AM, asier bernardo mugarra flores wrote:
Hi friends, I have some problems in programming some equations in gams, I am new using gams and I don’t have very clear how to program equation with trigonometric functions.
One of the equations that I am having problems with is this:
P=∑ ViVj(Gijcos(Oi-Oj)+Bijsin(Oi-Oj))
j=1
The tutorial says that gams Currently have no support for other functions, including the trigonometric functions cos(x),sin(x), etc.
On Tue, Jan 6, 2015 at 9:33 PM, asier bernardo mugarra flores wrote:
Hi friends, I have some problems in programming some equations in gams, I am new using gams and I don’t have very clear how to program equation with trigonometric functions.
One of the equations that I am having problems with is this:
P=∑ ViVj(Gijcos(Oi-Oj)+Bijsin(Oi-Oj))
j=1
The tutorial says that gams Currently have no support for other functions, including the trigonometric functions cos(x),sin(x), etc.
Hi
This might be resolved by setting a starting value that is not equal to zero. If you don’t set a starting value for your variables, Gams assumes zero.
You could for example set THETA.L = 1;
Cheers
Renger