Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Wave Model through Fresnel Formula in python Optical Simulation

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how python optical simulation through the Fresnel formula to achieve the wave model, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!

From the mechanism of physics, the wave model is obviously closer to the nature of light than the ray model, but from the development of physics, wave optics aims to solve the problems that geometric optics can not solve, which can be described as an upgrade of the ray model. From a programming point of view, wave optics in some cases can be simply understood as introducing a phase term on the basis of the ray model.

Fluctuation model

Generally speaking, three characteristics can determine the wave field in space: frequency, amplitude and phase, so the light wave field can be expressed as:

Import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dz = np.arange (15200) * 10 # Units are nmx = np.arange (15200) * 10x x**2+z**2 z = np.meshgrid (XMague z) # create a coordinate system 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 (xMagnez) E) plt.show ()

The result is shown in the figure.

Fresnel formula

Geometrical optics can obtain the law of refraction through Fermat principle, but it is impossible to know the transmittance of light waves. Fresnel formula solves this problem on the basis of geometrical optics.

Because light is a collection of shear waves, it can be divided into two components: parallel incident plane and vertical incident plane, which are represented by p component and s component respectively, according to the vibration direction of its electric vector. A beam of light refracts at the junction of two media, and the refractive index of the two media is N1 and N2, respectively. For p-light, its electric vector is parallel to the incident plane, and its magnetic vector is perpendicular to the incident plane, that is, only the s component; for s-light, it is just the opposite, as shown in the figure.

Then for p-light, that is,

For magnetic vectors, there are

We can use python to draw the changes of amplitude reflectivity and transmittance of incident light at different angles.

Import matplotlib.pyplot as pltimport numpy as npdef fresnel (theta, N1) N2): theta = theta*np.pi/180 xTheta = np.cos (theta) mid = np.sqrt (1-(n1/n2*np.sin (theta)) * * 2) # Intermediate variable rp = (n2*xTheta-n1*mid) / (n2*xTheta+n1*mid) # p component amplitude reflectivity 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, tsdef testFres: # default N2 is 1.45 theta = np.arange + 0j a = theta*np.pi/180 rp,rs,tp,ts = fresnel (theta,n1,n2) fig = plt.figure (1) plt.subplot (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) 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 ()

Get its image as

Draw through python, and change the testFres in the above program to the following code.

Def testFres: theta = np.arange + 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) 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 (1meme 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 ()

Have to

These are all the contents of the article "how to realize the Wave Model by python Optical Simulation through Fresnel Formula". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 256

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report