## variety of solutions in one GDX/Excel Sheet

TheBebbo
User
Posts: 16
Joined: 8 months ago

### variety of solutions in one GDX/Excel Sheet

Hi guys!

I solved a optimization problem for 20 different units of time by using a loop. Is it possible to create one GDX for all 20 solutions? Respectively to transfer all of them to one excel sheet?

Best Greetings
TheBebbo

bussieck
Moderator
Posts: 859
Joined: 6 years ago

### Re: variety of solutions in one GDX/Excel Sheet

If you already have a loop, copy the solution into a report parameter with an additional index (the loop index) and then export the GDX/Excel:

Code: Select all

``````...
set s / s1*s10/; parameter xl(s,i,j);
loop(s,
solve mymodel min z us lp;
xl(s,i,j) = x.l(i,j);
);
``````
-Michael

TheBebbo
User
Posts: 16
Joined: 8 months ago

### Re: variety of solutions in one GDX/Excel Sheet

Sets
t/1*8760/
Y/1*20/;

Parameters;
P_strom(t)
......

Variable
G Objective function
Charge(t)
Discharge(t)

Model Test Gewinnmaximierung PV-BSS System /all/;
Solve Test using LP max G;

loop(y, Solve Test using LP max G; P_Strom(t) = P_strom(t) * 1.02; Age=Age * 0.9883; PV_Erzeugung(t) = PV_Erzeugung(t) * 0.9945 )

This is only a part of my code.
I get one solution with a GDX file for every y with all values I need. How can I get all these values in one GDX file or Excel sheet.

Best greetings
TheBebbo

bussieck
Moderator
Posts: 859
Joined: 6 years ago

### Re: variety of solutions in one GDX/Excel Sheet

Why does the solution proposed in my previous answer not work for you? -Michael