Code: Select all

`eq.. z =e= sum((i,j)$(ord(j) le ord(i)),x(j) - y(j)); `

- 1 day ago
- Forum: Syntax
- Topic: Cumulative sum
- Replies:
**5** - Views:
**92**

I think this can work...

bye!

Code: Select all

`eq.. z =e= sum((i,j)$(ord(j) le ord(i)),x(j) - y(j)); `

- 2 days ago
- Forum: Syntax
- Topic: Cumulative sum
- Replies:
**5** - Views:
**92**

hi, you should define an alias. Try this code

bye!

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));
```

- 1 week ago
- Forum: Syntax
- Topic: Condtional statement and large positive value
- Replies:
**1** - Views:
**92**

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(...

- 1 week ago
- Forum: Syntax
- Topic: Is it possible to calculate an integral in GAMS?
- Replies:
**2** - Views:
**160**

hi, i think you should use an analytic integration (if possible) otherwise make a numerical integration (like simpson rule).

- 1 week ago
- Forum: Contributed Documentation and Tools
- Topic: Implementation of Extrinsic Functions to Calculate Thermodynamic Properties by Juan I. Manassaldi et al.
- Replies:
**1** - Views:
**203**

Thanks for sharing. I will try to answer any question that arise in this forum.

Bye!

Bye!

- 1 week ago
- Forum: Syntax
- Topic: If Condition Over Binary Variables
- Replies:
**1** - Views:
**69**

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...

- 4 months ago
- Forum: Archive Google Group
- Topic: trigonometric functions
- Replies:
**8** - Views:
**2015**

That is not a GAMS valid sentence. Maybe you are confused in the way "GAMS" works. I think i can't help you

Best

Best

- 4 months ago
- Forum: Archive Google Group
- Topic: trigonometric functions
- Replies:
**8** - Views:
**2015**

GAMS supports trigonometric functions.

What are the functions you have problems with?

Extrinsic functions are to implements your own functions.

Best

What are the functions you have problems with?

Extrinsic functions are to implements your own functions.

Best

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

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.

- 9 months ago
- Forum: Syntax
- Topic: How to write this constraint in GAMS Code?
- Replies:
**3** - Views:
**570**

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

for example:

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))
```