大学物理自定义实验A rough simulation of rainbow.docx_第1页
大学物理自定义实验A rough simulation of rainbow.docx_第2页
大学物理自定义实验A rough simulation of rainbow.docx_第3页
大学物理自定义实验A rough simulation of rainbow.docx_第4页
大学物理自定义实验A rough simulation of rainbow.docx_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

A rough simulation of rainbow1351956 Thomas Xia, School of Automotive Studies, Tongji University 1. AbstractIn this project, I would like to explore how rainbows come into being and simulate a rainbow by software.Equipment: Laptop (ASUS A450E47JF-SL), Software(Matlab R2014a、Photoshop CC 2014).2. Analysis & Calculation2.1 After a shower of rain or nearby a waterfall, thin fog consist of tiny water drops will be widespread in the air. The parallel sunlight cast on a single drop will have two refractions and one reflection on the surface. Since water has different indexes of refraction to lights of different frequency, as a result, the drop bends light of different colors by different angles.2.2 Suppose the sunlight is horizontal, relative index of reflection of light with frequency v is n21. The radium of the drop is r. A beam has a distance h from the center of the drop. Angle of incidence is i. Angle of refraction is r。 The angle that light is bent .Rr”i”hirrisinisinr=n21 , r=i,=r,=i, ,sini,sinr,=1n21 , i=arcsinhR ,=2-2-i,-r,-i-r-r,-i, , (h)=4arcsinhRn21-2arcsinhR Because parallel beams of sunlight are evenly distributed in 0hR, for two near points on function (h), independent variable difference h can represent number of beams shoot out by angle from 0 to (0 + ):h0= 0 , h0+h= 0+ ,then,lim0h=dhd=-1(0) can represent the density of lights shoot out by angle 0.【In Matlab, we can also use function (h) to get many random data (i,hi) first, and then use function “ksdensity” to calculate s distribution to represent light density】Chapter 2.2 calculated the function between light density and angle by two ways, we mark this function as (). The function fits every single drop in the fog.Sydyd2.3 We simplify the thin water fog described in 2.1 into a very tall cube, which is from observers eyes by distance S. And only drops on its surface can sparkle directly into observers eyes.y=Stan dy=Ssec2tand Luminance received by the observerL=Cnumberdrop =C()(dxdy)=C()sec2tan (C、Care constants,is drops number density on the surface, dx is unit width) Here we ignore the energy loss when light travel long distance through the air.3. Simulation process3.1 Look up index of refraction of different lights on the Internet.wavelengthOptical glassWaterZFQKred656nm1.64441.51451.3311yellow589.3nm1.64991.51701.3330cyan486.1nm1.66571.52301.3371purple404.7nm1.68521.53181.3428for k=1:1:N h=rand(); alpha(1,k)=4*asin(h/n21)-2*asin(h);endy3=ksdensity(alpha*360/pi,0:0.1:100);for k=1:1:1001alpha=(0.1*k)*pi/360; y3(1,k)=10000*pi*(sec(alpha)2*tan(alpha)*y3(1,k);endplot(0:0.1:100,y3,g)hold on;n21=1.3428;alpha=0*rand(1,N);for k=1:1:N h=rand(); alpha(1,k)=4*asin(h/n21)-2*asin(h);endy4=ksdensity(alpha*360/pi,0:0.1:100);for k=1:1:1001 alpha=(0.1*k)*pi/360;y4(1,k)=10000*pi*(sec(alpha)2*tan(alpha)*y4(1,k);endplot(0:0.1:100,y4,m)clear;clc;N=50000000;n21=1.3311;alpha=0*rand(1,N);%随机取N个(h,)for k=1:1:N h=rand(); alpha(1,k)=4*asin(h/n21)-2*asin(h);end%单个水滴的出射光线分布y1=ksdensity(alpha*360/pi,0:0.1:100);%观察者眼中的光照强度for k=1:1:1001 alpha=(0.1*k)*pi/360;y1(1,k)=10000*pi*(sec(alpha)2*tan(alpha)*y1(1,k);endplot(0:0.1:100,y1,r)hold on;n21=1.3330;alpha=0*rand(1,N);for k=1:1:N h=rand(); alpha(1,k)=4*asin(h/n21)-2*asin(h);endy2=ksdensity(alpha*360/pi,0:0.1:100);for k=1:1:1001alpha=(0.1*k)*pi/360; y2(1,k)=10000*pi*(sec(alpha)2*tan(alpha)*y2(1,k);endplot(0:0.1:100,y2,y)hold on;n21=1.3371;alpha=0*rand(1,N);3.2 Make use of the calculation in chapter2 to design algorithm, run the program below in Matlab:y1(x), y2(x), y3(x), y4(x) are the luminance function of light with wavelength 656nm, 589.3nm, 486.1nm, 404.7nm, which are stored in Matlab Workspace now. This is a simulated “rainbow” in data form.3.3 Input function y1(x) y4(x) into Photoshop Gradient Tool, using the change of transparency to simulate the change of light luminance.3.4 Use several single-color layers to simulate light with different wavelengths in sunlight. Apply gradient styles we get in 3.3 to corresponding layers mask. At last, Photoshop can draw out the rainbow simulated in Matlab.Relative luminance / unit4. ConclusionVision angle / degree4.1. Simulation in MATLAB4.2. Simulation in PhotoshopFrom the simulation we know, Rainbow do appear when sunlight is cast on thin fog in assumed situation. It has a vision angle of approximate eighty degrees, when sunlight is horizontal. The red light, with the longest wavelength

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论