@@ -141,18 +141,20 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
141141
142142 References
143143 ----------
144- .. [1] "Computer simulation of the effects of electrical mismatches in
145- photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988)
146- :doi:`10.1016/0379-6787(88)90059-2`
147-
148- .. [2] "Improved equivalent circuit and Analytical Model for Amorphous
149- Silicon Solar Cells and Modules." J. Mertens, et al., IEEE Transactions
150- on Electron Devices, Vol 45, No 2, Feb 1998.
144+ .. [1] J.W. Bishop, "Computer simulation of the effects of electrical
145+ mismatches in photovoltaic cell interconnection circuits" Solar Cells,
146+ vol. 25 no. 1, pp. 73-89, Oct. 1988.
147+ :doi:`doi.org/10.1016/0379-6787(88)90059-2`
148+
149+ .. [2] J. Merten, J. M. Asensi, C. Voz, A. V. Shah, R. Platz and J. Andreu,
150+ "Improved equivalent circuit and Analytical Model for Amorphous
151+ Silicon Solar Cells and Modules." , IEEE Transactions
152+ on Electron Devices, vol. 45, no. 2, pp. 423-429, Feb 1998.
151153 :doi:`10.1109/16.658676`
152154
153- .. [3] "Performance assessment of a simulation model for PV modules of any
154- available technology", André Mermoud and Thibault Lejeune, 25th EUPVSEC,
155- 2010
155+ .. [3] A. Mermoud and T. Lejeune, "Performance assessment of a simulation
156+ model for PV modules of any available technology", In Proc. of the 25th
157+ European PVSEC, Valencia, ES, 2010.
156158 :doi:`10.4229/25thEUPVSEC2010-4BV.1.114`
157159 """
158160 # calculate recombination loss current where d2mutau > 0
@@ -913,10 +915,25 @@ def _lambertw(photocurrent, saturation_current, resistance_series,
913915 v_oc = 0.
914916
915917 # Find the voltage, v_mp, where the power is maximized.
916- # Start the golden section search at v_oc * 1.14
917- p_mp , v_mp = _golden_sect_DataFrame (params , 0. , v_oc * 1.14 , _pwr_optfcn )
918+ # use scipy.elementwise if available
919+ # remove try/except when scipy>=1.15, and golden mean is retired
920+ try :
921+ from scipy .optimize .elementwise import find_minimum
922+ # left negative to insure strict inequality
923+ init = (- 1. , 0.8 * v_oc , v_oc )
924+ res = find_minimum (_vmp_opt , init ,
925+ args = (params ['photocurrent' ],
926+ params ['saturation_current' ],
927+ params ['resistance_series' ],
928+ params ['resistance_shunt' ],
929+ params ['nNsVth' ],))
930+ v_mp = res .x
931+ p_mp = - 1. * res .f_x
932+ except ModuleNotFoundError :
933+ # switch to old golden section method
934+ p_mp , v_mp = _golden_sect_DataFrame (params , 0. , v_oc * 1.14 ,
935+ _pwr_optfcn )
918936
919- # Find Imp using Lambert W
920937 i_mp = _lambertw_i_from_v (v_mp , ** params )
921938
922939 # Find Ix and Ixx using Lambert W
@@ -938,6 +955,15 @@ def _lambertw(photocurrent, saturation_current, resistance_series,
938955 return out
939956
940957
958+ def _vmp_opt (v , iph , io , rs , rsh , nNsVth ):
959+ '''
960+ Function to find negative of power from ``i_from_v``.
961+ '''
962+ current = _lambertw_i_from_v (v , iph , io , rs , rsh , nNsVth )
963+
964+ return - v * current
965+
966+
941967def _pwr_optfcn (df , loc ):
942968 '''
943969 Function to find power from ``i_from_v``.
0 commit comments