Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. """
  2. Created on Tue Mar 26 22:53:41 2019
  3.  
  4. @author: 150193878
  5. """
  6. import numpy as np
  7. import matplotlib.pyplot as plt
  8. import scipy.constants as constants
  9.  
  10. T=300 #Kelvin
  11. q=1.6e-19 #Coloumbs
  12. kb=constants.k
  13. beta=q/(kb*T)  #Coloumbs/Joule
  14. V_oc=0.5 #Volts
  15.  
  16. def Power(I,V):
  17.     if np.isclose(V,V_oc-(1/beta)*np.log(1+beta*V),atol=1e-3):
  18.         return V*I
  19.  
  20.  
  21. for I in np.linspace(0,2,500):
  22.     for V in np.linspace(0,(1/beta)*np.log(1+beta*V_oc),1000):
  23.         IV=(Power(I,V))
  24.  
  25. print(IV)
  26.  
  27. None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement