4
4
import os
5
5
import pvl_tools
6
6
import scipy
7
+ import urllib2
7
8
from scipy .special import lambertw
8
9
9
10
@@ -855,8 +856,8 @@ def sapm(Module,Eb,Ediff,Tcell,AM,AOI):
855
856
AMcoeff = [var .Module ['A4' ],var .Module ['A3' ],var .Module ['A2' ],var .Module ['A1' ],var .Module ['A0' ]]
856
857
AOIcoeff = [var .Module ['B5' ],var .Module ['B4' ],var .Module ['B3' ],var .Module ['B2' ],var .Module ['B1' ],var .Module ['B0' ]]
857
858
858
- F1 = Np .polyval (AMcoeff ,var .AM )
859
- F2 = Np .polyval (AOIcoeff ,var .AOI )
859
+ F1 = np .polyval (AMcoeff ,var .AM )
860
+ F2 = np .polyval (AOIcoeff ,var .AOI )
860
861
var .Ee = F1 * ((var .Eb * F2 + var .Module ['FD' ]* var .Ediff )/ E0 )
861
862
#var['Ee']=F1*((var.Eb+var.Ediff)/E0)
862
863
#print "Ee modifed, revert for main function"
@@ -872,9 +873,9 @@ def sapm(Module,Eb,Ediff,Tcell,AM,AOI):
872
873
DFOut ['Imp' ]= var .Module .ix ['Impo' ]* ((var .Module .ix ['C0' ]* (var .Ee ) + var .Module .ix ['C1' ] * (var .Ee ** 2 )))* ((1 + var .Module .ix ['Aimp' ]* ((var .Tcell - T0 ))))
873
874
Bvoco = var .Module .ix ['Bvoco' ] + var .Module .ix ['Mbvoc' ]* ((1 - var .Ee ))
874
875
delta = var .Module .ix ['N' ]* (k )* ((var .Tcell + 273.15 )) / q
875
- DFOut ['Voc' ]= (var .Module .ix ['Voco' ] + var .Module .ix ['#Series' ]* (delta )* (Np .log (var .Ee )) + Bvoco * ((var .Tcell - T0 )))
876
+ DFOut ['Voc' ]= (var .Module .ix ['Voco' ] + var .Module .ix ['#Series' ]* (delta )* (np .log (var .Ee )) + Bvoco * ((var .Tcell - T0 )))
876
877
Bvmpo = var .Module .ix ['Bvmpo' ] + var .Module .ix ['Mbvmp' ]* ((1 - var .Ee ))
877
- DFOut ['Vmp' ]= (var .Module .ix ['Vmpo' ] + var .Module .ix ['C2' ]* (var .Module .ix ['#Series' ])* (delta )* (Np .log (var .Ee )) + var .Module .ix ['C3' ]* (var .Module .ix ['#Series' ])* ((delta * (Np .log (var .Ee ))) ** 2 ) + Bvmpo * ((var .Tcell - T0 )))
878
+ DFOut ['Vmp' ]= (var .Module .ix ['Vmpo' ] + var .Module .ix ['C2' ]* (var .Module .ix ['#Series' ])* (delta )* (np .log (var .Ee )) + var .Module .ix ['C3' ]* (var .Module .ix ['#Series' ])* ((delta * (np .log (var .Ee ))) ** 2 ) + Bvmpo * ((var .Tcell - T0 )))
878
879
DFOut ['Vmp' ][DFOut ['Vmp' ]< 0 ]= 0
879
880
DFOut ['Pmp' ]= DFOut .Imp * DFOut .Vmp
880
881
DFOut ['Ix' ]= var .Module .ix ['IXO' ] * (var .Module .ix ['C4' ]* (var .Ee ) + var .Module .ix ['C5' ]* ((var .Ee ) ** 2 ))* ((1 + var .Module .ix ['Aisc' ]* ((var .Tcell - T0 ))))
@@ -992,7 +993,8 @@ def sapmcelltemp(E, Wspd, Tamb,modelt='Open_rack_cell_glassback',**kwargs):
992
993
993
994
Tcell = Tmodule + var .E / E0 * (deltaT )
994
995
995
- return Tcell , Tmodule
996
+ return pd .DataFrame ({'Tcell' :Tcell ,'Tmodule' :Tmodule })
997
+
996
998
def singlediode (Module ,IL ,I0 ,Rs ,Rsh ,nNsVth ,** kwargs ):
997
999
'''
998
1000
Solve the single-diode model to obtain a photovoltaic IV curve
0 commit comments