I have the next model:
#Conjuntos
set PL;
set CD;
set ZC;
set PROD;
set PERIODO;
#parámetros
param WACC >=0;
param PRICE {PROD,ZC,PERIODO}>=0;
param PRCOST {PROD,PL,PERIODO}>=0;
param FLTPCD {PROD,PL,CD,PERIODO} >=0;
param FLTCDZC {PROD,CD,ZC,PERIODO} >=0;
param OPCOSTP {PL,PERIODO} >=0;
param OPCOSTCD {CD,PERIODO} >=0;
param TD>=0;
param INVP {PL,PERIODO}>=0;
param INVCD {CD,PERIODO}>=0;
param TAX {PERIODO}>=0;
param DEMANDA {PROD,ZC,PERIODO}>=0;
param CAPP {PL} >=0;
param CAPCD {CD} >=0;
param tasa{PERIODO}>=0;
variables
var ingresos {t in PERIODO} >=0;
var totalcost {t in PERIODO} >=0;
var depreciacion {t in PERIODO}>=0;
var prcost {t in PERIODO}>=0;
var trcost {t in PERIODO} >=0;
var opcost {t in PERIODO}>=0;
var ppe {t in PERIODO}>=0;
var fai {t in PERIODO}>=0;
var pcdflow {p in PROD, i in PL, j in CD, t in PERIODO} >=0;
var cdzcflow {p in PROD, j in CD, k in ZC, t in PERIODO}>=0;
var w {i in PL, t in PERIODO} binary;
var x {j in CD, t in PERIODO} binary;
var UtilOperat >=0;
var Utiliddw{t in PERIODO} >= 0;
#función objetivo
maximize Descontado:
sum{t in PERIODO}((ingresos[t]-totalcost[t])/tasa[t]);
subject to calculo_ingresos {t in PERIODO}:
ingresos[t] = sum{p in PROD, j in CD, k in ZC}cdzcflow[p,j,k,t]*PRICE[p,k,t];
subject to utilidad_operativa:
UtilOperat = sum{t in PERIODO}(ingresos[t]-totalcost[t]);
#################################################
subject to calculomes {t in PERIODO}:
Utiliddw[t] = (ingresos[t]-totalcost[t]);
###################################################
subject to calculo_prcost {t in PERIODO}:
prcost[t] = sum {p in PROD, i in PL, j in CD} pcdflow[p,i,j,t]*PRCOST[p,i,t];
subject to calculo_trcost{t in PERIODO}:
trcost[t] = sum {p in PROD, i in PL, j in CD}(pcdflow[p,i,j,t]*FLTPCD[p,i,j,t]) + sum{p in PROD, j in CD, k in ZC}(cdzcflow[p,j,k,t]*FLTCDZC[p,j,k,t]);
subject to calculo_opcost{t in PERIODO}:
opcost[t] = sum {i in PL} (OPCOSTP[i,t]*w[i,t]) + sum {j in CD}(OPCOSTCD[j,t]*x[j,t]);
subject to calculo_totalcost {t in PERIODO}:
totalcost[t] = opcost[t] + trcost [t]+ prcost[t];
subject to depreciacion_ini:
depreciacion[1]=0;
subject to calculo_depreciacion {t in PERIODO: t>1 }:
depreciacion[t] = ppe[t-1]*TD;
subject to ppe_ini:
ppe[1]=fai[1];
subject to calculo_ppe {t in PERIODO: t>1}:
ppe[t] = ppe[t-1] + fai[t];
subject to fai_ini:
fai[1]= sum {i in PL}(INVP[i,1]*w[i,1]) + sum{j in CD} (INVCD[j,1]*x[j,1]);
subject to calculo_fai { t in PERIODO: t>1}:
fai[t]= sum {i in PL}( INVP[i,t](w[i,t]-w[i,t-1]) ) + sum{j in CD} ( INVCD[j,t](x[j,t]-x[j,t-1]) );
subject to cappl {i in PL, t in PERIODO}:
sum {p in PROD, j in CD} pcdflow [p,i,j,t] <= CAPP[i]*w[i,t];
subject to capcd {j in CD, t in PERIODO}:
sum {p in PROD, i in PL} pcdflow [p,i,j,t] <= CAPCD[j]*x[j,t];
subject to demanda {p in PROD, k in ZC, t in PERIODO}:
sum {j in CD} cdzcflow[p,j,k,t] = DEMANDA[p,k,t];
subject to balance {p in PROD,j in CD, t in PERIODO}:
sum { i in PL} pcdflow[p,i,j,t] = sum { k in ZC} cdzcflow[p,j,k,t];
subject to cd_abierta {j in CD, t in PERIODO: t>1}:#si el CD abre se mantiene abierto
x[j,t-1] <= x[j,t];
subject to pl_abierta {i in PL, t in PERIODO: t>1}:#Si la planta abre se mantiene abierta
w[i,t-1] <= w[i,t];
#subject to num_bodegas {t in PERIODO}:
#sum {j in CD} x[j,t] = 2;
When I print the results the following appears:
ingresos [*] :=
1 1000000000.0
2 1000000000.0
3 2000000000.0
;
totalcost [*] :=
1 1000000000.0
2 1000000000.0
3 1000000000.0
;
Utiliddw [*] :=
1 200000000.0
2 200000000.0
3 200000000.0
;
Why does Utiliddw show a value of 200000000.0 when it should show the result of 1000000000.0-1000000000.0 = 0. I greatly appreciate any help you can give me.