Sie sind auf Seite 1von 1

# calculation of madlung constant for NaCl crystal.

# madlung constant \alpha is given by \sum_{i,j,k} $\pm$\frac{1}{\sqrt{i^2+j^2+k ^2}} # negative sign is for (i+j+k) even where sodium lies and is positive sign for (i+j+k) is odd where chlorine lies # we take the reference ion as chlorine ie negative ion at (0,0,0) position # Using the convention of "Introduction to solid state physics" By Kittel Sevent h edition 3.21 equation. #Here we have taken advantage of crystal symmetry. So we are dealing only with first quadrant, x-axis and x-y plane from math import sqrt l=1000; m1=0; #calculation for the body lattice point in first quadrant... for i in range(1,l+1): for j in range (1,l+1): for k in range (1,l+1): m1+=((-1)**(i+j+k+1))/sqrt(i*i+j*j+k*k) print i # for the axis lattice points x- axis m2=0; for i in range (1,l+1): m2+=((-1)**(i+1))/sqrt(i*i)

# for the x-y plane lattice points m3=0; for i in range (1,l+1): for j in range(1,l+1): m3+=((-1)**(i+j+1))/sqrt(i*i+j*j) final_m=8*m1+12*m3+6*m2; print"The required value of the madlung constant for NaCl is %f"%(final_m)

Das könnte Ihnen auch gefallen