SunPower / PVMismatch

An explicit Python PV system IV & PV curve trace calculator which can also calculate mismatch.
http://sunpower.github.io/PVMismatch/
BSD 3-Clause "New" or "Revised" License
79 stars 30 forks source link

Bypassdiode not working properly #159

Closed AugustVan closed 5 months ago

AugustVan commented 7 months ago

I am currently testing the module I created with the code below. In doing so, I have divided the module I am using into 6 different parts, each of which has its own irradiance value. This allows me to test the bypass diodes. To verify that the I-V and P-V curves I get from this code are correct, I compare them to the curves I get from a program called LTSpice where I test the same module as well. Now the problem is that when I adjust the fourth irradiance value in my code, the bypass diode is not activated here. While it should be activated here as shown in the images below. If I adjust the other irradiance values, the I-V and P-V curves are correct. Is there something I need to change for the bypassdiodes?

Results:

PVmismatch: image LTSpice: image

PVmodule:

image

Code:

import pvmismatch as pvm import numpy as np import seaborn as sns import pandas as pd import csv

x = [500, 1000, 1000, 500, 1000, 1000] #irradiance values

indices_values = { 1: x[0], 2: x[0], 7: x[0], 8: x[0], 13: x[0], 14: x[0], 19: x[0], 20: x[0], 25: x[0], 26: x[0], 31: x[0], 32: x[0], 37: x[0], 38: x[0], 43: x[0], 44: x[0], 49: x[0], 50: x[0], 55: x[0], 56: x[0], 61: x[0], 62: x[0], 3: x[1], 4: x[1], 9: x[1], 10: x[1], 15: x[1], 16: x[1], 21: x[1], 22: x[1], 27: x[1], 28: x[1], 33: x[1], 34: x[1], 39: x[1], 40: x[1], 45: x[1], 46: x[1], 51: x[1], 52: x[1], 57: x[1], 58: x[1], 63: x[1], 64: x[1], 5: x[2], 6: x[2], 11: x[2], 12: x[2], 17: x[2], 18: x[2], 23: x[2], 24: x[2], 29: x[2], 30: x[2], 35: x[2], 36: x[2], 41: x[2], 42: x[2], 47: x[2], 48: x[2], 53: x[2], 54: x[2], 59: x[2], 60: x[2], 65: x[2], 66: x[2], 67: x[3], 68: x[3], 73: x[3], 74: x[3], 79: x[3], 80: x[3], 85: x[3], 86: x[3], 91: x[3], 92: x[3], 97: x[3], 98: x[3], 103: x[3], 104: x[3], 109: x[3], 110: x[3], 115: x[3], 116: x[3], 121: x[3], 122: x[3], 127: x[3], 128: x[3], 69: x[4], 70: x[4], 75: x[4], 76: x[4], 81: x[4], 82: x[4], 87: x[4], 88: x[4], 93: x[4], 94: x[4], 99: x[4], 100: x[4], 105: x[4], 106: x[4], 111: x[4], 112: x[4], 117: x[4], 118: x[4], 123: x[4], 124: x[4], 129: x[4], 130: x[4], 71: x[5], 72: x[5], 77: x[5], 78: x[5], 83: x[5], 84: x[5], 89: x[5], 90: x[5], 95: x[5], 96: x[5], 101: x[5], 102: x[5], 107: x[5], 108: x[5], 113: x[5], 114: x[5], 119: x[5], 120: x[5], 125: x[5], 126: x[5], 131: x[5], 132: x[5] }

df = pd.DataFrame({'Wm2Back': [indices_values.get(i) for i in range(1, 133)]})

df.to_csv('C:/Users/Gebruiker/Documents/school/iiw4_MA1/bifacial_radiance/TEMP/irradiance_test.csv', index=False)

stdpl=np.array( [76, 77, 98, 99, 120, 121, 75, 78, 97, 100, 119, 122, 74, 79, 96, 101, 118, 123, 73, 80, 95, 102, 117, 124, 72, 81, 94, 103, 116, 125, 71, 82, 93, 104, 115, 126, 70, 83, 92, 105, 114, 127, 69, 84, 91, 106, 113, 128, 68, 85, 90, 107, 112, 129, 67, 86, 89, 108, 111, 130, 66, 87, 88, 109, 110, 131, 0, 21, 22, 43, 44, 65, 1, 20, 23, 42, 45, 64, 2, 19, 24, 41, 46, 63, 3, 18, 25, 40, 47, 62, 4, 17, 26, 39, 48, 61, 5, 16, 27, 38, 49, 60, 6, 15, 28, 37, 50, 59, 7, 14, 29, 36, 51, 58, 8, 13, 30, 35, 52, 57, 9, 12, 31, 34, 53, 56, 10, 11, 32, 33, 54, 55])

array = np.arange(132)

STD132 = crosstied_cellpos_pat([22, 22, 22], 2, partial=True)

lengte = len(stdpl) print(lengte) cell_pos = pvm.pvmodule.STD132 pvmod=pvm.pvmodule.PVmodule(cell_pos=cell_pos) pvsys_back = pvm.PVsystem(numberStrs=1, numberMods=1, pvmods=pvmod)

print(stdpl)

with open('C:/Users/Gebruiker/Documents/school/iiw4_MA1/bifacial_radiance/TEMP/irradiance_test.csv', newline='') as csvfile: reader = csv.DictReader(csvfile) Wm2Back = "Wm2Back" Wm2Back = [float(row[Wm2Back])/790 for row in reader]

print(Wm2Back)

Ee={0: {0: {'cells': stdpl, 'Ee': Wm2Back}}} pvsys_back.setSuns(Ee) print ("Pmp: %f [W], Eff: %f [%%], FF: %f [%%]" % (pvsys_back.Pmp, pvsys_back.eff 100., pvsys_back.FF 100.)) print ("Imp: %f [A], Vmp: %f [V], Isc: %f [A], Voc: %f [V]" % (pvsys_back.Imp, pvsys_back.Vmp, pvsys_back.Isc, pvsys_back.Voc)) PowerDetailed=pvsys_back.Pmp
pvsys_back.plotSys()

Kind regards

August