python光學仿真之菲涅耳公式

從物理學的機制出發,波動模型相對於光線模型,顯然更加接近光的本質;但是從物理學的發展來說,波動光學旨在解決幾何光學無法解決的問題,可謂光線模型的一種升級。從編程的角度來說,波動光學在某些情況下可以簡單地理解爲在光線模型的基礎上,引入一個相位項。

波動模型

一般來說,三個特徵可以確定空間中的波場:頻率、振幅和相位,故光波場可表示爲:

E=Acos(ωtkr) E = Acos(\omega t-kr)

其中,AA爲振幅,ω=2πf=2πT\omega=2\pi f=\frac{2\pi}{T}爲角頻率,k=2πλk=\frac{2\pi}{\lambda},爲波數。由上式可知,當時間固定時,光在傳播方向上有一個正弦波的外形;而對於空間中任意一點,沿着振幅方向也呈正弦波的規律上下振動。

其中,振幅、波數以及空間位置均爲矢量,當座標比較混亂的時候,也可以寫成E=Acos(ωtkr)\vec E = \vec{A}cos(\omega t-\vec k\vec r);有時爲了計算方便,也可以寫成指數形式

E=Aei(ωtkr) E = Ae^{-i(\omega t-kr)}

對於平面波來說,其發散角爲0,即光場中的所有點,都具有統一的傳播方向,且振幅相等。設其傳播方向爲zz,則可寫爲

E=Acos(ωtkz) E = Acos(\omega t-kz)

球面波則相對複雜,令rr爲空間中任意一點到點光源的距離,則對於aba、b兩點來說,其單位面積的光通量之比爲IaIb=rb2ra2\frac{I_a}{I_b}=\frac{r^2_b}{r^2_a},則振幅之比爲EbEa=rarb\frac{E_b}{E_a}=\frac{r_a}{r_b}。這說明球面波振幅反比于波陣面到光源距離,即

E=Arei(ωtkr) E = \frac{\vec A}{r}e^{-i(\omega t-\vec k\vec r)}

通過截取xOzxOz平面,假設光波長爲532nm,則可以畫出這一截面處的光波振幅圖。

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
z = np.arange(15,200)*10    #單位爲nm
x = np.arange(15,200)*10
x,z = np.meshgrid(x,z)      #創建座標系
E = 1/np.sqrt(x**2+z**2)*np.cos(2*np.pi*np.sqrt(x**2+z**2)/(532*1e-9))
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(x,z,E)
plt.show()

其結果如圖所示

在這裏插入圖片描述

菲涅耳公式

幾何光學可以通過費馬原理得到折射定律,但是無法獲知光波的透過率,菲涅耳公式在幾何光學的基礎上,解決了這個問題。

由於光是一羣橫波的集合,故可以根據其電矢量的震動方向,將其分爲平行入射面與垂直入射面的兩個分量,分別用pp分量和ss分量來表示。一束光在兩介質交界處發生折射,兩介質折射率分別爲n1n_1n2n_2,對於pp光來說,其電矢量平行於入射面,其磁矢量則垂直於入射面,即只有ss分量;而對於ss光來說,則恰恰相反,如圖所示。

在這裏插入圖片描述

則對於pp光來說即
{Ep=Ep0ei(k(n^r)ωt)Bs=Bs0ei(k(n^r)ωt)\left\{ \begin{aligned} E_p&=E_{p0}e^{i(k(\hat{n}\cdot r)-\omega t)}\\ B_s&=B_{s0}e^{i(k(\hat{n}\cdot r)-\omega t)} \end{aligned}\right.

n1n_1n2n_2平面內,其波數分別爲k1=2πn1/λk_1=2\pi n_1/\lambda,k1=2πn2/λk_1=2\pi n_2/\lambda,則入射波、反射波和透射波分別可以寫爲
{Ei=Ei0ei[k1(sinθixcosθiy)ωt]Er=Er0ei[k1(sinθrx+cosθry)ωt]Et=Et0ei[k2(sinθtxcosθty)ωt]\left\{ \begin{aligned} E_i&=E_{i0}e^{i[k_1(sin\theta_ix-cos\theta_iy)-\omega t]}\\ E_r&=E_{r0}e^{i[k_1(sin\theta_rx+cos\theta_ry)-\omega t]}\\ E_t&=E_{t0}e^{i[k_2(sin\theta_tx-cos\theta_ty)-\omega t]} \end{aligned}\right.

其角度關係爲
θi=θr\theta_i=\theta_r

n1sinθi=n2sinθtn_1sin\theta_i=n_2sin\theta_t

則波數之間的關係爲
k1sinθi=k1sinθr=k2sinθtk_1sin\theta_i=k_1sin\theta_r=k_2sin\theta_t

又因在界面上,反射波和透射波在x軸上的投影必然等於入射波,故對於電矢量而言,有
cosθiEi0=cosθrEr0+cosθtEt0cos\theta_iE_{i0}=cos\theta_rE_{r0}+cos\theta_tE_{t0}

對於磁矢量而言,有
n1Bi0+n1Br0=n2Bt0n1Ei0+n1Er0=n2Et0n_1B_{i0}+n_1B{r0}=n_2B_{t0} \to n_1E_{i0}+n_1E{r0}=n_2E_{t0}

令振幅反射係數和透射係數分別爲rp=Er0Ei0,tp=Et0Ei0r_p = \frac{E_{r0}}{E_{i0}},t_p = \frac{E_{t0}}{E_{i0}}

則有
{cosθrrp+cosθttp=cosθin1rpn2tp=n1\left\{ \begin{aligned} cos\theta_rr_p+cos\theta_tt_p&=cos\theta_i\\ n_1r_p-n_2t_p &= -n_1 \end{aligned}\right.

s光的計算方法與之類似,最後得到
{rp=n2cosθin11(n1/n2)2sin2θin2cosθi+n11(n1/n2)2sin2θitp=2n1cosθin2cosθi+n11(n1/n2)2sin2θirs=n1cosθin21(n1/n2)2sin2θin1cosθi+n21(n1/n2)2sin2θits=2n1cosθin1cosθi+n21(n1/n2)2sin2θi\left\{\begin{aligned} r_p&=\frac{n_2cos\theta_i-n_1\sqrt{1-(n_1/n_2)^2sin^2\theta_i}}{n_2cos\theta_i+n_1\sqrt{1-(n_1/n_2)^2sin^2\theta_i}}\\ t_p&=\frac{2n_1cos\theta_i}{n_2cos\theta_i+n_1\sqrt{1-(n_1/n_2)^2sin^2\theta_i}}\\ r_s&=\frac{n_1cos\theta_i-n_2\sqrt{1-(n_1/n_2)^2sin^2\theta_i}}{n_1cos\theta_i+n_2\sqrt{1-(n_1/n_2)^2sin^2\theta_i}}\\ t_s&=\frac{2n_1cos\theta_i}{n_1cos\theta_i+n_2\sqrt{1-(n_1/n_2)^2sin^2\theta_i}} \end{aligned}\right.

我們可以通過python繪製出當入射光的角度不同時,其振幅反射率和透過率的變化

import matplotlib.pyplot as plt
import numpy as np
def fresnel(theta, n1, n2):
    theta = theta*np.pi/180
    xTheta = np.cos(theta)
    mid = np.sqrt(1-(n1/n2*np.sin(theta))**2)          #中間變量
    rp = (n2*xTheta-n1*mid)/(n2*xTheta+n1*mid)  #p分量振幅反射率
    rs = (n1*xTheta-n2*mid)/(n1*xTheta+n2*mid)
    tp = 2*n1*xTheta/(n2*xTheta+n1*mid)
    ts = 2*n1*xTheta/(n1*xTheta+n2*mid)
    return rp, rs, tp, ts

def testFres(n1=1,n2=1.45):         #默認n2爲1.45
    theta = np.arange(0,90,0.1)+0j
    a = theta*np.pi/180
    rp,rs,tp,ts = fresnel(theta,n1,n2)

    fig = plt.figure(1)
    plt.subplot(1,2,1)
    plt.plot(theta,rp,'-',label='rp')
    plt.plot(theta,rs,'-.',label='rs')
    plt.plot(theta,np.abs(rp),'--',label='|rp|')
    plt.plot(theta,np.abs(rs),':',label='|rs|')
    plt.legend()

    plt.subplot(1,2,2)
    plt.plot(theta,tp,'-',label='tp')
    plt.plot(theta,ts,'-.',label='ts')
    plt.plot(theta,np.abs(tp),'--',label='|tp|')
    plt.plot(theta,np.abs(ts),':',label='|ts|')
    plt.legend()
    plt.show()

if __init__=="__main__":
    testFres()

得到其圖像爲

在這裏插入圖片描述

由於強度與振幅之間存在一個平方的關係,所以強度反射率和透過率爲r2|r|^2n2n1t2\frac{n_2}{n_1}|t|^2。而能流與強度之間還需要除以一個橫截面積,故能流反射率和透過率分別爲:
{R=r2T=n2cosθtn1cosθit2\left\{\begin{aligned} R &= |r|^2\\ T &= \frac{n_2cos\theta_t}{n_1cos\theta_i|t|^2} \end{aligned}\right.

通過python進行繪圖,將上面程序中的testFres改爲以下代碼即可。

def testFres(n1=1,n2=1.45):
    theta = np.arange(0,90,0.1)+0j
    a = theta*np.pi/180
    rp,rs,tp,ts = fml.fresnel(theta,n1,n2)

    Rp = np.abs(rp)**2
    Rs = np.abs(rs)**2
    Rn = (Rp+Rs)/2

    Tp = n2*np.sqrt(1-(n1/n2*np.sin(a))**2)/(n1*np.cos(a))*np.abs(tp)**2
    Ts = n2*np.sqrt(1-(n1/n2*np.sin(a))**2)/(n1*np.cos(a))*np.abs(ts)**2
    Tn = (Tp+Ts)/2

    fig = plt.figure(2)
    plt.subplot(1,2,1)
    plt.plot(theta,Rp,'-',label='R_p')
    plt.plot(theta,Rs,'-.',label='R_s')
    plt.plot(theta,Rn,'-',label='R_n')
    plt.legend()

    plt.subplot(1,2,2)
    plt.plot(theta,Tp,'-',label='T_p')
    plt.plot(theta,Ts,'-.',label='T_s')
    plt.plot(theta,Tn,'--',label='T_n')
    plt.legend()

    plt.show()

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章