Closed rayhickey closed 6 years ago
TODO:
See #67 for more comments on this topic.
@rayhickey This PR can be merged when the Travis CI tests pass. Please let us know if you need any help.
Should close #65
Runtime benchmarking using the following code:
import timeit
setup = """
# from pvmismatch.pvmismatch_lib
import pvsystem
from pvconstants import PVconstants
pvs = pvsystem.PVsystem(pvconst=PVconstants())
"""
code = 'pvs.setTemps(300.)'
timeit.timeit(setup=setup, stmt=code, number=100)
Baseline, 101 points, 100 runs: 1.01 s/run Baseline, 1001 points, 100 runs: 2.66 s/run Baseline, 10001 points, 10 runs: 28.73 s/run Linear interpolation, 101 points, 100 runs: 1.03 s/run Linear interpolation, 1001 points, 100 runs: 2.74 s/run Linear interpolation, 10001 points, 10 runs: 27.48 s/run
Linear interpolation has the most predictable behavior, especially with fewer points. Increasing the number of points reduces the variation additionally when interpolating, but with systems larger than one module the number of points required adds too much time. I think keeping the number of points at 101 is fine for now.
@rayhickey I take it this is safe to merge now?
Fixes I_mp and V_mp sensitivity to temperature caused by selecting Isys and Vsys values at the maximum Psys index. This is accomplished by linear interpolation between the points surrounding MPP. Previously: Now: