MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx

上传人:b****6 文档编号:7461034 上传时间:2023-05-11 格式:DOCX 页数:16 大小:211.53KB
下载 相关 举报
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第1页
第1页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第2页
第2页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第3页
第3页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第4页
第4页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第5页
第5页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第6页
第6页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第7页
第7页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第8页
第8页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第9页
第9页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第10页
第10页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第11页
第11页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第12页
第12页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第13页
第13页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第14页
第14页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第15页
第15页 / 共16页
MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx

《MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx》由会员分享,可在线阅读,更多相关《MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx(16页珍藏版)》请在冰点文库上搜索。

MATLAB仿真平面电磁波在不同媒介分界面上的入射.docx

MATLAB仿真平面电磁波在不同媒介分界面上的入射

MATLAB仿真平面电磁波在不同媒介分界面上的入射、反射和折射

一、实验目的:

1、进一步学习MATLAB,初步掌握GUI界面的编程。

2、通过编程实现电磁波仿真效果图。

3、进一步理解平面电磁波的入射、反射和折射现象

二、实验要求:

1、以电场为例,动态演示平面电磁波的传播情况。

2、可以任意设置媒介的介电常数和入射角。

3、考虑金属导体和空气的分界面平面电磁波的入射、反射情况.

三、实验原理:

电磁波从一种媒质入射到第二种媒质时,分界面使一部分能量反射回第一种媒质,另一部分能量折射到第二种媒质中,反射波和折射波得大小和相位取决于分界面两侧的媒质特性、极化方向和入射角大小等,当电磁波入射到理想导体表面时,会发生全反射。

这一过程中包括的主要原理有以下三点.

1、正弦平面波在媒质分界面的反射和折射规律

波对分界面的入射是任意的,但为了方便,我们假设入射面与zox面重合。

波在z〉0时发生入射和反射,在z<0时发生折射并令空间任意一点

处的入射波、反射波和折射波场强为:

图表1正弦波斜入射示意图

根据在z=0的界面上电场强度的切线分量相等的边界条件,有

故必有

反射定律:

折射定律:

2、正弦平面波对理想介质的斜入射

1垂直极化波

垂直极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强.

在第一煤质中

在第二煤质中

图表2垂直极化波斜入射

2平行极化波

平行极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强。

在第一煤质中

在第二煤质中

图表3平行极化波斜入射

 

3、正弦平面波对理想导体表面的斜入射

1垂直极化波

垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强。

2平行极化波

垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强.

四、实验程序;

实验程序比较长,可参见此文件夹中的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—DONOTEDIT

gui_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});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

});

end

%Endinitializationcode-DONOTEDIT

%——-Executesjustbeforejmismadevisible。

functionjm_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved—tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstojm(seeVARARGIN)

%Choosedefaultcommandlineoutputforjm

handles。

output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesjmwaitforuserresponse(seeUIRESUME)

%uiwait(handles。

figure1);

%———Outputsfromthisfunctionarereturnedtothecommandline。

functionvarargout=jm_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%hObjecthandletofigure

%eventdatareserved—tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles。

output;

%—--Executesonbuttonpressinpushbutton1。

functionpushbutton1_Callback(hObject,eventdata,handles)

axes(handles.axes1);

mu1=1;%c´Åµ¼ÂÊ1

mu2=1;%c´Åµ¼ÂÊ2

w=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:

900

yv=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)

%holdon

plot(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)

end

functionedit2_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');

end

functionedit1_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');

end

functionedit5_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');

end

functionedit8_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’);

end

functionedit10_Callback(hObject,eventdata,handles)

%hObjecthandletoedit2(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%han

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2