Search found 7 matches
- 4 years ago
- Forum: Syntax
- Topic: The correct syntax for sum inside sum
- Replies: 2
- Views: 6428
Re: The correct syntax for sum inside sum
Thank you, Renger!
- 4 years ago
- Forum: Syntax
- Topic: The correct syntax for sum inside sum
- Replies: 2
- Views: 6428
The correct syntax for sum inside sum
Hi All, I have multiple sums as follow: \sum_{j=2}^J [ 1 - \sqrt(\sum_{l=1}^L \sum_{t=1}^T\ (sum_{k=2}^j x(k) - x(k-1))^2)]. I try to implement in GAMS as below: sum(j $ (ord(j) gt 1), (1 - sqrt(sum((l,t), power(sum(k $ (ord(k) <= ord(j) and ord(k) >= 2), x(k) - x(k-1)),2)))). Is this syntax correct...
- 4 years ago
- Forum: Syntax
- Topic: Error 148 Dimension different
- Replies: 2
- Views: 1887
Re: Error 148 Dimension different
Thank you a lot, Renger!
- 4 years ago
- Forum: Syntax
- Topic: Error 148 Dimension different
- Replies: 2
- Views: 1887
Error 148 Dimension different
I have this code, where k is the alias of j. I set j /1*10/ My intention is to write a code which is like this: for j=1:Jn for k=1:j sum = sum + k*(x(k) - x(k-1)) end end 76 utility .. f =e= In*sum(j, ((lambda*(1 - (sqrt(sum((l,t), power((y(j, l,t) - (sum(k $ (ord(k) <= ord(j) and ord(k) >= 2), k*(x...
- 6 years ago
- Forum: Syntax
- Topic: How to set upper value instead of level value
- Replies: 1
- Views: 2126
How to set upper value instead of level value
Hi All, I have an equation like this : mindelay1(i,n,m) .. dee(i,n,m) - (v*y1(n,m)) =l= z(i,n) ; or dee(i,n,1) - (v*y1(n,1)) =l= z(i,n) ; dee(i,n,2) - (v*y1(n,2)) =l= z(i,n) ; dee(i,n,3) - (v*y1(n,3)) =l= z(i,n) ; dee(i,n,4) - (v*y1(n,4)) =l= z(i,n) ; In this case, the result will set the upper valu...
- 6 years ago
- Forum: Syntax
- Topic: Error for constraint of sets
- Replies: 3
- Views: 3020
Re: Error for constraint of sets
Hi Renger,
Actually I want to limit my objective function in which the index "m" and "p" should not be equal to "n".
How to do this in GAMS syntax? I try it in equation section but those errors happened.
Actually I want to limit my objective function in which the index "m" and "p" should not be equal to "n".
How to do this in GAMS syntax? I try it in equation section but those errors happened.
- 6 years ago
- Forum: Syntax
- Topic: Error for constraint of sets
- Replies: 3
- Views: 3020
Error for constraint of sets
Dear All, I have a problem to write syntax of this simple formula "n not equal m" in equation section. This n, m are sets with n = {1,2,3} and m = {1,2,3,4}. I try to solve this problem by using this syntax to represent that n is not equal to m notequalm(m) .. m - n =g= abs(1); However, I ...