Guest User

Untitled

a guest
May 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import numpy as np
  2. import math
  3. from numpy import *
  4. import matplotlib.pyplot as plt
  5. plt.style.use('ggplot')
  6.  
  7. r = 50
  8. Vpv = np.linspace(0,0.6,r) # Vpv = panel voltage
  9.  
  10. Rs = 0 # series resistance
  11. Rsh = math.inf # parallel resistance
  12. n = 2 # ideality constant depends on semiconductor material
  13. m = 1.5 # another constant depends on dopping
  14. T = 298 # temperature in kelvin
  15. Eg = 1.14 # band gap energy in ev
  16. K = 0.13 # constant
  17. Vt = T/11600 #thermal voltage
  18. Io = K*(T**m)*exp(-Eg/(n*Vt)) # Io = diode current
  19. print(Io)
  20. Isc = Io*(10**9)
  21.  
  22. def current():
  23. current = [] #initializing current array as null
  24. for t in Vpv:
  25. Ipv = np.zeros(r) #initializing panel current(Ipv) as zero
  26.  
  27. Ipv = Isc - Io *(exp((t + Rs*Ipv)/(n*Vt)) - 1) - (t + Rs*Ipv)/Rsh
  28. current.append(Ipv)
  29. return np.array(current)
  30.  
  31. Icurrent = current()
  32. power = Vpv * Icurrent
  33. plt.plot(Vpv,power,'b')
  34. plt.plot(Vpv,Icurrent,'r')
  35. plt.xlabel('Panel VOltage(V)')
  36. plt.ylabel('Panel Current(A) and Power(W)')
  37. plt.show()
Add Comment
Please, Sign In to add comment