Search found 639 matches
- 3 years ago
- Forum: Modeling
- Topic: Linearisation of Bilinear Terms Using McCormick Envelopes
- Replies: 1
- Views: 2596
Re: Linearisation of Bilinear Terms Using McCormick Envelopes
Hi If you sum over f in your equations, the equation can't have the index f in it. z(n,i,f) =E= q*sum(f, stream(n,i, f)); Relax1(n,i,f).. z(n,i,f) =E= q*sum(f, stream(n,i, f)) should then be variable z(n,i) equations eq3(n,i), relax1(n,i); eq3.. z(n,i) =E= q*sum(f, stream(n,i, f)); Relax1(n,i).. z(n...
- 3 years ago
- Forum: Syntax
- Topic: SET or PARAMETER
- Replies: 2
- Views: 3212
Re: SET or PARAMETER
Hi
It looks like a newer feature as it runs fine with Gams 30.2.
Cheers
Renger
It looks like a newer feature as it runs fine with Gams 30.2.
Cheers
Renger
- 3 years ago
- Forum: Syntax
- Topic: Set definition variable number of elements
- Replies: 2
- Views: 2098
- 3 years ago
- Forum: Syntax
- Topic: how to write the row of sets
- Replies: 11
- Views: 5910
Re: remove the duplicate item
Hi
Use the same logic for i and k for b(j,i,k):
Cheers
Renger
Use the same logic for i and k for b(j,i,k):
Code: Select all
b(j,i,k)$(ord(i) ne ord(k) .....)
Renger
- 3 years ago
- Forum: Syntax
- Topic: looping solve statement over time set
- Replies: 4
- Views: 5516
Re: looping solve statement over time set
Hi You could introduce two positive variables Rn, Qn and add the following equations: positive variables Rn Reserve in next period, Qn ....; eqR.. Rn =E= R + beta_c_E*(x2 + x6) - beta_d_E * x9; eqQ.. Qn =E= Q + beta_c_T*(QchST + sum(i,k1(i) * x11(i)))- sum(i, beta_d_T*x12(i)); After the solve, you a...
- 3 years ago
- Forum: Syntax
- Topic: looping solve statement over time set
- Replies: 4
- Views: 5516
Re: looping solve statement over time set
Hi It looks like you want to model a recursive model, where the values of R and Q for the next period are defined using the actual period. You have to do the following to be able to run over t. You keep your original parameters but define new parameters for the model without a time index. E.g. you r...
- 3 years ago
- Forum: Modeling
- Topic: Creating diferent instances with changing parameters
- Replies: 1
- Views: 1889
Re: Creating diferent instances with changing parameters
Hi Sorry for being not clear enough. If your data looks like this *HOMO hc(k) euro per unit /k0 0, k1 0.05,k2 0.05,k3 0.05/ pq(k) kW /k0 1, k1 162.72, k2 162.72, k3 162.72/ *TO HETERO *hc(k) euro per unit /k0 0, k1 0.025,k2 0.05,k3 0.075/ *pq(k) kW /k0 1, k1 81.36, k2 162.72, k3 244.08/ Then, I woul...
- 3 years ago
- Forum: Modeling
- Topic: Error 149 - Uncontrolled Set Entered As Constant
- Replies: 1
- Views: 1558
Re: Error 149 - Uncontrolled Set Entered As Constant
Hi
I am not sure, if this is what you want to achieve:
Cheers
Renger
I am not sure, if this is what you want to achieve:
Code: Select all
alias(b,bb);
eq(b,c).. SUM((a,bb), f1(a,bb,c)) =e= SUM (a, f2(a,b))
Renger
- 3 years ago
- Forum: Modeling
- Topic: How do I set the values of a multidimensional parameter step by step (to implement a cutting plane approach)?
- Replies: 1
- Views: 1505
Re: How do I set the values of a multidimensional parameter step by step (to implement a cutting plane approach)?
Hi You could define a set i for the number of iterations. ALthough you don't know the maximum number of iterations, you can set it to a very high number, e.g.: set i Iterations /1*1000/ Then you can use your assignment as follows: parameter itnr Iteration number /0/; while(... itnr = itnr + 1; .... ...
- 3 years ago
- Forum: Modeling
- Topic: should I use a loop in calculate standard deviation
- Replies: 1
- Views: 1626
Re: should I use a loop in calculate standard deviation
Hi Sandy
See my answer to your other post regarding ord(k-1).
To sum, you should sum over an alias as the equation is defined over k.
CHeers
Renger
See my answer to your other post regarding ord(k-1).
To sum, you should sum over an alias as the equation is defined over k.
Code: Select all
alias(k,kk)
sum(kk, ....)
Renger