suppFig6-Drude.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env python3
  2. # -*- coding: UTF-8 -*-
  3. import cmath
  4. import numpy as np
  5. import scipy.io
  6. from matplotlib import pyplot as plt
  7. from optical_constants import read_refractive_index_from_yaml as read_nk
  8. from scattnlay import mesomie, mie
  9. # shell 0.4-0.6 nm
  10. # omega_p goes down
  11. shell_h = 0.4
  12. from_disk = np.loadtxt('silver-d_perp_interpolated.txt')
  13. omega_star_ratio = from_disk[0, :]
  14. d_perp = from_disk[1, :] + 1j*from_disk[2, :]
  15. from_disk = np.loadtxt('silver-d_parl_interpolated.txt')
  16. d_parl = from_disk[1, :] + 1j*from_disk[2, :]
  17. c = 299792458 # m/s
  18. h_reduced = 6.5821e-16 # eV s
  19. omega_p = 9.02 # eV
  20. omega_p_star = 3.81 # eV
  21. gamma = 0.15 # eV
  22. eps_inf_drud = 4.65
  23. # eps_inf = 4.65
  24. eps_d = 1
  25. R = 2.5
  26. y_min = 0
  27. y_max = 2
  28. min_lim_omega_star_ratio = 0.87
  29. max_lim_omega_star_ratio = 0.99
  30. # min_lim_omega_ratio = min_lim_omega_star_ratio * omega_p_star/omega_p
  31. # max_lim_omega_ratio = max_lim_omega_star_ratio * omega_p_star/omega_p
  32. # 2 pi / lambda = (omega/c) /h_reduced
  33. WL = 2*np.pi/((omega_star_ratio * omega_p_star/c)/h_reduced)*1e6 # mkm
  34. min_WL_available = 0.1879
  35. max_WL_available = 1.9370
  36. WL[WL < min_WL_available] = min_WL_available
  37. WL[WL > max_WL_available] = max_WL_available
  38. index_Ag = read_nk('Ag-Johnson-1972.yml', WL, kind=1)
  39. eps_Ag = index_Ag**2
  40. # print(index_Ag)
  41. factor = 1 # TODO see app phys b 2017 fig 3, Karpov
  42. # 1. Нужна правильная eps (см выше) + размерный фактор в gamma
  43. # 2. Варьируем концентрацию
  44. # 3. На выходе спектр с красным сдвигом. jpcc
  45. def eps_m(omega, eps_inf, omega_p_local):
  46. return eps_inf - omega_p_local * omega_p_local / (omega*omega + 1j*omega*gamma*factor)
  47. def eps_inf(omega, eps_exp):
  48. return eps_exp + omega_p * omega_p / (omega*omega + 1j*omega*gamma*factor)
  49. Qext = []
  50. Qext_mie = []
  51. Qext_drude_nc = []
  52. om_rat_plot = []
  53. eps_inf_drude = []
  54. eps_m_drude = []
  55. for i in range(len(omega_star_ratio)):
  56. om_star_rat = omega_star_ratio[i]
  57. if (om_star_rat < min_lim_omega_star_ratio
  58. or om_star_rat > max_lim_omega_star_ratio):
  59. continue
  60. omega = om_star_rat*omega_p_star
  61. WL_mkm = 2*np.pi/((omega/c)/h_reduced)*1e6
  62. if WL_mkm < min_WL_available or WL_mkm > max_WL_available:
  63. continue
  64. x_const = (omega/c) * 1e-9/h_reduced
  65. x = R * x_const
  66. m = index_Ag[i, 1]
  67. eps_m_drude.append(m**2)
  68. eps_inf_drude.append(eps_inf(omega, m**2))
  69. m_drude = cmath.sqrt(eps_m(omega, eps_inf(omega, m**2), omega_p))
  70. # m_drude = cmath.sqrt(eps_m(omega, eps_inf_drud, omega_p))
  71. # m_drude = cmath.sqrt(eps_inf(omega, m**2))
  72. print(x, m)
  73. # m = m_drude
  74. mesomie.calc_ab(R*10, # R in angstrem
  75. x, # xd
  76. x * m, # xm
  77. 1, # eps_d
  78. m * m, # eps_m
  79. d_parl[i], # d_parallel
  80. d_perp[i]) # d_perp
  81. mesomie.calc_Q()
  82. Qext.append(mesomie.GetQext())
  83. mie.SetLayersSize(x)
  84. mie.SetLayersIndex(m)
  85. mie.RunMieCalculation()
  86. Qext_mie.append(mie.GetQext())
  87. # m = m_drude
  88. # mesomie.calc_ab(R*10, # R in angstrem
  89. # x, # xd
  90. # x * m, # xm
  91. # 1, # eps_d
  92. # m * m, # eps_m
  93. # d_parl[i], # d_parallel
  94. # d_perp[i]) # d_perp
  95. # mesomie.calc_Q()
  96. # Qext_drude_nc.append(mesomie.GetQext())
  97. # print(x, m, Qext[-1] - mie.GetQext())
  98. om_rat_plot.append(om_star_rat)
  99. plt.plot(om_rat_plot, Qext_mie,
  100. label='classic', color='black', lw=4)
  101. # plt.plot(om_rat_plot, np.real(eps_inf_drude),
  102. # label='real drude', color='blue', lw=1)
  103. # plt.plot(om_rat_plot, np.imag(eps_inf_drude),
  104. # label='imag drude', color='red', lw=1)
  105. # plt.plot(om_rat_plot, np.real(eps_m_drude),
  106. # label='real drude', color='blue', lw=2)
  107. # plt.plot(om_rat_plot, np.imag(eps_m_drude),
  108. # label='imag drude', color='red', lw=2)
  109. plt.plot(om_rat_plot, Qext,
  110. label='non-classic', color='red', lw=4)
  111. # plt.plot(om_rat_plot, Qext_drude_nc,
  112. # label='non-classic drude fixed\nomega_p = 9.02 eV\ngamma = 0.15eV\neps_inf_drud = 4.65', color='blue', lw=2)
  113. for j in range(7):
  114. Qext_drude = []
  115. step = 0.02
  116. for i in range(len(omega_star_ratio)):
  117. om_star_rat = omega_star_ratio[i]
  118. if (om_star_rat < min_lim_omega_star_ratio
  119. or om_star_rat > max_lim_omega_star_ratio):
  120. continue
  121. omega = om_star_rat*omega_p_star
  122. WL_mkm = 2*np.pi/((omega/c)/h_reduced)*1e6
  123. if WL_mkm < min_WL_available or WL_mkm > max_WL_available:
  124. continue
  125. x_const = (omega/c) * 1e-9/h_reduced
  126. x_cs = [(R-shell_h) * x_const, R * x_const],
  127. m = index_Ag[i, 1]
  128. m_drude = cmath.sqrt(eps_m(omega, eps_inf(omega, m**2), omega_p))
  129. m_drude_shell = cmath.sqrt(
  130. eps_m(omega, eps_inf(omega, m**2), omega_p*(0.96+step*j)))
  131. m_cs = [m_drude, m_drude_shell]
  132. mie.SetLayersSize(x_cs)
  133. mie.SetLayersIndex(m_cs)
  134. mie.RunMieCalculation()
  135. Qext_drude.append(mie.GetQext())
  136. plt.plot(om_rat_plot, Qext_drude,
  137. label=f'omega_p*{((0.96+step*j)*100)/100}', color='gray', lw=2)
  138. plt.legend()
  139. # plt.yscale('log')
  140. plt.xlim((min_lim_omega_star_ratio, max_lim_omega_star_ratio))
  141. # plt.ylim((y_min, y_max))
  142. plt.title(
  143. "R="+str(R)+f'\nfor core-shell totalR is the same,\nshell_h={shell_h}')
  144. plt.show()