Search found 639 matches

by Renger
5 years ago
Forum: Syntax
Topic: put command
Replies: 5
Views: 4174

Re: put command

Hi Why use the put command to write to Excel. The best tool for doing this is gdxxrw: Net9(i,f,t)$(Ainc(i,f)=1) .. K(i,t) =e= sum(j$(Ainc(j,f)=-1),K(j,t)) + 2*((R(f)/Zbase)*(P_line(f,t)/Sbase) + (X(f)/Zbase)*(Q_line(f,t)/Sbase)); parameter eq_net9(*,i,f,t); loop(f, eq_net9("K", i,f,t) = K....
by Renger
5 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 313481

Re: Loop for objective function

Hi You should rewrite the set j from your model and treat the variables and parameters independent of j. Here an example: set j /1*2/; parameter p(j) Parameter defined over j, pj Scalar to be used in the loop to replace p; p(j) = ord(j); variable OBJ,X; equation objective, eq1; objective.. OBJ =E= x...
by Renger
5 years ago
Forum: Syntax
Topic: FORMULATION
Replies: 0
Views: 2531

Re: FORMULATION

Hi
How about this:

Code: Select all

alias(i,j);
equations
     eq1(i,k)
     eq2(i,k);
     
 eq1(i,k)..
    sum(j, x(i,j,k)) =E= sum(j, x(j,i,k));
 eq2(i,k)..
    sum(j, x(i,j,k)) =E= y(i,k);   
    
Cheers
Renger
by Renger
5 years ago
Forum: Syntax
Topic: writing equation problem
Replies: 1
Views: 2781

Re: writing equation problem

Hi

If the 1 in your equation is a set element, you should quote it (set elements that are numbers are treated as strings). Futhermore, the equal sign in equations is =E=.

X(i,"1") =E= 0;

Cheers
Renger
by Renger
5 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 313481

Re: Loop for objective function

Hi Just remove the index from the objective and save the results in a parameter Set j/1*52/ obj.. z=e= L('1') other constraints.. ( some of them still runs for every j) parameter results(j,*); MODEL test_data /ALL/ ; loop(j, SOLVE test_data USING NLP MINIMIZING z; results(j,"Objective") = ...
by Renger
5 years ago
Forum: Syntax
Topic: Cannot Import Data from Excel
Replies: 2
Views: 4551

Re: Cannot Import Data from Excel

Hi In your excel sheet, your data is organized as follows: P1 P2 P3 TIMES [H] QTY DOMINIO 0 1 0 1.983333333 210 pp1 0 1 0 1.983333333 182 pp2 1 0 0 1.983333333 628 pp3 1 0 0 1.983333333 838 pp4 Gams expects the indices in the first columns and/or rows, so you have to move DOMINIO to the first column...
by Renger
5 years ago
Forum: Solvers
Topic: same results with different simulations
Replies: 1
Views: 9295

Re: same results with different simulations

Hi
Hard to say without the code.
You could display your tax parameter as used in your equations direct after the solve, to see if it really has the value you intended.
Otherwise, send the code.
Cheers
Renger
by Renger
5 years ago
Forum: Syntax
Topic: .inc files
Replies: 13
Views: 17942

Re: .inc files

Hi Everything works fine. You might be thinking that it doesn't work because the checking takes some time. Just try to read in a parameter in excel that fills a complete sheet, then you will notice the difference. $call gdxxrw.exe i=input.xlsx set=d rng=dem_price!a2 rdim=1 cdim=0 CheckDate $gdxin in...
by Renger
5 years ago
Forum: Archive Google Group
Topic: Looping over file names
Replies: 29
Views: 30662

Re: Looping over file names

Why don't you define these values before starting the put commands
Something like:

Code: Select all

loop(i$(i.tl > 2017),
    qpa(KVAR,AKM,BKM,ALDER, KOEN,HUD,i+1) = qpa(KVAR,AKM,BKM,ALDER, KOEN,HUD,i+1);
    );
Cheers
Renger
by Renger
5 years ago
Forum: Syntax
Topic: .inc files
Replies: 13
Views: 17942

Re: .inc files

Hi
It should be written at the end of the line and correctly spelled: not "checkdate" but CheckDate.
If this doesn't work, please send an excel sheet and the code that doesn't work.
Cheers
Renger