Demo entry 6361584

sellmeier equation

   

Submitted by anonymous on May 04, 2017 at 19:42
Language: Python. Code size: 1.3 kB.

import numpy
import math
import matplotlib.pyplot as plt
def sellmeierEq(l):
	b1 = 1.03961212 
	b2 = 0.231792344
	b3 = 1.01046945 
	
	c1 = 6.00069867 * 0.001
	c2 = 2.00179144 * 0.01
	c3 = 1.03560653 * 0.01
	
	ll = l**2

	indexSq = 1 + ((ll*b1)/(ll-c1)) + ((ll*b2)/(ll-c2)) + ((ll*b3)/(ll-c3))
 	return (indexSq ** (0.5))

nanometra = [i for i in range(400,701)]
wavelengths = [i/1000.0 for i in nanometra]
refractiveCoef = [sellmeierEq(i) for i in wavelengths]

pi = numpy.pi
def angMin(n):
	f = (180*math.asin(n/2))/pi
	delta = 2*f - 60
	return delta

minimumAngDiv = [angMin(i) for i in refractiveCoef]

#x = wavelengths
#y = minimumAngDiv

#plt.plot(x, y)
#	plt.show()

#dispersive power of the prism : 3.8795772138539633



def derSellmeierEq(l):
	b1 = 1.03961212 
	b2 = 0.231792344
	b3 = 1.01046945 
	
	c1 = 6.00069867 * 0.001
	c2 = 2.00179144 * 0.01
	c3 = 1.03560653 * 0.01
	
	ll = l**2
	llll = ll**2
	Sq1 = -(((2*b1*c1*l)/(llll-(2*ll*c1) + c1**2)) + ((2*b2*c2*l)/(llll-(2*ll*c2) + c2**2)) + ((2*b3*c3*l)/(llll-(2*ll*c3) + c3**2)))
	Sq2 = 0.5/((1 + ((ll*b1)/(ll-c1)) + ((ll*b2)/(ll-c2)) + ((ll*b3)/(ll-c3)))**(0.5))

	extra = (2/(1-((sellmeierEq(l)/2)**2)))

	return (Sq1*Sq2*extra)
x = wavelengths
y = [derSellmeierEq(i) for i in wavelengths]

plt.plot(x, y)
plt.show()

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).