1、椭圆偏振光的仿真计算光电综合设计学院:理学院 专业:应用物理学姓名:闻奚跃 学号:B110806232015年1月4日2015年1月8日目 录一、课题1:课题名称 11.1.课题任务要求及技术指标 11.2.课题分析及设计思路 11.3.系统设计(建模) 11.4.仿真结果与结果分析 1二、课题2:课题名称 22.1.课题任务要求及技术指标 22.2.课题分析及设计思路 22.3.系统设计(建模) 22.4.仿真结果与结果分析 2三、课题3:课题名称 33.1.课题任务要求及技术指标 33.2.课题分析及设计思路 33.3.系统设计(建模) 33.4.仿真结果与结果分析 3四、课程设计小结 4
2、一、课题1:课题名称1.1.课题任务要求及技术指标椭圆偏振光的仿真计算设计任务:根据椭圆偏振光公式: (1)做出对应不同值的椭圆偏振图;(2)两椭圆(包括圆)偏振光的叠加。设计要求:(1)具有友好输入输出界面;(2)可根据输入的不同参数值,查看结果。参考:物理光学椭圆偏振光1.2.课题分析及设计思路 1.3.系统设计(建模)function varargout = wxy3(varargin)gui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_Openin
3、gFcn, wxy3_OpeningFcn, . gui_OutputFcn, wxy3_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end function wxy3_Openin
4、gFcn(hObject, eventdata, handles, varargin)handles.output = hObject;guidata(hObject, handles);function varargout = wxy3_OutputFcn(hObject, eventdata, handles) varargout1 = handles.output;function editx_Callback(hObject, eventdata, handles)input = str2num(get(hObject,String);if (isempty(input) set(hO
5、bject,String,);endguidata(hObject, handles); function editx_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);end function edity_Callback(hObject, eventdata, handles)input = str2num(get(hObject,Str
6、ing);if (isempty(input) set(hObject,String,);endguidata(hObject, handles);function edity_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);Else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edita_Callback(hObject, eventdata, handles)inp
7、ut = str2num(get(hObject,String);if (isempty(input) set(hObject,String,);endguidata(hObject, handles);function edita_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction pushbutton1_Callba
8、ck(hObject, eventdata, handles)X=str2num(get(handles.editx,String);Y=str2num(get(handles.edity,String);a=str2num(get(handles.edita,String);syms x yf=(x./X).2+(y./Y).2-2.*(x./X).*(y./Y).*cos(a)-sin(a).*sin(a);axes(handles.axes1);ezplot(f,-2*X,2*X);grid on;guidata(hObject, handles); function editx2_Ca
9、llback(hObject, eventdata, handles) function editx2_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edity2_Callback(hObject, eventdata, handles)function edity2_CreateFcn(hObject, even
10、tdata, handles)if ispc set(hObject,BackgroundColor,white);elseset(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edita2_Callback(hObject, eventdata, handles) function edita2_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,
11、BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction pushbutton2_Callback(hObject, eventdata, handles)X=str2num(get(handles.editx2,String);Y=str2num(get(handles.edity2,String);a=str2num(get(handles.edita2,String);syms x yf=(x./X).2+(y./Y).2-2.*(x./X).*(y./Y).*cos(a)-sin(a).*sin(a);axes
12、(handles.axes2);ezplot(f,-2*X,2*X);grid on;guidata(hObject, handles); function pushbutton3_Callback(hObject, eventdata, handles)X=str2num(get(handles.editx,String);Y=str2num(get(handles.edity,String);a=str2num(get(handles.edita,String);syms x yf1=(x./X).2+(y./Y).2-2.*(x./X).*(y./Y).*cos(a)-sin(a).*s
13、in(a);X2=str2num(get(handles.editx2,String);Y=str2num(get(handles.edity2,String);a=str2num(get(handles.edita2,String);syms x yf2=(x./X2).2+(y./Y).2-2.*(x./X2).*(y./Y).*cos(a)-sin(a).*sin(a);f=f1+f2;axes(handles.axes3);ezplot(f,-2*(X+X2),2*(X+X2);grid on;guidata(hObject, handles);1.4.仿真结果与结果分析 二、课题2:
14、课题名称2.1.课题任务要求及技术指标高斯光束特性参数的仿真计算设计任务:某平凹腔激光器,若已知凹面镜曲率半径,腔长及激光波长。求它所产生的高斯光束的腰斑半径的大小和位置,以及该高斯光束发散角的大小。设计要求:(1)具有友好输入输出界面;(2)可改变参数值(曲率半径,腔长、激光波长),查看结果变化情况;(3)比较所得结果,分析曲率半径、腔长以及激光波长分别对高斯光束的腰斑半径和发散角有何影响。参考:激光原理高斯光束2.2.课题分析及设计思路 2.3.系统设计(建模)function varargout = wxy6(varargin)gui_Singleton = 1;gui_State =
15、struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, wxy6_OpeningFcn, . gui_OutputFcn, wxy6_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, va
16、rargin:);else gui_mainfcn(gui_State, varargin:);end function wxy6_OpeningFcn(hObject, , handles, varargin)handles.output = hObject;guidata(hObject, handles);function varargout = wxy6_OutputFcn(, , handles)varargout1 = handles.output;function popupmenuB_Callback(hObject, , handles)index=get(hObject,V
17、alue);set(handles.uipanelbc,Visible,off);switch(index) case 6 set(handles.uipanelbc,Visible,on); otherwiseendfunction popupmenuB_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);Endfunction editR_
18、Callback(hObject, eventdata, handles)input = str2num(get(hObject,String);if (isempty(input) set(hObject,String,);endguidata(hObject, handles); function editR_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgr
19、oundColor);end function editL_Callback(hObject, eventdata, handles)input = str2num(get(hObject,String);if (isempty(input) set(hObject,String,);endguidata(hObject, handles);function editL_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor
20、,get(0,defaultUicontrolBackgroundColor);endfunction editW_Callback(hObject, eventdata, handles)function editW_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);end function editJ_Callback(hObject,
21、eventdata, handles)function editJ_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction pushbuttonCalc_Callback(hObject, eventdata, handles)R = str2double(get(handles.editR,String);L = str2
22、double(get(handles.editL,String);if(isempty(get(handles.editR,String) msgbox(请输入曲率半径,出错.);elseif(isempty(get(handles.editL,String) msgbox(请输入腔长,出错.);elseif(R=L) msgbox(平凹稳定腔的曲率半径应大于腔长,请重新输入,出错啦.); set(handles.editR,String,); set(handles.editL,String,)else B=0; index=get(handles.popupmenuB,Value); sw
23、itch(index) case 1 B=441.6; case 2 B=632.8; case 3 B=694.3; case 4 B=1060.0; case 5 B=10600; case 6 B=str2double(get(handles.editB,String); otherwise end f = sqrt(L*(R-L); w = sqrt(f*B*0.000000001/3.14); j=2*sqrt(B*0.000000001/(3.14*f); w j set(handles.editW,String,num2str(w); set(handles.editJ,Stri
24、ng,num2str(j); guidata(hObject, handles);endfunction editB_Callback(hObject, eventdata, handles)input = str2num(get(hObject,String);if (isempty(input) set(hObject,String,);endguidata(hObject, handles);function editB_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);els
25、e set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction pushbuttonwb_Callback(hObject, eventdata, handles)function editR2_Callback(hObject, eventdata, handles)function editR2_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,Ba
26、ckgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction editL2_Callback(hObject, eventdata, handles)function editL2_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction pushbutton
27、6_Callback(hObject, eventdata, handles)function edit16_Callback(hObject, eventdata, handles)function edit16_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edit17_Callback(hObject, ev
28、entdata, handles)function edit17_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edit18_Callback(hObject, eventdata, handles)function edit18_CreateFcn(hObject, eventdata, handles)if i
29、spc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction edit19_Callback(hObject, eventdata, handles)if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);endfunction axes1_CreateFcn(hObject, eventdata, handles)function editB4_Callback(hObject, eventdata, handles)function