MATLAB仿真平面电磁波在不同媒介分界面上的入射_第1页
MATLAB仿真平面电磁波在不同媒介分界面上的入射_第2页
MATLAB仿真平面电磁波在不同媒介分界面上的入射_第3页
MATLAB仿真平面电磁波在不同媒介分界面上的入射_第4页
MATLAB仿真平面电磁波在不同媒介分界面上的入射_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

./MATLAB仿真平面电磁波在不同媒介分界面上的入射、反射和折射一、实验目的:进一步学习MATLAB,初步掌握GUI界面的编程。通过编程实现电磁波仿真效果图。进一步理解平面电磁波的入射、反射和折射现象二、实验要求:以电场为例,动态演示平面电磁波的传播情况。可以任意设置媒介的介电常数和入射角。考虑金属导体和空气的分界面平面电磁波的入射、反射情况。三、实验原理:电磁波从一种媒质入射到第二种媒质时,分界面使一部分能量反射回第一种媒质,另一部分能量折射到第二种媒质中,反射波和折射波得大小和相位取决于分界面两侧的媒质特性、极化方向和入射角大小等,当电磁波入射到理想导体表面时,会发生全反射。这一过程中包括的主要原理有以下三点。1、正弦平面波在媒质分界面的反射和折射规律波对分界面的入射是任意的,但为了方便,我们假设入射面与zox面重合。波在z>0时发生入射和反射,在z<0时发生折射并令空间任意一点处的入射波、反射波和折射波场强为:图表SEQ图表\*ARABIC1正弦波斜入射示意图根据在z=0的界面上电场强度的切线分量相等的边界条件,有故必有反射定律:折射定律:正弦平面波对理想介质的斜入射垂直极化波垂直极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强。在第一煤质中在第二煤质中图表SEQ图表\*ARABIC2垂直极化波斜入射平行极化波平行极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强。在第一煤质中在第二煤质中图表SEQ图表\*ARABIC3平行极化波斜入射正弦平面波对理想导体表面的斜入射垂直极化波垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强。平行极化波垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强。四、实验程序;实验程序比较长,可参见此文件夹中的jm.m文件。〔附件生成的界面:五、实验总结;这次实验总体感觉收获比较大。首先,之前学习的MATLAB都是基于图片之类的编程,没有学习过GUI的使用。通过这次实验,我初步学习了一下GUI,算是现学现卖吧。虽然学的不是很深,但是对于基本的功能的使用应该还是可以的。再次,对于电磁场地学习都是停留在书面作业上,通过这次实验,加深了我对电磁场传播的理解。最后,其实如果只有我一个人,应该是很难完成这次实验的,在这期间有同学的帮忙和合作。通过这次实验,感受到合作的力量,不懂要问呐。程序代码:functionvarargout=jm<varargin>%JMM-fileforjm.fig%JM,byitself,createsanewJMorraisestheexisting%singleton*.%%H=JMreturnsthehandletoanewJMorthehandleto%theexistingsingleton*.%%JM<'CALLBACK',hObject,eventData,handles,...>callsthelocal%functionnamedCALLBACKinJM.Mwiththegiveninputarguments.%%JM<'Property','Value',...>createsanewJMorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforejm_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.Allinputsarepassedtojm_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone%instancetorun<singleton>".%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpjm%LastModifiedbyGUIDEv2.513-May-201100:01:24%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct<'gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',jm_OpeningFcn,...'gui_OutputFcn',jm_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]>;ifnargin&&ischar<varargin{1}>gui_State.gui_Callback=str2func<varargin{1}>;endifnargout[varargout{1:nargout}]=gui_mainfcn<gui_State,varargin{:}>;elsegui_mainfcn<gui_State,varargin{:}>;end%Endinitializationcode-DONOTEDIT%Executesjustbeforejmismadevisible.functionjm_OpeningFcn<hObject,eventdata,handles,varargin>%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%varargincommandlineargumentstojm<seeVARARGIN>%Choosedefaultcommandlineoutputforjmhandles.output=hObject;%Updatehandlesstructureguidata<hObject,handles>;%UIWAITmakesjmwaitforuserresponse<seeUIRESUME>%uiwait<handles.figure1>;%Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=jm_OutputFcn<hObject,eventdata,handles>%varargoutcellarrayforreturningoutputargs<seeVARARGOUT>;%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback<hObject,eventdata,handles>axes<handles.axes1>;mu1=1;%c´Åµ¼ÂÊ1mu2=1;%c´Åµ¼ÂÊ2w=get<handles.edit5>;w=str2num<w.String>;%¼«»¯ÆµÂÊa=get<handles.edit3>;epsilon1=str2num<a.String>;%½éÖÊ1µÄÏà¶Ô½éµç³£Êýb=get<handles.edit4>;epsilon2=str2num<b.String>%½éÖÊ2µÄÏà¶Ô½éµç³£Êý;k1=w*sqrt<mu1*epsilon1>;k2=w*sqrt<mu2*epsilon2>;sita=get<handles.edit1>;sita=str2num<sita.String>;sita1=asind<k1*sind<sita>./k2>;xv=0:pi/10:20*pi;ym=xv;%plot<ym>er=0.5;fori=1:900yv=sin<xv+pi/30*i>;%%>>>>²¨Ðκ¯Êýx=-xv*sind<sita>;y=xv*cosd<sita>;x=x+cosd<sita>*yv;y=y+sind<sita>*yv;xv1=0:pi/10:20*pi;yv1=sqrt<1-er*er>*sin<xv-pi/30*i>;%%>>>·´É䲨Ðκ¯Êýx1=xv1*sind<sita>;y1=xv1*cosd<sita>;x1=x1-2*cosd<sita>*yv1;y1=y1+sind<sita>*yv1;xv2=0:pi/10:20*pi;yv2=er*sin<xv-pi/30*i>;%%>>>ÕÛÉ䲨Ðκ¯Êýx2=xv2*sind<sita1>;y2=xv2*cosd<sita1>;x2=x2-cosd<sita1>*yv2;y2=y2+sind<sita1>*yv2;%plot<zeros<1:81>>%plot<-40:0.01:40,0>%holdon%plot<0,-60:0.01:60>%holdonplot<x,y,x1,y1,x2,-y2,[-5050],[00],'k',[00],[-5050],'k'>;su=get<handles.edit2>;su=str2num<su.String>;sudu=1/su;pause<sudu>endfunctionedit2_Callback<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit2astext%str2double<get<hObject,'String'>>returnscontentsofedit2asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit2_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal<get<hObject,'BackgroundColor'>,get<0,'defaultUicontrolBackgroundColor'>>set<hObject,'BackgroundColor','white'>;end%hObjecthandletopushbutton1<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>functionedit3_Callback<hObject,eventdata,handles>%hObjecthandletoedit3<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit3astext%str2double<get<hObject,'String'>>returnscontentsofedit3asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit3_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit3<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal<get<hObject,'BackgroundColor'>,get<0,'defaultUicontrolBackgroundColor'>>set<hObject,'BackgroundColor','white'>;endfunctionedit1_Callback<hObject,eventdata,handles>%hObjecthandletoedit1<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit1astext%str2double<get<hObject,'String'>>returnscontentsofedit1asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit1_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit1<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal<get<hObject,'BackgroundColor'>,get<0,'defaultUicontrolBackgroundColor'>>set<hObject,'BackgroundColor','white'>;endfunctionedit5_Callback<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit2astext%str2double<get<hObject,'String'>>returnscontentsofedit2asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit5_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal<get<hObject,'BackgroundColor'>,get<0,'defaultUicontrolBackgroundColor'>>set<hObject,'BackgroundColor','white'>;endfunctionedit8_Callback<hObject,eventdata,handles>%hObjecthandletoedit8<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit8astext%str2double<get<hObject,'String'>>returnscontentsofedit8asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit8_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit8<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal<get<hObject,'BackgroundColor'>,get<0,'defaultUicontrolBackgroundColor'>>set<hObject,'BackgroundColor','white'>;endfunctionedit10_Callback<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata<seeGUIDATA>%Hints:get<hObject,'String'>returnscontentsofedit2astext%str2double<get<hObject,'String'>>returnscontentsofedit2asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit10_CreateFcn<hObject,eventdata,handles>%hObjecthandletoedit2<seeGCBO>%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:e

温馨提示

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

评论

0/150

提交评论