В коде я попытался построить график Power (p) против напряжения (Vpv), но мой код не дает результата.
import numpy as np
import math
from numpy import *
import matplotlib.pyplot as plt
plt.style.use('ggplot')
r = 50
Vpv = np.linspace(0,0.6,r) # Vpv = panel voltage
Rs = 0 # series resistance
Rsh = math.inf # parallel resistance
n = 2 # ideality constant depends on semiconductor material
m = 1.5 # another constant depends on dopping
T = 298 # temperature in kelvin
Eg = 1.14 # band gap energy in ev
K = 0.13 # constant
Vt = T/11600 #thermal voltage
Io = K*(T**m)*exp(-Eg/(n*Vt)) # Io = diode current
print(Io)
Isc = Io*(10**9)
def current():
current = [] #initializing current array as null
for t in Vpv:
Ipv = np.zeros(r) #initializing panel current(Ipv) as zero
Ipv = Isc - Io *(exp((t + Rs*Ipv)/(n*Vt)) - 1) - (t + Rs*Ipv)/Rsh
current.append(Ipv)
return np.array(current)
Icurrent = current()
#power = Vpv * Icurrent
power = np.multiply(Vpv, Icurrent)
plt.plot(Vpv,power,'b')
#plt.plot(Vpv,Icurrent,'r')
plt.xlabel('Panel VOltage(V)')
plt.ylabel('Panel Current(A) and Power(W)')
plt.show()
Также пытаются использовать умножение массива, например no.multiply(arr1,arr2)
, но это также не работает.
Я получаю следующий график с использованием умножения массива - 
но оно должно прийти в следующей форме - 
Любое предложение Добро пожаловать.