1、MATLAB仿真平面电磁波在不同媒介分界面上的入射MATLAB仿真平面电磁波在不同媒介分界面上的入射、反射和折射一、实验目的:1、进一步学习MATLAB,初步掌握GUI界面的编程。2、通过编程实现电磁波仿真效果图。3、进一步理解平面电磁波的入射、反射和折射现象二、实验要求:1、以电场为例,动态演示平面电磁波的传播情况。2、可以任意设置媒介的介电常数和入射角。3、考虑金属导体和空气的分界面平面电磁波的入射、反射情况。三、实验原理:电磁波从一种媒质入射到第二种媒质时,分界面使一部分能量反射回第一种媒质,另一部分能量折射到第二种媒质中,反射波和折射波得大小和相位取决于分界面两侧的媒质特性、极化方向和
2、入射角大小等,当电磁波入射到理想导体表面时,会发生全反射。这一过程中包括的主要原理有以下三点。1、正弦平面波在媒质分界面的反射和折射规律波对分界面的入射是任意的,但为了方便,我们假设入射面与zox面重合。波在z0时发生入射和反射,在zx=-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)*y
3、v1;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)
4、;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
5、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
6、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);
7、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
8、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
9、_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 COMPUTE
10、R.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 structur
11、e 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)% hOb
12、ject 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,BackgroundCo
13、lor), 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) %
14、 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 r
15、eserved - 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)
16、 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
17、 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
18、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% handl
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1