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(s
3、ita)*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:40,0)%hold on %plot(0,-60:60)%hold on plot(x,y,x1,y1,x2,-y2,-50 50,0 0,k,0 0,-50 50,k); su=get;su=str2num;sudu=1/
4、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% str
5、2double(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 emp
6、ty - 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 pushbut
7、ton1 (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% ha
8、ndles 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,
9、 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(hObjec
10、t,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 (
11、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
12、)% 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,defaultUicontrolBa
13、ckgroundColor) 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) re
14、turns 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 f
15、uture 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,w
16、hite);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(
17、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 - han
18、dles 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,
19、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 ob
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1