Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.28 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # coding: utf-8
  3.  
  4. # In[15]:
  5.  
  6.  
  7. import numpy as np
  8. import matplotlib.pyplot as plt
  9. from uncertainties import *
  10. from uncertainties.umath import *
  11.  
  12. #measurement of the distance d
  13. b1 = ufloat(866 - 50, 1) #mm since the scale was a milimeter scale we have an uncertainty of +/- 1 mm
  14. f = ufloat(11, 0.5) #mm
  15.  
  16. a = 1/(1/f - 1/b1)
  17. d1 = ufloat(25.5, 1)/4 #mm
  18. d = d1 * a/b1 #mm
  19. print("Distance d between two maxima in mm {:.4u}".format(d))
  20.  
  21.  
  22. # In[19]:
  23.  
  24.  
  25. #measurement of the angle ß between the two rays and the calc of the wavelength
  26. L1 = ufloat(950 - 836, 1) #mm
  27. B1 = ufloat(836 - 50, 1) #mm
  28. l1 = ufloat(45, 1) #mm
  29. A1 = 1/(1/f - 1/B1) #mm
  30. l = l1 * A1/B1 #mm
  31. beta = l/(L1-A1) #rad
  32. wavel = 2 * d * sin(beta/2)#mm
  33. print("Wavelength in nm {:.4u}".format(wavel * 10**6))
  34. print("Expected Wavelength in nm", 532.0)
  35.  
  36.  
  37. # In[20]:
  38.  
  39.  
  40. #measurement of the wire thickness
  41. b2 = ufloat(0.1, 0.05) #mm with their rounding convention, wire thickness
  42. S = ufloat(1296 - 50, 1) #mm
  43. print(S)
  44. d_ber = wavel * S/b2 #mm
  45. d_exp = ufloat(65.5, 1)/10 #mm
  46. print("Distance d_ber from the formula in mm {:.4u}".format(d_ber))
  47. print("Distance d_exp from the measurement in mm {:.4u}".format(d_exp))
  48.  
  49.  
  50. # In[21]:
  51.  
  52.  
  53. #measurement of the slit width
  54. C2 = ufloat(150, 1) #mm
  55. L2 = ufloat(1130 - 798, 1) #mm
  56. B2 = ufloat(798- 50, 1) #mm
  57. A2 = 1/(1/f - 1/B2) #mm
  58. b_prime = ufloat(14, 1) #mm
  59. b_bar = b_prime * A2/B2 #mm
  60. b3 = b_bar * C2/(L2 - A2) #mm
  61. print("{:.4u}".format(b_bar))
  62. print("Slit width b in mm {:.4u}".format(b3))
  63.  
  64.  
  65. # In[5]:
  66.  
  67.  
  68. #diffraction lykopodium
  69. L3 = ufloat(1220 - 50, 1) #mm
  70. rho = ufloat(50.5, 1)/2 #mm
  71. D1_exp = 1.22 * L3 * wavel/rho #mm
  72. D1_micr = 0.02736 #mm
  73. print("Diameter of the lykopodium platelets in mm, measured with rho1 {:.4u}".format(D1_exp))
  74.  
  75.  
  76. # In[6]:
  77.  
  78.  
  79. #diameter circular aperture
  80. L4 = ufloat(1315 -50, 1) #mm
  81. rho1 = ufloat(4.5, 1)/2 #mm
  82. rho2 = ufloat(8.5, 1)/2 #mm
  83. D1 = 1.22 * L4 * wavel/rho1
  84. D2 = 2.23 * L4 * wavel/rho2
  85. print("Diameter with rho1 in mm {:.4u}".format(D1))
  86. print("Diameter with rho2 in mm {:.4u}".format(D2))
  87. D_av = (D1 + D2)/2
  88. print("Diameter in average in mm {:.4u}".format(D_av))
  89.  
  90. #hair thickness
  91. L5 = ufloat(1317 - 50, 1) #mm
  92. d5 = ufloat(85.5, 1)/10 #mm
  93. b5 = wavel * L5/d5
  94. print("Hair thickness of Hagen in mm {:.4u}".format(b5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement