elcocodrilotito

cavity reflection with class

Aug 5th, 2024
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from cavity_class import Device
  4.  
  5. c = 299792458
  6.  
  7. # Emitter parameters
  8. gamma = 2*np.pi*30e6
  9. fe = 484.115e12 # Hz
  10.  
  11. # Cavity parameters
  12. Q = 12000
  13. kin_factor = 0.8
  14. Ace = 50e9
  15. fc = fe-Ace
  16.  
  17. # QED
  18. C = 100
  19.  
  20.  
  21. device = Device(fc, Q, kin_factor, fe, gamma, C)
  22. f_high, R_high, f_low, R_low = device.find_extrema()
  23. Ass = device.find_overlapping_splitting()
  24. device2 = Device(fc, Q, kin_factor, fe+Ass*1e9, gamma, C)
  25. f_high2, R_high2, f_low2, R_low2 = device2.find_extrema()
  26.  
  27. fp = np.linspace(fc-device.span, fc+device.span, 1000000)
  28. x_axis = (fp-fc)/1e9
  29.  
  30. # Plotting reflection amplitude
  31. plt.figure(1)
  32. plt.plot(x_axis, device.R(fp))
  33. plt.plot(x_axis, np.zeros(np.shape(fp)), 'k--')
  34. plt.plot(x_axis, np.ones(np.shape(fp)), 'k--')
  35. plt.scatter(f_high, R_high, c='k')
  36. plt.scatter(f_low, R_low, c='k')
  37. plt.plot(x_axis, device2.R(fp), '--')
  38. plt.scatter(f_high2, R_high2, c='k')
  39. plt.scatter(f_low2, R_low2, c='k')
  40. plt.xlabel('Frequency offset wrt cavity resonance (GHz)')
  41. plt.ylabel('Reflectivity')
  42.  
  43. # Plotting reflection phase
  44. plt.figure(2)
  45. plt.plot((fp-fc)/1e9, device.phase(fp)*180/np.pi)
  46. plt.plot((fp-fc)/1e9, 180*np.ones(np.shape(fp)), 'k--')
  47. plt.plot((fp-fc)/1e9, -180*np.ones(np.shape(fp)), 'k--')
  48. plt.xlabel('Frequency offset wrt cavity resonance (GHz)')
  49. plt.ylabel('Angle (deg)')
  50. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment