@@ -922,12 +922,12 @@ def singlediode(module, IL, I0, Rs, Rsh, nNsVth, **kwargs):
922
922
DFOut ['I0' ] = I0
923
923
DFOut ['IL' ] = IL
924
924
925
- __ , Voc_return = golden_sect_DataFrame (DFOut , 0 , module .V_oc_ref * 1.6 ,
926
- Voc_optfcn )
925
+ __ , Voc_return = _golden_sect_DataFrame (DFOut , 0 , module .V_oc_ref * 1.6 ,
926
+ _Voc_optfcn )
927
927
Voc = Voc_return .copy ()
928
928
929
- Pmp , Vmax = golden_sect_DataFrame (DFOut , 0 , module .V_oc_ref * 1.14 ,
930
- pwr_optfcn )
929
+ Pmp , Vmax = _golden_sect_DataFrame (DFOut , 0 , module .V_oc_ref * 1.14 ,
930
+ _pwr_optfcn )
931
931
Imax = I_from_V (Rsh = Rsh , Rs = Rs , nNsVth = nNsVth , V = Vmax , I0 = I0 , IL = IL )
932
932
# Invert the Power-Current curve. Find the current where the inverted power
933
933
# is minimized. This is Imax. Start the optimization at Voc/2
@@ -963,14 +963,11 @@ def singlediode(module, IL, I0, Rs, Rsh, nNsVth, **kwargs):
963
963
964
964
# Created April,2014
965
965
# Author: Rob Andrews, Calama Consulting
966
- # These may become private methods in 0.2
967
966
968
- def golden_sect_DataFrame (df , VL , VH , func ):
967
+ def _golden_sect_DataFrame (df , VL , VH , func ):
969
968
'''
970
969
Vectorized golden section search for finding MPPT
971
970
from a dataframe timeseries.
972
-
973
- Do not expect this function to remain in the public API.
974
971
975
972
Parameters
976
973
----------
@@ -1031,27 +1028,22 @@ def golden_sect_DataFrame(df, VL, VH, func):
1031
1028
if iterations > 50 :
1032
1029
raise Exception ("EXCEPTION:iterations exeeded maximum (50)" )
1033
1030
1034
-
1035
1031
return func (df ,'V1' ) , df ['V1' ]
1036
1032
1037
1033
1038
- def pwr_optfcn (df , loc ):
1034
+ def _pwr_optfcn (df , loc ):
1039
1035
'''
1040
1036
Function to find power from I_from_V.
1041
-
1042
- Do not expect this function to remain in the public API.
1043
1037
'''
1044
1038
1045
1039
I = I_from_V (Rsh = df ['Rsh' ], Rs = df ['Rs' ], nNsVth = df ['nNsVth' ], V = df [loc ],
1046
1040
I0 = df ['I0' ], IL = df ['IL' ])
1047
1041
return I * df [loc ]
1048
1042
1049
1043
1050
- def Voc_optfcn (df , loc ):
1044
+ def _Voc_optfcn (df , loc ):
1051
1045
'''
1052
1046
Function to find V_oc from I_from_V.
1053
-
1054
- Do not expect this function to remain in the public API.
1055
1047
'''
1056
1048
I = - abs (I_from_V (Rsh = df ['Rsh' ], Rs = df ['Rs' ], nNsVth = df ['nNsVth' ],
1057
1049
V = df [loc ], I0 = df ['I0' ], IL = df ['IL' ]))
@@ -1064,13 +1056,11 @@ def I_from_V(Rsh, Rs, nNsVth, V, I0, IL):
1064
1056
uses Lambert W implemented in wapr_vec.m
1065
1057
Rsh, nVth, V, I0, IL can all be DataFrames
1066
1058
Rs can be a DataFrame, but should be a scalar.
1067
-
1068
- Do not expect this function to remain in the public API.
1069
1059
'''
1070
1060
try :
1071
1061
from scipy .special import lambertw
1072
1062
except ImportError :
1073
- raise ImportError ('The I_from_V function requires scipy' )
1063
+ raise ImportError ('This function requires scipy' )
1074
1064
1075
1065
argW = (Rs * I0 * Rsh * np .exp (Rsh * (Rs * (IL + I0 )+ V ) /
1076
1066
(nNsVth * (Rs + Rsh ))) / (nNsVth * (Rs + Rsh )) )
0 commit comments