Exemple #1
0
def test_settemp_cell():
    """
    Test setTemp method for a wide range of temperatures. 
    Test added after implementing Isat2 as Isat2(Tcell)
    """
    pvc = PVcell()
    Pmp_arr = []
    Vmp_arr = []
    Voc_arr = []
    Isc_arr = []
    
    temps = [-85, -60, -40, -25, 0, 25, 40, 60, 85]
    for t in temps:
        pvc.Tcell = float(t) + 273.15
        Pmp_arr.append(pvc.Pcell.max())
        Vmp_arr.append(pvc.Vcell[pvc.Pcell.argmax()])
        Voc_arr.append(pvc.calcVcell(0))
        Isc_arr.append(pvc.Isc)
        
    assert(np.all(np.gradient(np.squeeze(Vmp_arr)) < 0))
    assert(np.all(np.gradient(np.squeeze(Voc_arr)) < 0))
    assert(np.all(np.gradient(Isc_arr) > 0))
        
Exemple #2
0
def test_pvcell_calc_vcell():
    pvc = PVcell()
    ok_(np.isclose(pvc.Vcell[123], pvc.calcVcell(pvc.Icell[123]), 1e-4))
    ok_(np.isclose(pvc.Vcell[153], pvc.calcVcell(pvc.Icell[153]), 1e-4))
    ok_(np.isclose(pvc.Vcell[183], pvc.calcVcell(pvc.Icell[183])))