[Tutor] Hi there, have a question for a side project in physics.....

Steven D'Aprano steve at pearwood.info
Mon Dec 25 07:52:22 EST 2017


On Mon, Dec 25, 2017 at 01:08:13PM +0400, Siddharth Sehgal wrote:

> The actual equation is below screen shotted

No it isn't -- either you forgot to attach it, or the mailing list 
removed it.

Do you mean this equation?

https://en.wikipedia.org/wiki/Sellmeier_equation


I suggest you try using Python and compare your results to those from 
here:

http://www.calctool.org/CALC/phys/optics/sellmeier

or from some authoritative source of refractive indexes.


Here is my simple test, for borosilicate glass BK7 using the values from 
Wikipedia. Using the website:

refractive index at 590 nm = 1.51670

Using Python, I get: 1.516698697993053

Here is my code. Feel free to use it for any purpose, no credit required 
(except as needed to meet any academic obligations you may have about 
collaboration and/or plagiarism).


import math

def sellmeier(lambd, B1, B2, B3, C1, C2, C3):
    return 1 + B1*f(lambd, C1) + B2*f(lambd, C2) + B3*f(lambd, C3)

def f(x, y):
    x2 = x**2
    return x2/(x2 - y)


# Coefficients for BK7 (borosilicate crown glass)

result = sellmeier(0.590, # 590nm == 0.590µm
                  1.03961212,
                  0.231792344,
                  1.01046945,
                  6.00069867e-3,
                  2.00179144e-2,
                  103.560653)

print(math.sqrt(result))




-- 
Steve


More information about the Tutor mailing list