Closed chetan201 closed 6 years ago
@mikofski How do I update the documentation for PVMismatch? I think this new enhancement should be documented.
PS I would also ask @bmeyers to review this. He spent a lot of time optimizing it for speed with large arrays. The for loop in here may slow things down, so some benchmarking with very large arrays should double check that there's no impact on performance.
@mikofski Thanks for the detailed review! I would like to make the bypass diode feature more configurable and I think your recommendations will really help that goal. This will be a branch under construction for a bit longer I think.
As for using pytest, I am all for it!
Hi @mikofski @bmeyers , Would you guys mind taking a look through the PR? I think it is in a good shape at this point. I would like to start using it in the master. Thanks for your time and continued support with PVMismatch! Chetan.
Code snippet to recreate the figure -
from nose.tools import ok_
from pvmismatch.pvmismatch_lib.pvmodule import PVmodule, TCT492, PCT492
import numpy as np
from matplotlib import pyplot as plt
pvm_list = []
pvm = PVmodule(Vbypass = [None, None, None])
ok_(np.isclose(pvm.Vmod.min(), -530.6169665707829))
pvm_list.append(pvm)
# only one cell string has a bypass diode
pvm = PVmodule(Vbypass = [None, None,-0.5])
ok_(np.isclose(pvm.Vmod.min(), -398.46272492808714))
pvm_list.append(pvm)
# two bypass diodes (middle removed)
pvm = PVmodule(Vbypass = [-0.5, None,-0.5])
ok_(np.isclose(pvm.Vmod.min(), -266.30848328539145))
pvm_list.append(pvm)
# all bypass diodes - same values
pvm = PVmodule(Vbypass = -0.2)
ok_(np.isclose(pvm.Vmod.min(), -0.6))
pvm_list.append(pvm)
# one bypass diode across the module
pvm = PVmodule(Vbypass = [-0.7])
ok_(np.isclose(pvm.Vmod.min(), -0.7))
pvm_list.append(pvm)
# default case
pvm = PVmodule()
ok_(np.isclose(pvm.Vmod.min(), pvm.Vbypass * 3))
plt.figure()
for pvm in pvm_list:
plt.plot(pvm.Vmod, pvm.Imod)
plt.grid()
plt.legend(['No diodes', 'One diode two missing', 'two diodes, center missing', 'all diodes','module bypass'])
plt.show()
plt.xlabel('Voltage')
plt.ylabel('Current')```
@amir-asgharzadeh Thanks for the review. I made the change and now merging.
New feature to let the user model various scenarios with bypass diodes configurations.
a code snippet to verify the various scenarios