Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- 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()
Add Comment
Please, Sign In to add comment