Professional Documents
Culture Documents
DataSolar=pn.read_csv('SolarData.csv')
FechaHora = Irtd['FechaHora']
Irradiancia = Irtd['Irradiancia']
Irrad2 = np.transpose(Irrad)
Len_Irrad2 = np.shape(Irrad2)
HSP = np.array([])
X = np.array([])
for j in range(Len_Irrad2[1]):
Add = 0
for i in range(Len_Irrad2[0]):
X=np.append(X,Add/Len_Irrad2[0])
HSP = X
H = np.arange(0,1440,5)
p g ( , , )
H2 = H.astype(str)
Dia = np.arange(0,365)
Dia2 = Dia.astype(str)
plt.plot(H,EB)
plt.xlabel('Tiempo [minutos]')
plt.ylabel('Irradiancia [W/m^2]')
plt.title('Curva escenario base del sistema con el dia {} con un valor HSP de {}'.format(MHSP
plt.grid(True)
plt.show()
writer = pn.ExcelWriter('Radiacion.xlsx')
DI.to_excel(writer)
writer.save()
#files.download('Radiacion.xlsx')
Irradiancia=pn.read_excel('Radiacion.xlsx')
Irrd = Irrd_Array[:,1:]
Len_Irrd = np.shape(Irrd)
HSP = np.array([])
X = np.array([])
for j in range(Len_Irrd[1]):
Add = 0
for i in range(Len_Irrd[0]):
X=np.append(X,Add/Len_Irrd[0])
HSP = X
Len_IH = np.shape(IH)
#print(Len_IH)
Day_Mean = []
for i in range(Len_IH[0]):
ADD = 0
for j in range(Len_IH[1]):
#print(Day_Mean)
#print(len(Day_Mean))
#####################################################
PS=pn.ExcelFile('Parametros.xlsx')
#print(PB)
SoC_day = []
PPD_day = []
PPV_day = []
PR_day = []
PBESS_day = []
Costo_Racionamiento = []
CO2 = []
Despacho_day = []
for t in range(len(Day_Mean)):
DM = Dem[t]
#OTROS PARAMETROS
#FUNCIÓN DE COSTO
a2 = 6.6384
b = 8953.8
c = 7.5853
Cost_PD = a2*(PPD**2)+(b*PPD)+c
Kom = 5.32
aI = 0.1453
Cost_PV = (Kom*PPV)+(aI*PPV)
#RESTRICCIONES
if t == 0:
C.append(SoC == SoC_i)
#continue
elif t == 23:
C.append(SoC == SoC_f)
#continue
# FUNCIÓN OBJETIVO
Obj=cp.Minimize(Costo)
#SOLVER
Economic_Dispatch = cp.Problem(Obj, C)
Economic_Dispatch.solve(verbose=False)
SoC_day.append(SoC.value)
PPD_day.append(PPD.value)
PPV_day.append(PPV.value)
PR_day.append(PR.value)
PBESS_day.append(PBESS.value)
Despacho_day.append(Obj.value)
Costo_Racionamiento.append(PR.value*(CR)/100)
CO2.append(PPV.value*0.1832)
print('')
print('')
print('*******************************************************************************')
print('')
print(' Resultados del despacho en el dia {}'.format(MHSP + 1))
print('')
print('*******************************************************************************')
print('')
print('')
Hour = np.arange(1,25)
Hour2 = Hour.astype(str)
df_day = pn.DataFrame({
"Hora" : Hour2,
"Pot. PV" : np.around(PPV_day,decimals=3),
"Pot. PD" : np.around(PPD_day,decimals=3),
"Pot. Bat." : np.around(PBESS_day,decimals=3),
"E.N.S" : np.around(PR_day,decimals=3),
"Compra en Bolsa" : np.around(Costo_Racionamiento,decimals=3),
"Costo Despacho" : np.around(Despacho_day,decimals=3)}) # DataFrame Resulta
print(df_day)
print('')
print('')
print('*******************************************************************************')
print('')
print('')
H = np.arange(0,24)
plt.plot(H,PPD_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia planta Diesel [kW]')
plt.title('Potencia planta Diesel en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PPV_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia del arreglo de paneles [kW]')
plt.title('Potencia del arreglo de paneles en el dia {} con un valor HSP de {}'.format(MHSP +
plt.show()
plt.plot(H,CO2)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Reducción de CO2 [kg]')
plt.title('Reducción de CO2 en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PR_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Energia no servida [kWh]')
plt.title('Energia no servida en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,Costo_Racionamiento)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Costo de racionamiento [$]')
plt.title('Costo de racionamiento en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PBESS_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia Bateria [kW]')
plt.title('Potencia Bateria en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,SoC_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Estado de carga [%]')
plt.title('Estado de carga de la bateria en el dia {}'.format(MHSP + 1))
plt.show()
p t.s o ()
*******************************************************************************
*******************************************************************************
Hora Pot. PV Pot. PD Pot. Bat. E.N.S Compra en Bolsa Costo Despacho
0 1 0.000 0.0 9.450 -0.000 -0.091 0.005
1 2 0.000 3.0 0.444 4.535 1415.088 1684.380
2 3 0.000 3.0 -0.000 4.560 1422.720 1692.010
3 4 0.000 3.0 0.000 3.300 1029.549 1298.849
4 5 0.000 3.0 -0.000 5.400 1684.798 1954.090
5 6 0.000 3.0 -0.000 7.500 2340.013 2609.303
6 7 11.760 0.0 -0.000 0.000 0.000 0.719
7 8 12.600 -0.0 -0.000 0.000 0.000 0.764
8 9 13.230 0.0 0.000 0.000 0.044 0.856
9 10 14.700 0.0 -0.000 0.000 0.000 0.879
10 11 15.960 0.0 -0.000 0.000 0.000 0.948
11 12 16.590 0.0 -0.000 0.000 0.000 0.983
12 13 16.801 -0.0 -0.000 -0.000 -0.080 0.891
13 14 15.751 -0.0 -0.000 -0.000 -0.096 0.813
14 15 13.650 0.0 0.000 0.000 0.042 0.876
15 16 13.230 0.0 -0.000 0.000 0.000 0.799
16 17 13.650 -0.0 -0.000 0.000 0.000 0.822
17 18 16.800 0.0 -0.000 0.000 0.000 0.994
18 19 21.000 -0.0 -0.000 -0.000 -0.026 1.191
19 20 0.000 3.0 0.000 18.000 5615.974 5885.279
20 21 0.000 3.0 0.000 13.800 4305.557 4574.863
21 22 0.000 3.0 -0.000 9.600 2995.228 3264.516
22 23 0.000 3.0 0.000 7.500 2340.013 2609.303
23 24 0.000 0.0 8.400 0.000 0.002 0.078
*******************************************************************************
Sistema On-Grid
Irradiancia=pn.read_excel('Radiacion.xlsx')
Irrd = Irrd_Array[:,1:]
Len_Irrd = np.shape(Irrd)
HSP = np.array([])
X = np.array([])
for j in range(Len_Irrd[1]):
Add = 0
for i in range(Len_Irrd[0]):
X=np.append(X,Add/Len_Irrd[0])
HSP = X
Len_IH = np.shape(IH)
#print(Len_IH)
Day_Mean = []
for i in range(Len_IH[0]):
ADD = 0
for j in range(Len_IH[1]):
Day Mean.append(Mean)
y_ pp ( )
#####################################################
PS=pn.ExcelFile('Parametros.xlsx')
SoC_day = []
PPD_day = []
PPV_day = []
PSIN_day = []
PBESS_day = []
Compra_Bolsa = []
CO2 = []
Despacho_day = []
for t in range(len(Day_Mean)):
DM = Dem[t]
#OTROS PARAMETROS
#DECLARACIÓN DE VARIABLES
PPD = cp.Variable() # Potencia generada PLANTA DIESEL
PPV = cp.Variable() # Potencia generada PLANTA SOLAR
PSIN = cp.Variable() # Potencia del SIN
PBESS = cp.Variable() # Potencia aportada BATERIAS
SoC = cp.Variable() # Estado de carga de las baterias
#FUNCIÓN DE COSTO
a2 = 6.6384
b = 8953.8
c = 7.5853
Cost_PD = a2*(PPD**2)+(b*PPD)+c
Kom = 5.32
aI = 0.1453
Cost_PV = (Kom*PPV)+(aI*PPV)
#RESTRICCIONES
if t == 0:
C.append(SoC == SoC_i)
#continue
elif t == 23:
C.append(SoC == SoC_f)
#continue
# FUNCIÓN OBJETIVO
Obj=cp.Minimize(Costo)
#SOLVER
Economic_Dispatch = cp.Problem(Obj, C)
Economic_Dispatch.solve(verbose=False)
SoC_day.append(SoC.value)
PPD_day.append(PPD.value)
PPV_day.append(PPV.value)
PSIN_day.append(PSIN.value)
PBESS_day.append(PBESS.value)
Despacho_day.append(Obj.value)
Compra_Bolsa.append(PSIN.value*(PB/100))
CO2.append(PPV.value*0.1832)
print('')
print('')
print('*******************************************************************************')
print('')
print(' Resultados del despacho en el dia {}'.format(MHSP + 1))
print('')
print('*******************************************************************************')
print('')
print('')
Hour = np.arange(1,25)
Hour2 = Hour.astype(str)
df_day = pn.DataFrame({
"Hora" : Hour2,
"Pot. PV" : np.around(PPV_day,decimals=3),
"Pot. PD" : np.around(PPD_day,decimals=3),
"Pot. Bat." : np.around(PBESS_day,decimals=3),
"Pot.SIN" : np.around(PSIN_day,decimals=3),
"Compra en Bolsa" : np.around(Compra_Bolsa,decimals=3),
"Costo Despacho" : np.around(Despacho_day,decimals=3)}) # DataFrame Resulta
print(df_day)
print('')
print('')
print('*******************************************************************************')
print('')
print('')
H = np.arange(0,24)
plt.plot(H,PPD_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia planta Diesel [kW]')
plt.title('Potencia planta Diesel en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PPV_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia del arreglo de paneles [kW]')
plt.title('Potencia del arreglo de paneles en el dia {} con un valor HSP de {}'.format(MHSP +
plt.show()
plt.plot(H,CO2)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Reducción de CO2 [kg]')
plt.title('Reducción de CO2 en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PSIN_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia del SIN [kW]')
plt.title('Potencia del SIN en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,Compra_Bolsa)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Costo de compra en Bolsa [$]')
plt.title('Costo de compra en Bolsa en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,PBESS_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Potencia Bateria [kW]')
plt.title('Potencia Bateria en el dia {}'.format(MHSP + 1))
plt.show()
plt.plot(H,SoC_day)
plt.xlabel('Tiempo [Horas]')
plt.ylabel('Estado de carga [%]')
plt.title('Estado de carga de la bateria en el dia {}'.format(MHSP + 1))
plt.show()
*******************************************************************************
*******************************************************************************
Hora Pot. PV Pot. PD Pot. Bat. Pot.SIN Compra en Bolsa Costo Despacho
0 1 0.00 0.0 9.450 -0.000 -0.170 -0.086
1 2 0.00 3.0 0.444 4.536 1882.253 2151.543
2 3 0.00 3.0 0.000 4.560 1892.399 2161.689
3 4 0.00 3.0 0.000 3.300 1369.462 1638.757
4 5 0.00 3.0 -0.000 5.400 2240.992 2510.284
5 6 0.00 3.0 -0.000 7.500 3112.510 3381.800
6 7 11.76 0.0 -0.000 0.000 0.000 0.719
7 8 12.60 0.0 -0.000 -0.000 -0.000 0.764
8 9 13.23 0.0 0.000 0.000 0.066 0.879
9 10 14.70 0.0 -0.000 -0.000 -0.000 0.879
10 11 15.96 0.0 -0.000 -0.000 -0.000 0.948
11 12 16.59 0.0 -0.000 0.000 0.000 0.983
12 13 16.80 0.0 0.000 0.000 0.101 1.118
13 14 15.75 0.0 -0.000 -0.000 -0.000 0.937
14 15 13.65 0.0 -0.000 -0.000 -0.000 0.822
15 16 13.23 0.0 -0.000 -0.000 -0.000 0.799
16 17 13.65 0.0 0.000 0.000 0.068 0.905
17 18 16.80 0.0 -0.000 0.000 0.000 0.994
18 19 21.00 0.0 -0.000 0.000 0.000 1.224
19 20 0.00 3.0 0.000 18.000 7470.014 7739.309
20 21 0.00 3.0 0.000 13.800 5726.904 5996.214
21 22 0.00 3.0 -0.000 9.600 3984.023 4253.312
22 23 0.00 3.0 0.000 7.500 3112.510 3381.800
23 24 0.00 0.0 8.400 0.000 0.009 0.087
*******************************************************************************
Sistema Off-Grid y con racionamiento para los 365 dias
Irrd = Irrd_Array[:,1:]
Len_Irrd = np.shape(Irrd)
SoC_year = []
PPD_year = []
PPV_year = []
PR_year = []
PBESS_year = []
Costo_Racionamiento_year = []
CO2_year= []
Costo_Despacho_year = []
Rac_total = 0
CostRac_total = 0
Costo_Despacho_total = 0
P_PV = np.zeros(shape=(24,Len_Irrd[1]))
P_PD = np.zeros(shape=(24,Len_Irrd[1]))
P_R = np.zeros(shape=(24,Len_Irrd[1]))
P_BESS = np.zeros(shape=(24,Len_Irrd[1]))
Irrad2 = Irrd[:,days]
Len_IH = np.shape(IH)
#print(Len_IH)
Day_Mean = []
for i in range(Len_IH[0]):
ADD = 0
for j in range(Len_IH[1]):
Day_Mean.append(Mean)
PS=pn.ExcelFile('Parametros.xlsx')
Load=PS.parse('Demanda') #cargar datos de nodos
#print(PB)
SoC_day = []
PPD_day = []
PPV_day = []
PR_day = []
PBESS_day = []
Costo_Racionamiento = []
CO2 = []
Costo_Despacho = []
for t in range(len(Day_Mean)):
DM = Dem[t]
#OTROS PARAMETROS
#DECLARACIÓN DE VARIABLES
a2 = 6.6384
b = 8953.8
c = 7.5853
Cost_PD = a2*(PPD**2)+(b*PPD)+c
Kom = 5.32
aI = 0.1453
Cost_PV = (Kom*PPV)+(aI*PPV)
#RESTRICCIONES
if t == 0:
C.append(SoC == SoC_i)
#continue
elif t == 23:
C.append(SoC == SoC_f)
#continue
# FUNCIÓN OBJETIVO
Obj=cp.Minimize(Costo)
#SOLVER
Economic_Dispatch = cp.Problem(Obj, C)
Economic_Dispatch.solve(verbose=False)
SoC_day.append(SoC.value)
PPD_day.append(PPD.value)
PPV_day.append(PPV.value)
PR_day.append(PR.value)
PBESS_day.append(PBESS.value)
Costo_Racionamiento.append(PR.value*(CR)/100)
CO2.append(PPV.value*0.1832)
Costo_Despacho.append(Obj.value)
P_PV[t][days] += PPV.value
P_PD[t][days] += PPD.value
P_R[t][days] += PR.value
P_BESS[t][days] += PBESS.value
SoC_year.append(sum(SoC_day))
PPD_year.append(sum(PPD_day))
PPV_year.append(sum(PPV_day))
PR_year.append(sum(PR_day))
PBESS_year.append(sum(PBESS_day))
Costo_Racionamiento_year.append(sum(Costo_Racionamiento))
CO2_year.append(sum(CO2))
Costo_Despacho_year.append(sum(Costo_Despacho))
Rac_total = sum(PR_year)
Costo_Despacho_total = sum(Costo_Despacho_year)
CostRac_total = sum(Costo_Racionamiento_year)
print('')
print('')
print('***************************************************************')
print(' Año ')
print('***************************************************************')
print('')
print('')
print('Potencia no servida ',Rac_total,' [kW] ','con un costo de ',CostRac_total,' [$]')
print('')
print(' El Costo del Despacho es: \n',Costo_Despacho_total,' [$]')
print('')
print('')
print('***************************************************************')
print('')
print('')
H = np.arange(0,365)
plt.plot(H,PPD_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia planta Diesel [kW]')
plt.title('Potencia planta Diesel año')
plt.show()
plt.plot(H,PPV_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia del arreglo de paneles [kW]')
plt.title('Potencia del arreglo de paneles en el año')
plt.show()
plt.plot(H,CO2_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Reducción de CO2 [kg]')
plt.title('Reducción de CO2 en el año')
plt.show()
plt.plot(H,PR_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Energia no servida [kWh]')
plt.title('Energia no servida en el año')
plt.show()
plt.plot(H,Costo_Racionamiento_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Costo de racionamiento [$]')
plt.title('Costo de racionamiento en el año')
plt.show()
plt.plot(H,PBESS_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia Bateria [kW]')
plt.title('Potencia Bateria en el año')
plt.show()
Len_PPV = np.shape(P_PV)
K = np arange(0 24)
K = np.arange(0,24)
for j in range(Len_PPV[1]):
X = []
for i in range(Len_PPV[0]):
X.append(P_PV[i][j])
plt.plot(K,X,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia Panel [kW]')
plt.title('Potencia Panel en el dia')
X = []
PV_Mean = []
for i in range(Len_PPV[0]):
PV_Add = []
for j in range(Len_PPV[1]):
PV_Add.append(P_PV[i][j])
PV_Mean.append(sum(PV_Add)/(len(PV_Add)))
plt.plot(K,PV_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
Len_PPD = np.shape(P_PD)
for j in range(Len_PPD[1]):
Y = []
for i in range(Len_PPD[0]):
Y.append(P_PD[i][j])
plt.plot(K,Y,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia planta diesel [kW]')
plt.title('Potencia planta diesel en el dia')
Y = []
PD_Mean = []
for i in range(Len_PPD[0]):
PD_Add = []
for j in range(Len_PPD[1]):
PD_Add.append(P_PD[i][j])
PD_Mean.append(sum(PD_Add)/(len(PD_Add)))
plt.plot(K,PD_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
Len_PR = np.shape(P_R)
for j in range(Len_PR[1]):
Z = []
for i in range(Len_PR[0]):
Z.append(P_R[i][j])
plt.plot(K,Z,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia de racionamiento [kW]')
plt.title('Potencia de racionamiento en el dia')
Z = []
PR_Mean = []
for i in range(Len_PR[0]):
PR_Add = []
for j in range(Len_PR[1]):
PR_Add.append(P_R[i][j])
PR_Mean.append(sum(PR_Add)/(len(PR_Add)))
plt.plot(K,PR_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
for j in range(Len_PBESS[1]):
V = []
for i in range(Len_PBESS[0]):
V.append(P_BESS[i][j])
plt.plot(K,V,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia de bateria [kW]')
plt.title('Potencia de bateria en el dia')
V = []
PBESS_Mean = []
for i in range(Len_PBESS[0]):
PBESS_Add = []
for j in range(Len_PBESS[1]):
PBESS_Add.append(P_BESS[i][j])
PBESS_Mean.append(sum(PBESS_Add)/(len(PBESS_Add)))
plt.plot(K,PBESS_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
***************************************************************
Año
***************************************************************
***************************************************************
Sistema On-Grid en los 365 dias
Irradiancia=pn.read_excel('Radiacion.xlsx')
Irrd = Irrd_Array[:,1:]
Len_Irrd = np.shape(Irrd)
SoC_year = []
PPD_year = []
PPV_year = []
PSIN_year = []
PBESS_year = []
Compra_Bolsa_year = []
CO2_year= []
Costo_Despacho_year = []
Rac_total = 0
CostRac_total = 0
Costo_Despacho_total = 0
P_PV = np.zeros(shape=(24,Len_Irrd[1]))
P_PD = np.zeros(shape=(24,Len_Irrd[1]))
P_SIN = np.zeros(shape=(24,Len_Irrd[1]))
P_BESS = np.zeros(shape=(24,Len_Irrd[1]))
Irrad2 = Irrd[:,days]
Len_IH = np.shape(IH)
#print(Len_IH)
Day_Mean = []
for i in range(Len_IH[0]):
ADD = 0
for j in range(Len_IH[1]):
Day_Mean.append(Mean)
PS=pn.ExcelFile('Parametros.xlsx')
#print(PB)
SoC_day = []
PPD_day = []
PPV_day = []
PSIN_day = []
PBESS_day = []
Compra_Bolsa = []
CO2 = []
Costo_Despacho = []
for t in range(len(Day_Mean)):
DM = Dem[t]
#OTROS PARAMETROS
#DECLARACIÓN DE VARIABLES
PPD = cp.Variable() # Potencia generada PLANTA DIESEL
PPV = cp.Variable() # Potencia generada PLANTA SOLAR
PSIN = cp.Variable() # Potencia de racionamiento
PBESS = cp.Variable() # Potencia aportada BATERIAS
SoC = cp.Variable() # Estado de carga de las baterias
#FUNCIÓN DE COSTO
a2 = 6.6384
b = 8953.8
c = 7.5853
Cost_PD = a2*(PPD**2)+(b*PPD)+c
Kom = 5.32
aI = 0.1453
Cost_PV = (Kom*PPV)+(aI*PPV)
#RESTRICCIONES
if t == 0:
C.append(SoC == SoC_i)
#continue
elif t == 23:
C.append(SoC == SoC_f)
#continue
# FUNCIÓN OBJETIVO
Obj=cp.Minimize(Costo)
#SOLVER
Economic_Dispatch = cp.Problem(Obj, C)
Economic_Dispatch.solve(verbose=False)
SoC_day.append(SoC.value)
PPD_day.append(PPD.value)
PPV_day.append(PPV.value)
PSIN_day.append(PSIN.value)
PBESS_day.append(PBESS.value)
Compra_Bolsa.append(PSIN.value*(PB)/100)
CO2.append(PPV.value*0.1832)
Costo_Despacho.append(Obj.value)
P_PV[t][days] += PPV.value
P_PD[t][days] += PPD.value
P_SIN[t][days] += PSIN.value
P_BESS[t][days] += PBESS.value
SoC_year.append(sum(SoC_day))
PPD_year.append(sum(PPD_day))
PPV_year.append(sum(PPV_day))
PSIN_year.append(sum(PSIN_day))
PBESS_year.append(sum(PBESS_day))
Compra_Bolsa_year.append(sum(Compra_Bolsa))
CO2_year.append(sum(CO2))
Costo_Despacho_year.append(sum(Costo_Despacho))
PSIN_total = sum(PSIN_year)
Costo_Despacho_total = sum(Costo_Despacho_year)
CompBolsa_total = sum(Compra_Bolsa_year)
print('')
print('')
print( )
print('***************************************************************')
print(' Año ')
print('***************************************************************')
print('')
print('')
print('Potencia del SIN ',PSIN_total,' [kW] ','con un costo de ',CompBolsa_total,' [$]')
print('')
print(' El Costo del Despacho es: \n',Costo_Despacho_total,' [$]')
print('')
print('')
print('***************************************************************')
print('')
print('')
H = np.arange(0,365)
plt.plot(H,PPD_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia planta Diesel [kW]')
plt.title('Potencia planta Diesel año')
plt.show()
plt.plot(H,PPV_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia del arreglo de paneles [kW]')
plt.title('Potencia del arreglo de paneles en el año')
plt.show()
plt.plot(H,CO2_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Reducción de CO2 [kg]')
plt.title('Reducción de CO2 en el año')
plt.show()
plt.plot(H,PSIN_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia comprada al SIN [kW]')
plt.title('Potencia comprad al SIN al año')
plt.show()
plt.plot(H,Compra_Bolsa_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Costo de compra en bolsa [$]')
plt.title('Costo de compra en bolsa en el año')
plt.show()
plt.plot(H,PBESS_year)
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia Bateria [kW]')
plt.title('Potencia Bateria en el año')
plt.show()
# Curva promedio año para potencia de paneles
Len_PPV = np.shape(P_PV)
K = np.arange(0,24)
for j in range(Len_PPV[1]):
X = []
for i in range(Len_PPV[0]):
X.append(P_PV[i][j])
plt.plot(K,X,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia Panel [kW]')
plt.title('Potencia Panel en el dia')
X = []
PV_Mean = []
for i in range(Len_PPV[0]):
PV_Add = []
for j in range(Len_PPV[1]):
PV_Add.append(P_PV[i][j])
PV_Mean.append(sum(PV_Add)/(len(PV_Add)))
plt.plot(K,PV_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
Len_PPD = np.shape(P_PD)
for j in range(Len_PPD[1]):
Y = []
for i in range(Len_PPD[0]):
Y.append(P_PD[i][j])
plt.plot(K,Y,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia planta diesel [kW]')
p y ( p [ ] )
plt.title('Potencia planta diesel en el dia')
Y = []
PD_Mean = []
for i in range(Len_PPD[0]):
PD_Add = []
for j in range(Len_PPD[1]):
PD_Add.append(P_PD[i][j])
PD_Mean.append(sum(PD_Add)/(len(PD_Add)))
plt.plot(K,PD_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
Len_PSIN = np.shape(P_SIN)
for j in range(Len_PSIN[1]):
Z = []
for i in range(Len_PSIN[0]):
Z.append(P_SIN[i][j])
plt.plot(K,Z,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia del SIN [kW]')
plt.title('Potencia a comprar en el SIN')
Z = []
PSIN_Mean = []
for i in range(Len_PSIN[0]):
PSIN_Add = []
for j in range(Len_PSIN[1]):
PSIN_Add.append(P_SIN[i][j])
PSIN_Mean.append(sum(PSIN_Add)/(len(PSIN_Add)))
plt.show()
Len_PBESS = np.shape(P_BESS)
for j in range(Len_PBESS[1]):
V = []
for i in range(Len_PBESS[0]):
V.append(P_BESS[i][j])
plt.plot(K,V,color='grey')
plt.xlabel('Tiempo [dia]')
plt.ylabel('Potencia de bateria [kW]')
plt.title('Potencia de bateria en el dia')
V = []
PBESS_Mean = []
for i in range(Len_PBESS[0]):
PBESS_Add = []
for j in range(Len_PBESS[1]):
PBESS_Add.append(P_BESS[i][j])
PBESS_Mean.append(sum(PBESS_Add)/(len(PBESS_Add)))
plt.plot(K,PBESS_Mean,'g--d',color='blue',linewidth=2.0)
plt.show()
***************************************************************
Año
***************************************************************
***************************************************************