Я пытаюсь поиграть с GLPK и языком mathprog. Я пытаюсь реализовать простую модель для хранения воды (просто турбины, без насосов). Но я получаю неосмотрительность.GLPK Hydro Storage - Непобедимость
Залить исходные условия, это должно быть осуществимо.
Вот код:
set T;
#========================================================
# Time Series
# Price
param price{i in T};
# Inflow
param inflow{i in T};
#========================================================
# Unit description
param release_max>=0;
param release_min>=0;
param fill_max>=0;
param fill_min>=0;
param fill_start>=0;
param fill_end>=0;
#========================================================
# optimization variables
var release{i in T}>=0;
var fill{i in T}, >=fill_min, <=fill_max;
# objective: Maximize profit
maximize obj: sum{i in T} price[i] * release[i];
s.t. fill_current {i in T: i>1}:
fill[i] = fill[i-1] - release[i] + inflow[i];
s.t. fill_con_start {i in T: i=1}:
fill[i] = fill_start;
s.t. fill_con_end {i in T: i=card(T)}:
fill[i]>=fill_end;
solve;
data;
param release_max:=100;
param release_min:=0;
param fill_max:=10000;
param fill_min:=0;
param fill_start:=5000;
param fill_end:=5000;
param : T : price inflow :=
0 15 150
1 17 170
2 18 180
3 22 220
4 55 550
5 40 400
6 65 650
7 10 100
8 12 120
9 4 40
;
end;
Вот результат:
GLPSOL: GLPK LP/MIP Solver, v4.55
Parameter(s) specified in the command line:
--cover --clique --gomory --mir -m Hydro_test.mod
Reading model section from Hydro_test.mod...
Reading data section from Hydro_test.mod...
58 lines were read
Generating obj...
Generating fill_current...
Generating fill_con_start...
Generating fill_con_end...
Model has been successfully generated
GLPK Simplex Optimizer, v4.55
10 rows, 19 columns, 35 non-zeros
Preprocessing...
PROBLEM HAS NO DUAL FEASIBLE SOLUTION
Time used: 0.0 secs
Memory used: 0.1 Mb (102683 bytes)
>Exit code: 0 Time: 0.316
Может кто-нибудь помочь мне?