Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. #366 for 0.1 (H) ,1,50,1200
  4. #158 for 2 (H) ,1,50,1200
  5. #values
  6. D0= 20 #[micron]
  7. K0= 10**10
  8. n= 0.5
  9. Q= 221000
  10. R = 8.314
  11. HR= 2 #input. vary 0.1 - 2.0
  12. CR= 1 #input
  13. t_iso = 50 #input
  14. T_isoC = 1200 #input. vary 900-1400 [Celsius]
  15. T_iso = T_isoC + 273 #[Kelvin]
  16. delta_T = T_iso - 298
  17. delta_t = delta_T/(100*HR) #100 steps with equal length for heating
  18. dirta_t = delta_T/(100*CR) #100 steps with equal length for cooling
  19. sum_before_iso = -np.exp(-Q/(R*298))*delta_t #Eventually the integral from 0 to t_1
  20. sum_after_iso = -np.exp(-Q/(R*T_iso))*dirta_t #Eventually the integral from t_2 to t_3
  21. for i in range(0,101):
  22. T_before = 298 + HR*delta_t*i
  23. sum_i = np.exp(-Q/(R*T_before))*delta_t
  24. sum_before_iso += sum_i
  25. T_after = T_iso - CR*dirta_t*i
  26. Sum_i = np.exp(-Q/(R*T_after))*dirta_t
  27. sum_after_iso += Sum_i
  28.  
  29. a = D0
  30. b = K0*sum_before_iso
  31. c = K0*np.exp(-Q/(R*T_iso))*t_iso
  32. d = K0*sum_after_iso
  33.  
  34. D = (a**(1/n)+b+c+d)**n
  35. print(a,b,c,d)
  36. print(D)
  37.  
  38.  
  39.  
  40. #t_iso_list = []
  41. #print(x1)
  42. #y1 = T_before_iso
  43. #y2 = [T_iso] * 10
  44. #y2 = [T_iso]*int(t_iso*HR/delta_T)
  45. #y3 = T_after_iso
  46. #y = [*y1,*y2,*y3]
  47. #print(y)
  48. #plt.plot(x1,y1)
  49. #plt.plot(x2,y2)
  50. #plt.show()
  51.  
  52. #if sub == 1:
  53. #HR = input('Choose HR')
  54. #elif sub == 2:
  55. #T_iso = input('Choose T_iso')
  56. #elif sub == 3:
  57. #das
  58. #elif sub == 4:
  59. #sdasd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement