Professional Documents
Culture Documents
ipynb - Colaboratory
import pandas as pd
# Constants
epsilon_o = 1 # Free space permitivity (F/m)
N_A = 6.02214076e23 # Avogadro's number
# Function to calculate K
def calculate_K(epsilon_o, M, rho, N_A):
K = (3 * epsilon_o * M) / (rho * N_A)
return K
# Lists of data
liquids = ["Water", "Benzene", "Ethanol"]
temperatures = [20]
wavelengths = [589, 532, 652, 632]
refractive_indices = [
[1.333, 1.33, 1.475, 1.429], # Refractive index values for Water at T=20°C and each wavelength
[1.56, 1.441, 1.727, 1.673], # Refractive index values for Benzene at T=20°C and each wavelength
[1.36, 1.358, 1.505, 1.46] # Refractive index values for Ethanol at T=20°C and each wavelength
]
alpha_p = calculate_polarisability(K, n)
temp_results.append((wavelength, n, K, alpha_p))
liquid_results.append(temp_results)
results.append(liquid_results)
https://colab.research.google.com/drive/1_D7GnD1b9OI60c9h3CVhfgV7IHAcVL7H#scrollTo=RiSpIBU3r1G7&printMode=true 2/3
8/27/23, 9:44 PM Q.M LAB 3.ipynb - Colaboratory
https://colab.research.google.com/drive/1_D7GnD1b9OI60c9h3CVhfgV7IHAcVL7H#scrollTo=RiSpIBU3r1G7&printMode=true 3/3