⛄一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【光学】基于matlab GUI矩阵法和等效界面法光学薄膜对反射率影响【含Matlab源码 2102期】
点击上面蓝色字体,直接付费下载,即可。
获取代码方式2:
付费专栏Matlab物理应用(初级版)
备注:
点击上面蓝色字体付费专栏Matlab物理应用(初级版),扫描上面二维码,付费29.9元订阅海神之光博客付费专栏Matlab物理应用(初级版),凭支付凭证,私信博主,可免费获得1份本博客上传CSDN资源代码(有效期为订阅日起,三天内有效);
点击CSDN资源下载链接:1份本博客上传CSDN资源代码
⛄二、光学薄膜对反射率影响简介
1 薄膜的反射率
图1 薄膜反射的光路
设在一平面玻璃基片上镀上一层折射率为n的均匀薄膜,膜厚为h,如图1所示,薄膜两边的媒质折射率分别为n0和ng.当光束入射到薄膜上表面时,会得到一系列互相平行的反射光束1′,2′,3′…,和透射光束1′,2′,3′…,应用多光束干涉原理可以得到反射光的合成振幅,从而可以得到反射光强度:
式中r1,r2为入射光束在薄膜上下表面的反射率,δ为反射光束中相邻光之间的相位差,I0为入射光强度,δ=4πλnhcosi其中i为折射角.
在正入射的条件下,有:
2 几点讨论
2.1 薄膜光强反射率与nh/λ的关系
在正入射条件下,取n0=1,ng=1.5薄膜光强反射率与nh/λ的关系曲线如图2所示,图中纵坐标为薄膜光强反射率,横坐标为nh/λ.由图2可以看出:
1)在没有镀膜时,入射光强的反射率为一定值,在图中为一平行于横轴的直线.在镀膜时,薄膜光强反射率随nh/λ呈周期性的变化,其值大于或小于R0,说明光学薄膜可以增强或者减弱反射光(透射光).当n0ng时,其反射率大于R0,反射光强度加强,光学薄膜为增反膜;当n0<n<ng时,其反射率小于R0,根据能量守恒,则透射光强度增加,此时光学薄膜为增透膜.这就是光学薄膜为增反膜(增透膜)其折射率应满足的条件.
2)图2中我们可以看出,当nh/λ=0.5k,(k=0,1,2,…)时,薄膜反射率R与R0相等,说明该光学薄膜不起作用.我们以增反膜为例分析其原因:
若nh=kλ,对增反膜有n0ng,则图1中光束1,2,3…在正入射条件下的相干条件为:
始终满足相干光干涉相消条件,因而薄膜不起作用.对于增透膜也是如此,因而在这些点上R与R0相等.
图2 反射率与nh/λ的关系
图3 反射率与波长的关系
3)图2中只有当nh/λ=0.25 k,(k=1,3,5,7…)时,增透膜R才能达到最大值,增反膜R达到最小值,也就是全透或者全反条件.同2)中所述,光束1,2,3…(1′,2′,3′…)满足的相干条件为:
为相干光干涉加强条件.
2.2 薄膜反射率与入射光波长之间的关系
我们分别选取n=2,h=100 nm(增反膜),n=1.2,h=100 nm(增透膜)给出了薄膜反射率与入射光波长之间的关系曲线,如图3所示.在薄膜厚度一定的条件下,R随λ而变化,只有满足(4)式,R才能达到最大值.当薄膜相对于上下相邻介质的折射率确定,对可见光范围内入射波来说,只要不满足(3)式,光学薄膜反射率比不镀膜时(透射率)有所提高.要满足一定的工程要求,需要镀多层膜来是实现更高的反射率(透射率).
⛄三、部分源代码
function varargout = LAMBDA_MAT02(varargin)
% LAMBDA_MAT02 MATLAB code for LAMBDA_MAT02.fig
% LAMBDA_MAT02, by itself, creates a new LAMBDA_MAT02 or raises the existing
% singleton*.
%
% H = LAMBDA_MAT02 returns the handle to a new LAMBDA_MAT02 or the handle to
% the existing singleton*.
%
% LAMBDA_MAT02(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in LAMBDA_MAT02.M with the given input arguments.
%
% LAMBDA_MAT02(‘Property’,‘Value’,…) creates a new LAMBDA_MAT02 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before LAMBDA_MAT02_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to LAMBDA_MAT02_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 LAMBDA_MAT02
% Last Modified by GUIDE v2.5 12-Jul-2022 01:25:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @LAMBDA_MAT02_OpeningFcn, …
‘gui_OutputFcn’, @LAMBDA_MAT02_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 LAMBDA_MAT02 is made visible.
function LAMBDA_MAT02_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 LAMBDA_MAT02 (see VARARGIN)
% Choose default command line output for LAMBDA_MAT02
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes LAMBDA_MAT02 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = LAMBDA_MAT02_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;
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (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 edit7 as text
% str2double(get(hObject,‘String’)) returns contents of edit7 as a double
% — Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (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 THETAF_Callback(hObject, eventdata, handles)
% hObject handle to THETAF (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 THETAF as text
% str2double(get(hObject,‘String’)) returns contents of THETAF as a double
% — Executes during object creation, after setting all properties.
function THETAF_CreateFcn(hObject, eventdata, handles)
% hObject handle to THETAF (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 P_Callback(hObject, eventdata, handles)
% hObject handle to P (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 P as text
% str2double(get(hObject,‘String’)) returns contents of P as a double
% — Executes during object creation, after setting all properties.
function P_CreateFcn(hObject, eventdata, handles)
% hObject handle to P (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 N_Callback(hObject, eventdata, handles)
% hObject handle to N (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 N as text
% str2double(get(hObject,‘String’)) returns contents of N as a double
% — Executes during object creation, after setting all properties.
function N_CreateFcn(hObject, eventdata, handles)
% hObject handle to N (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 H_Callback(hObject, eventdata, handles)
% hObject handle to H (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 H as text
% str2double(get(hObject,‘String’)) returns contents of H as a double
% — Executes during object creation, after setting all properties.
function H_CreateFcn(hObject, eventdata, handles)
% hObject handle to H (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
⛄四、运行结果
⛄五、备注
1 matlab版本
2014a
2 参考文献
[1] 陈丽菊,肖胜利,朱峰,任文辉.对光学薄膜反射率的讨论[J].太原师范学院学报(自然科学版). 2005,(03)
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除