收藏 分销(赏)

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

上传人:天**** 文档编号:3868040 上传时间:2024-07-22 格式:DOCX 页数:13 大小:185.94KB 下载积分:8 金币
下载 相关
MATLAB仿真平面电磁波在不同媒介分界面上的入射复习课程.docx_第1页
第1页 / 共13页
MATLAB仿真平面电磁波在不同媒介分界面上的入射复习课程.docx_第2页
第2页 / 共13页


点击查看更多>>
资源描述
MATLAB仿真平面电磁波在不同媒介分界面上的入射 精品文档 MATLAB仿真平面电磁波在不同媒介分界面上的入射、反射和折射 一、实验目的: 1、 进一步学习MATLAB,初步掌握GUI界面的编程。 2、 通过编程实现电磁波仿真效果图。 3、 进一步理解平面电磁波的入射、反射和折射现象 二、实验要求: 1、 以电场为例,动态演示平面电磁波的传播情况。 2、 可以任意设置媒介的介电常数和入射角。 3、 考虑金属导体和空气的分界面平面电磁波的入射、反射情况。 三、实验原理: 电磁波从一种媒质入射到第二种媒质时,分界面使一部分能量反射回第一种媒质,另一部分能量折射到第二种媒质中,反射波和折射波得大小和相位取决于分界面两侧的媒质特性、极化方向和入射角大小等,当电磁波入射到理想导体表面时,会发生全反射。这一过程中包括的主要原理有以下三点。 1、正弦平面波在媒质分界面的反射和折射规律 波对分界面的入射是任意的,但为了方便,我们假设入射面与zox面重合。波在z>0时发生入射和反射,在z<0时发生折射并令空间任意一点处 的 入 射 波、反射波和折射波场强为: 图表 1 正弦波斜入射示意图 根据在z=0的界面上电场强度的切线分量相等的边界条件,有 故必有 反射定律: 折射定律: 2、 正弦平面波对理想介质的斜入射 ① 垂直极化波 垂直极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强。 在第一煤质中 在第二煤质中 图表 2 垂直极化波斜入射 ② 平行极化波 平行极化波对理想介质斜入射如图所示,由折射和反射定律,我们可以得到在任意媒质中的场强。 在第一煤质中 在第二煤质中 图表 3 平行极化波斜入射 3、 正弦平面波对理想导体表面的斜入射 ① 垂直极化波 垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强。 ② 平行极化波 垂直极化波对理想导体斜入射如图所示,入射波在导体表面发生全反射,我们可以得到在任意媒质中的场强。 四、实验程序; 实验程序比较长,可参见此文件夹中的jm.m文件。(附件) 生成的界面: 五、实验总结; 这次实验总体感觉收获比较大。 首先,之前学习的MATLAB都是基于图片之类的编程,没有学习过GUI的使用。通过这次实验,我初步学习了一下GUI,算是现学现卖吧。虽然学的不是很深,但是对于基本的功能的使用应该还是可以的。 再次,对于电磁场地学习都是停留在书面作业上,通过这次实验,加深了我对电磁场传播的理解。 最后,其实如果只有我一个人,应该是很难完成这次实验的,在这期间有同学的帮忙和合作。通过这次实验,感受到合作的力量,不懂要问呐。 程序代码: function varargout = jm(varargin) % JM M-file for jm.fig % JM, by itself, creates a new JM or raises the existing % singleton*. % % H = JM returns the handle to a new JM or the handle to % the existing singleton*. % % JM('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in JM.M with the given input arguments. % % JM('Property','Value',...) creates a new JM or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before jm_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to jm_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help jm % Last Modified by GUIDE v2.5 13-May-2011 00:01:24 % Begin initialization code - DO NOT EDIT 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', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before jm is made visible. function jm_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to jm (see VARARGIN) % Choose default command line output for jm handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes jm wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = jm_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushbutton1. function pushbutton1_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; for i=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) %hold on %plot(0,-60:0.01:60) %hold on plot(x,y,x1,y1,x2,-y2,[-50 50],[0 0],'k',[0 0],[-50 50],'k'); su=get(handles.edit2); su=str2num(su.String); sudu=1/su; pause(sudu) end function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit5_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit8_Callback(hObject, eventdata, handles) % hObject handle to edit8 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit8 as text % str2double(get(hObject,'String')) returns contents of edit8 as a double % --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, eventdata, handles) % hObject handle to edit8 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit10_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit10_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double % --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end 收集于网络,如有侵权请联系管理员删除
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服