Search found 93 matches

by Manassaldi
1 day ago
Forum: Syntax
Topic: Cumulative sum
Replies: 5
Views: 92

Re: Cumulative sum

I think this can work...

Code: Select all

eq.. z =e= sum((i,j)$(ord(j) le ord(i)),x(j) - y(j));  
bye!
by Manassaldi
2 days ago
Forum: Syntax
Topic: Cumulative sum
Replies: 5
Views: 92

Re: Cumulative sum

hi, you should define an alias. Try this code
bye!

Code: Select all

Set i /1*6/;
alias(i,j)
Variables
x(i)
y(i)
;
equation
eq
;

eq(i).. sum(j$(ord(j) le ord(i)),x(j)) =l= sum(j$(ord(j) le ord(i)),y(j));
by Manassaldi
1 week ago
Forum: Syntax
Topic: Condtional statement and large positive value
Replies: 1
Views: 92

Re: Condtional statement and large positive value

hy, try this options. eq(h, j, i, k)$(ord(h) gt 1 and ord(j) gt 1 and ord(i) gt 1 and ord(k) gt 1 and not sameas(h,j)).. C(j) – AM(1-X(i,j,k)) =g= S(h,j) + Sum(o, X(i,j,o)*P(i,j)) + C(h) + V(j); or eq(h, j, i, k)$(ord(h) gt 1 and ord(j) gt 1 and ord(i) gt 1 and ord(k) gt 1 and ord(h) ne ord(j)).. C(...
by Manassaldi
1 week ago
Forum: Syntax
Topic: Is it possible to calculate an integral in GAMS?
Replies: 2
Views: 160

Re: Is it possible to calculate an integral in GAMS?

hi, i think you should use an analytic integration (if possible) otherwise make a numerical integration (like simpson rule).
by Manassaldi
1 week ago
Forum: Syntax
Topic: If Condition Over Binary Variables
Replies: 1
Views: 69

Re: If Condition Over Binary Variables

Hi, you can try a bigM decomposition. You must define a new binary variable y(t). I assume that Z(p,q,t) and n(a,t) are binary variables. if y(t)=1 then sum((p,q), Z(p,q,t) <126 (that is, less than or equal to 125) and if y(t)=0 then sum((p,q), Z(p,q,t) is not <126 (that is, greater than or equal to...
by Manassaldi
4 months ago
Forum: Archive Google Group
Topic: trigonometric functions
Replies: 8
Views: 2015

Re: trigonometric functions

That is not a GAMS valid sentence. Maybe you are confused in the way "GAMS" works. I think i can't help you
Best
by Manassaldi
4 months ago
Forum: Archive Google Group
Topic: trigonometric functions
Replies: 8
Views: 2015

Re: trigonometric functions

GAMS supports trigonometric functions.
What are the functions you have problems with?
Extrinsic functions are to implements your own functions.

Best
by Manassaldi
8 months ago
Forum: Modeling
Topic: linearization of a logarithmic function (log) defined over a variable
Replies: 1
Views: 624

Re: linearization of a logarithmic function (log) defined over a variable

Hi, the logarithmic function is a concave function so you can overestimate the function with first order Taylor approximations in domain points or underestimate using a piecewise linear approximation.
by Manassaldi
9 months ago
Forum: Syntax
Topic: How to write this constraint in GAMS Code?
Replies: 3
Views: 570

Re: How to write this constraint in GAMS Code?

Hi, I guess you have to define the set, subset and alias.

for example:

Code: Select all

sets
i /i1*i10/
v /v1*v10/
N0(i) /i1,i3,i4,i5/
;
alias(i,j);
eq(i,v)$N0(i).. sum(j$(N0(j) and ord(j) ne ord(i)),x(i,j,v)) =e= sum(j$(N0(j) and ord(j) ne ord(i)),x(j,i,v))