首页 微波实验报告 smith原图 matlab

微波实验报告 smith原图 matlab

举报
开通vip

微波实验报告 smith原图 matlab微波通信技术课程设计报告 Smith圆图软件 一:Smith圆图简要说明 用户输入阻抗实部与虚部在对应位置,以及特性阻抗。软件通过程序计算出导纳值、反射系数、相位、波长、驻波比、行波系数以及如何实现匹配,并显示在对应位置,其中实现匹配的方法显示在软件下方蓝色区域内;点击清楚图像可清楚归一化电阻圆、归一化电抗圆以及等反射系数圆;取点画图可在图像区域内根据鼠标确定点画出对应的归一化电阻圆等,以及显示导纳值等相关数据。单枝节匹配和双枝节匹配可根据输入的阻抗值和特性阻抗画出匹配图并标明对应点,其中单枝节匹配还可在下方显...

微波实验报告 smith原图 matlab
微波通信技术课程 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 报告 Smith圆图软件 一:Smith圆图简要说明 用户输入阻抗实部与虚部在对应位置,以及特性阻抗。软件通过程序计算出导纳值、反射系数、相位、波长、驻波比、行波系数以及如何实现匹配,并显示在对应位置,其中实现匹配的方法显示在软件下方蓝色区域内;点击清楚图像可清楚归一化电阻圆、归一化电抗圆以及等反射系数圆;取点画图可在图像区域内根据鼠标确定点画出对应的归一化电阻圆等,以及显示导纳值等相关数据。单枝节匹配和双枝节匹配可根据输入的阻抗值和特性阻抗画出匹配图并标明对应点,其中单枝节匹配还可在下方显示出来具体的匹配 方案 气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载 。以上是该smith原图所有的功能。 二:Smith圆图的设计目的和要求 设计目的: 通过具体的软件编程和多媒体制作,进一步加深对微波通信技术的理解和掌握,提高动手能力,提高解决实际问题的综合能力。 设计要求: 整个圆图软件分为用户图形界面模块、圆图计算模块、画图演示模块。上述: 大模块又进一步分解,其中用户图形界面模块分为:主页、主菜单;圆图计算模块分为反射系数计算、单支节匹配计算、输入阻抗计算以及整个Smith圆图;画图演示模块分为等归一化电阻圆、等归一化电抗圆、反射系数圆等;确定阻抗值在圆图上的位置、圆图的基本应用、求输入阻抗及其在圆图上的位置以及单支节匹配等问题。 三:Smith圆图的程序 流程 快递问题件怎么处理流程河南自建厂房流程下载关于规范招聘需求审批流程制作流程表下载邮件下载流程设计 图 清除图像可根据需要在画图步骤后执行,清楚图像值清楚归一化电阻圆、归一化电抗圆等,并不清楚圆图的基本构架图 四:演示验证过程 输入阻抗和特性阻抗点击确定图: 点击清除图像后的图: 点击单枝节匹配图: 点击双枝节匹配图: 点击取点画图: 五:总结 1.心得体会:这次课设收获最多的觉得是matlab guide图像交互界面的使用与设计。这次程序的设计,明白了guide里面控件string、tag的重要性。在这次设计中,在网上找了两个程序做辅导,因为网上的资料并不需要figure就能成功运行,编程的方法不一样,所以通过自己各种查找资料(包括百度知道、百度文库、以及matlab技术论坛电子期刊等、)学习了guide的重要语句的使用,包括handles语句、str2double语句、set语句、delete语句的使用,明白了这几个基础语句的使用,在加上smith原理算法,从而成功的用自己的方法实现了smith原图的功能。 2.源程序: function varargout = liujiaqingnew(varargin) % LIUJIAQINGNEW MATLAB code for liujiaqingnew.fig %      LIUJIAQINGNEW, by itself, creates a new LIUJIAQINGNEW or raises the existing %      singleton*. % %      H = LIUJIAQINGNEW returns the handle to a new LIUJIAQINGNEW or the handle to %      the existing singleton*. % %      LIUJIAQINGNEW('CALLBACK',hObject,eventData,handles,...) calls the local %      function named CALLBACK in LIUJIAQINGNEW.M with the given input arguments. % %      LIUJIAQINGNEW('Property','Value',...) creates a new LIUJIAQINGNEW or raises the %      existing singleton*.  Starting from the left, property value pairs are %      applied to the GUI before liujiaqingnew_OpeningFcn gets called.  An %      unrecognized property name or invalid value makes property application %      stop.  All inputs are passed to liujiaqingnew_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 liujiaqingnew % Last Modified by GUIDE v2.5 07-Jun-2013 00:23:26 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name',      mfilename, ... 'gui_Singleton',  gui_Singleton, ... 'gui_OpeningFcn', @liujiaqingnew_OpeningFcn, ... 'gui_OutputFcn',  @liujiaqingnew_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 liujiaqingnew is made visible. function liujiaqingnew_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 liujiaqingnew (see VARARGIN) % Choose default command line output for liujiaqingnew handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes liujiaqingnew wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = liujiaqingnew_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 pushbutton7. function pushbutton7_Callback(hObject, eventdata, handles) % hObject    handle to pushbutton7 (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) %handles(axes1); for R0=[0 0.2 0.5 1 2 ]; for X0=[-4 -2 -1  -0.5 -0.3 0.3 0.5  1 2 4];%循环输入归一化阻抗 tr=2*pi*(0:0.005:1); rr=1/(1+R0);cr=1-rr; plot(cr+rr*cos(tr),rr*sin(tr),'g');%画电阻圆 axis square; hold on; x=X0; rx=1/x;cx=rx; tx=2*atan(x)*(0:0.01:1); if tx=0    A=(180/pi)*A0; else A=(180/pi)*(A0+2*pi); end    if V>=0 L=(0.5/360)*(180-A); else L=0.75-(0.5/360)*A; end                                            %波长数 %匹配问题 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% z=R+j*X; Gamma2=(z-1)/(z+1); Mod=abs(Gamma2); Phi=angle(Gamma2); if X0<0 if(Phi>=0) Lmin=Phi/(4*pi); Lmax=0.25+Lmin; else Lmin=(pi+Phi)/(4*pi); Lmax=0.25+Lmin; end else if(Phi>=0) Lmax=Phi/(4*pi); Lmin=0.25+Lmax; else Lmax=(pi+Phi)/(4*pi); Lmin=0.25+Lmax; end hold off; end rho=(1+abs(Gamma2))/(1-abs(Gamma2)); Zo1=Zo*sqrt(rho); Zo2=Zo/sqrt(rho); set(handles.Ht5,'string',strcat('在L1=',num2str(Lmax),'λ处并接入特性阻抗为 Zo1 =  ', num2str(Zo1),' Ω 的λ/4传输线可实现匹配'),'fontname','宋体','fontsize',12); set(handles.Ht6,'string',strcat('或在L2=',num2str(Lmin),'λ处并接入特性阻抗为 Zo2 =  ', num2str(Zo2),' Ω 的λ/4传输线可实现匹配'),'fontname','宋体','fontsize',12);        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %显示各种参数值 G = num2str(G); % 转换为字符串 set(handles.G,'string',G); B = num2str(B); % 转换为字符串 set(handles.B,'string',B); zhu_bo_bi= num2str(zhu_bo_bi); % 转换为字符串 set(handles.zhu_bo_bi,'string',zhu_bo_bi); xing_bo_xi_shu = num2str(xing_bo_xi_shu); % 转换为字符串 set(handles.xing_bo_xi_shu,'string',xing_bo_xi_shu); U = num2str(U); % 转换为字符串 set(handles.U,'string',U); V = num2str(V); % 转换为字符串 set(handles.V,'string',V); xw = num2str(A); % 转换为字符串 set(handles.xw,'string',xw); bc= num2str(L); % 转换为字符串 set(handles.bc,'string',bc); guidata(hObject, handles); % 更新结构体 function X_Callback(hObject, eventdata, handles) % hObject    handle to X (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) X= str2double(get(hObject,'String')); % string属性是字符串,所以必须转换成数值 % 检验输入是否为空,是则将它置为0 if (isempty(X)) set(hObject,'String','0') end % 保存handles结构体,只要在handles结构体有改变时,才需要保存 guidata(hObject, handles); % 这里由于handles没有改变,故这里其实没有必要,但是为了避免潜在的不必要麻烦, % 建议在所有Callback最后都添加该命令 % Hints: get(hObject,'String') returns contents of X as text %        str2double(get(hObject,'String')) returns contents of X as a double % --- Executes during object creation, after setting all properties. function X_CreateFcn(hObject, eventdata, handles) % hObject    handle to X (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 R_Callback(hObject, eventdata, handles) % hObject    handle to R (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) R= str2double(get(hObject,'String')); % string属性是字符串,所以必须转换成数值 % 检验输入是否为空,是则将它置为0 if (isempty(R)) set(hObject,'String','0') end % 保存handles结构体,只要在handles结构体有改变时,才需要保存 guidata(hObject, handles); % 这里由于handles没有改变,故这里其实没有必要,但是为了避免潜在的不必要麻烦, % 建议在所有Callback最后都添加该命令 % Hints: get(hObject,'String') returns contents of R as text %        str2double(get(hObject,'String')) returns contents of R as a double % --- Executes during object creation, after setting all properties. function R_CreateFcn(hObject, eventdata, handles) % hObject    handle to R (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 edit26_Callback(hObject, eventdata, handles) % hObject    handle to edit26 (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 edit26 as text %        str2double(get(hObject,'String')) returns contents of edit26 as a double % --- Executes during object creation, after setting all properties. function edit26_CreateFcn(hObject, eventdata, handles) % hObject    handle to edit26 (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 edit27_Callback(hObject, eventdata, handles) % hObject    handle to edit27 (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 edit27 as text %        str2double(get(hObject,'String')) returns contents of edit27 as a double % --- Executes during object creation, after setting all properties. function edit27_CreateFcn(hObject, eventdata, handles) % hObject    handle to edit27 (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 edit28_Callback(hObject, eventdata, handles) % hObject    handle to edit28 (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 edit28 as text %        str2double(get(hObject,'String')) returns contents of edit28 as a double % --- Executes during object creation, after setting all properties. function edit28_CreateFcn(hObject, eventdata, handles) % hObject    handle to edit28 (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 edit29_Callback(hObject, eventdata, handles) % hObject    handle to edit29 (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 edit29 as text %        str2double(get(hObject,'String')) returns contents of edit29 as a double % --- Executes during object creation, after setting all properties. function edit29_CreateFcn(hObject, eventdata, handles) % hObject    handle to edit29 (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 edit30_Callback(hObject, eventdata, handles) % hObject    handle to edit30 (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 edit30 as text %        str2double(get(hObject,'String')) returns contents of edit30 as a double % --- Executes during object creation, after setting all properties. function edit30_CreateFcn(hObject, eventdata, handles) % hObject    handle to edit30 (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 % --- Executes on button press in togglebutton3. function togglebutton3_Callback(hObject, eventdata, handles) % hObject    handle to togglebutton3 (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of togglebutton3 function Zo_Callback(hObject, eventdata, handles) % hObject    handle to Zo (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) Zo= str2double(get(hObject,'String')); % string属性是字符串,所以必须转换成数值 % 检验输入是否为空,是则将它置为0 if (isempty(Zo)) set(hObject,'String','0') end % 保存handles结构体,只要在handles结构体有改变时,才需要保存 guidata(hObject, handles); % Hints: get(hObject,'String') returns contents of Zo as text %        str2double(get(hObject,'String')) returns contents of Zo as a double % --- Executes during object creation, after setting all properties. function Zo_CreateFcn(hObject, eventdata, handles) % hObject    handle to Zo (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 % --- Executes on button press in pushbutton10. function pushbutton10_Callback(hObject, eventdata, handles) delete(findobj('color','k'));delete(findobj('color','b'));delete(findobj('color','r'));delete(findobj('color','m')); delete(findobj('color','c')); % hObject    handle to pushbutton10 (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) % --- Executes on button press in pushbutton11. function pushbutton11_Callback(hObject, eventdata, handles) % hObject    handle to pushbutton11 (see GCBO) for R=[0 0.2 0.5 1 2 ]; for X=[-4 -2 -1  -0.5 -0.3 0.3 0.5  1 2 4];%循环输入归一化阻抗 tr=2*pi*(0:0.005:1); rr=1/(1+R);cr=1-rr; plot(cr+rr*cos(tr),rr*sin(tr),'g');%画电阻圆 axis square; hold on; x=X; rx=1/x;cx=rx; tx=2*atan(x)*(0:0.01:1); if tx1) warndlg({'警告:您所取的点已超出圆图范围!','请重新取点!'},'警告'); else R=(1-U^2-V^2)/((1-U)^2+V^2);%阻抗 X=2*V/((1-U)^2+V^2); tr=2*pi*(0:0.00001:1); %z=U+V*j; cosA=U/sqrt(U^2+V^2); sinA=V/sqrt(U^2+V^2); r0=0:0.00001:1; g0=plot(r0*cosA,r0*sinA,'k','linewidth',1.5);%画相角线 axis square; hold on; rr=1/(1+R);cr=1-rr; g1=plot(cr+rr*cos(tr),rr*sin(tr),'r','linewidth',1.5);%画电阻圆 axis square; hold on; x=X; rx=1/x;cx=rx; tx=2*atan(x)*(0:0.0001:1); if tx=0    A=(180/pi)*A0; else A=(180/pi)*(A0+2*pi); end    if V>=0 L=(0.5/360)*(180-A); else L=0.75-(0.5/360)*A; end                                            %波长数 %显示各种参数值 G = num2str(G); % 转换为字符串 set(handles.G,'string',G); B = num2str(B); % 转换为字符串 set(handles.B,'string',B); zhu_bo_bi= num2str(zhu_bo_bi); % 转换为字符串 set(handles.zhu_bo_bi,'string',zhu_bo_bi); xing_bo_xi_shu = num2str(xing_bo_xi_shu); % 转换为字符串 set(handles.xing_bo_xi_shu,'string',xing_bo_xi_shu); U = num2str(U); % 转换为字符串 set(handles.U,'string',U); V = num2str(V); % 转换为字符串 set(handles.V,'string',V); xw = num2str(A); % 转换为字符串 set(handles.xw,'string',xw); bc= num2str(L); % 转换为字符串 set(handles.bc,'string',bc); guidata(hObject, handles); % 更新结构体 end % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) % --- Executes on button press in pushbutton12. function pushbutton12_Callback(hObject, eventdata, handles) % hObject    handle to pushbutton12 (see GCBO) %计算并联支节的位置和短路及开路支节的长度 Hdata=get(gcf,'userdata'); %计算并联支节的位置和短路及开路支节的长度 R0= get(handles.R ,'string');%提取电阻电抗值 X0 = get(handles.X ,'string'); Zo= get(handles.Zo ,'string'); R0=str2double(R0);%格式转换 转换为数值 X0=str2double(X0); Zo=str2double(Zo); r=R0/Zo; x=X0/Zo; if R0==Zo m=-x/2; B=(R0^2*m-(Zo-X0*m)*(Zo+X0*m))/(Zo*(R0^2+(Zo+X0*m)^2)); if m>=0 d1=atan(m)/(2*pi); if d1>=0.5 d1=d1-0.5; elseif d1<0 d1=d1+0.5; else d1=d1; end d2=atan(m)/(2*pi); if d2>=0.5 d2=d2-0.5; elseif d2<0 d2=d2+0.5; else d2=d2; end Lo1=(-atan(B*Zo))/(2*pi); if Lo1>=0 Lo1=Lo1; Lo2=Lo1; else Lo1=0.5+Lo1; Lo2=Lo1; end Ls1=(atan(1/(B*Zo)))/(2*pi); if Ls1>=0 Ls1=Ls1; Ls2=Ls1; else Ls1=0.5+Ls1; Ls2=Ls1; end else d1=(atan(m)+pi)/(2*pi); if d1>=0.5 d1=d1-0.5; elseif d1<0 d1=d1+0.5; else d1=d1; end d2=(atan(m)+pi)/(2*pi); if d2>=0.5 d2=d2-0.5; elseif d2<0 d2=d2+0.5; else d2=d2; end Lo1=(-atan(B*Zo))/(2*pi); if Lo1>=0 Lo1=Lo1; Lo2=Lo1; else Lo1=0.5+Lo1; Lo2=Lo1; end Ls1=(atan(1/(B*Zo)))/(2*pi); if Ls1>=0 Ls1=Ls1; Ls2=Ls1; else Ls1=0.5+Ls1; Ls2=Ls1; end  end else m1=(X0+sqrt(R0*((Zo-R0)^2+X0^2)/Zo))/(R0-Zo); m2=(X0-sqrt(R0*((Zo-R0)^2+X0^2)/Zo))/(R0-Zo); B1=(R0^2*m1-(Zo-X0*m1)*(X0+Zo*m1))/(Zo*(R0^2+(X0+Zo*m1)^2)); B2=(R0^2*m2-(Zo-X0*m2)*(X0+Zo*m2))/(Zo*(R0^2+(X0+Zo*m2)^2)); Lo1=(-atan(B1*Zo))/(2*pi); if Lo1>=0 Lo1=Lo1; else Lo1=0.5+Lo1; end Lo2=(-atan(B2*Zo))/(2*pi); if Lo2>=0 Lo2=Lo2; else Lo2=0.5+Lo2; end Ls1=(atan(1/(B1*Zo)))/(2*pi); if Ls1>=0 Ls1=Ls1; else Ls1=0.5+Ls1; end Ls2=(atan(1/(B2*Zo)))/(2*pi); if Ls2>=0 Ls2=Ls2; else Ls2=0.5+Ls2; end if m1>=0 d1=atan(m1)/(2*pi); if d1>=0.5 d1=d1-0.5; elseif d1<0 d1=d1+0.5; else d1=d1; end d2=(atan(m2)+pi)/(2*pi); if d2>=0.5 d2=d2-0.5; elseif d2<0 d2=d2+0.5; else d2=d2; end else d1=(atan(m1)+pi)/(2*pi); if d1>=0.5 d1=d1-0.5; elseif d1<0 d1=d1+0.5; else d1=d1; end d2=atan(m2)/(2*pi); if d2>=0.5 d2=d2-0.5; elseif d2<0 d2=d2+0.5; else d2=d2; end end end hold off; %归一化阻抗和确定传播状态 R0= get(handles.R ,'string');%提取电阻电抗值 X0 = get(handles.X ,'string'); Zo= get(handles.Zo ,'string'); R0=str2double(R0);%格式转换 转换为数值 X0=str2double(X0); Zo=str2double(Zo); r=R0/Zo; x=X0/Zo; z=r+i*x; y=1/z; g=real(y); b=imag(y); Gamma2=(z-1)/(z+1); Mod=abs(Gamma2); Phi=angle(Gamma2); Lambda=(pi-Phi)/(4*pi); Alpha=(y-1)/(y+1); plot(real(Alpha),imag(Alpha),'gp'); hold on; plot(real(Gamma2),imag(Gamma2),'gp'); hold on; aa=[real(Alpha),real(Gamma2)]; bb=[imag(Alpha),imag(Gamma2)]; polyfit(aa,bb,1); plot(aa,bb,'g'); hold on; if X0<0 if(Phi>=0) Lmin=Phi/(4*pi); Lmax=0.25+Lmin; else Lmin=(pi+Phi)/(4*pi); Lmax=0.25+Lmin; end else if(Phi>=0) Lmax=Phi/(4*pi); Lmin=0.25+Lmax; else Lmax=(pi+Phi)/(4*pi); Lmin=0.25+Lmax; end end %画出单位圆和标出电刻度 t=0:0.0001:2*pi; plot(cos(t),sin(t),'--g'); hold on; plot([-1,1],[0,0],'g'); hold on; plot([0,0],[-1,1],'g'); hold on; axis('equal',[-1,1,-1,1]); %画出等G圆 if g==inf plot(1,0,'rp'); axis('equal',[-1,1,-1,1]); else a=g/(1+g); g1=1/(1+g);  plot((g1*cos(t)+a),(g1*sin(t)),'r'); axis('equal',[-1,1,-1,1]); hold on; end; %画出等B圆 if b==inf plot(1,0,'rp'); axis('equal',[-1,1,-1,1]); elseif b==0 plot([-1,1],[0,0],'r'); axis('equal',[-1,1,-1,1]); else b1=1/b; r2=1/b;  plot((r2*cos(t)+1),(r2*sin(t)+b1),'m'); axis('equal',[-1,1,-1,1]); hold on; end; %画出等反射圆和匹配圆 y=g+j*b; gamma=(y-1)/(y+1); Mod=abs(gamma); Phi=angle(gamma); plot(Mod*cos(t),Mod*sin(t),'b'); hold on; axis('equal',[-1,1,-1,1]); plot(0.5*(cos(t)+1),(0.5*sin(t)),'c'); hold off; hold on; %归一化及计参数 R0= get(handles.R ,'string');%提取电阻电抗值 X0 = get(handles.X ,'string'); Zo= get(handles.Zo ,'string'); R0=str2double(R0);%格式转换 转换为数值 X0=str2double(X0); Zo=str2double(Zo); r=R0/Zo; x=X0/Zo; z=r+i*x; y=1/z; Alpha=atan2(imag(Gamma2),real(Gamma2)); alpha1=(y-1)/(y+1); %计算匹配点位置 if R0==Zo plot(real(Gamma2),imag(Gamma2),'rp'); plot(real(Gamma2),-imag(Gamma2),'rp'); m=[0,real(Gamma2)]; Re1=[0,cos(Alpha)]; Im1=[0,sin(Alpha)]; Im2=[0,-sin(Alpha)]; plot(Re1,Im1,'r'); plot(Re1,Im2,'r'); hold off; else angle1=abs(atan2(imag(Gamma2),real(Gamma2))); angle2=2*pi*(d1/0.5)-angle1; if X0>=0 if angle2<0 angle2=2*pi+angle2; plot(-abs(Gamma2)*cos(angle2),abs(Gamma2)*sin(angle2),'rp'); plot(-abs(Gamma2)*cos(angle2),-abs(Gamma2)*sin(angle2),'rp'); Re3=[0,cos(angle2)]; Re4=[0,cos(angle2)]; Im3=[0,sin(angle2)]; Im4=[0,-sin(angle2)]; plot(-Re3,Im3,'r'); plot(-Re4,Im4,'r'); hold off; else angle2=angle2; plot(-abs(Gamma2)*cos(angle2),abs(Gamma2)*sin(angle2),'rp'); plot(-abs(Gamma2)*cos(angle2),-abs(Gamma2)*sin(angle2),'rp'); Re3=[0,cos(angle2)]; Re4=[0,cos(angle2)]; Im3=[0,sin(angle2)]; Im4=[0,-sin(angle2)]; plot(-Re3,Im3,'r'); plot(-Re4,Im4,'r'); hold off; end else angle1=abs(atan2(imag(Gamma2),real(Gamma2))); angle2=2*pi*(d1/0.5)+angle1-2*pi; if angle2<0 angle2=2*pi+angle2; plot(-abs(Gamma2)*cos(angle2),abs(Gamma2)*sin(angle2),'rp'); plot(-abs(Gamma2)*cos(angle2),-abs(Gamma2)*sin(angle2),'rp'); Re3=[0,cos(angle2)]; Re4=[0,cos(angle2)]; Im3=[0,sin(angle2)]; Im4=[0,-sin(angle2)]; plot(-Re3,Im3,'r'); plot(-Re4,Im4,'r'); hold off; else angle2=angle2; plot(-abs(Gamma2)*cos(angle2),abs(Gamma2)*sin(angle2),'rp'); plot(-abs(Gamma2)*cos(angle2),-abs(Gamma2)*sin(angle2),'rp'); Re3=[0,cos(angle2)]; Re4=[0,cos(angle2)]; Im3=[0,sin(angle2)]; Im4=[0,-sin(angle2)]; plot(-Re3,Im3,'r'); plot(-Re4,Im4,'r'); hold off; end end end hold off; rho=(1+abs(Gamma2))/(1-abs(Gamma2)); if R0==Zo set(handles.Ht5,'string',strcat('在d1 = ',num2str(d1),'λ处并接入Lo = ',num2str(Lo1),'λ 的短路支节可实现匹配'),'fontname','宋体','fontsize',10); set(handles.Ht6,'string',strcat('或在d2 = ',num2str(d2),'λ处并接入Ls = ',num2str(Ls1),'λ 的开路支节实现匹配'),'fontname','宋体','fontsize',10); else set(handles.Ht5,'string',strcat('在d1 = ',num2str(d1),'λ处并接入长度为Ls = ',num2str(Ls1),'λ 的短路支节','或Lo = ',num2str(Lo1),'λ 的开路支节可实现匹配'),'fontname','宋体','fontsize',10); set(handles.Ht6,'string',strcat('或在d2 = ',num2str(d2),'λ处并接入长度为Ls = ',num2str(Ls2),'λ 的短路支节','或Lo = ',num2str(Lo2),'λ 的开路支节可实现匹配'),'fontname','宋体','fontsize',10); end % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) % --- Executes on button press in pushbutton13. function pushbutton13_Callback(hObject, eventdata, handles) % hObject    handle to pushbutton13 (see GCBO) % eventdata  reserved - to be defined in a future version of MATLAB % handles    structure with handles and user data (see GUIDATA) R0= get(handles.R ,'string');%提取电阻电抗值 X0 = get(handles.X ,'string'); Zo= get(handles.Zo ,'string'); R0=str2double(R0);%格式转换 转换为数值 X0=str2double(X0); Zo=str2double(Zo); Z=R0+i*X0; Y=1/Z; Yo=1/Zo; G=real(Y); B=imag(Y); m=1; %两支节相距λ/8 m1=(1+m^2)*G*Yo-G^2*m^2; m2=abs(1+m^2)*G*Yo-G^2*m^2; B11=-B+(Yo+sqrt(m1))/m; B21=(Yo*sqrt(m2)+G*Yo)/(G*m); B12=-B+(Yo-sqrt(m1))/m; B22=(-Yo*sqrt(m2)+G*Yo)/(G*m); Ls=-(atan(Yo/B11))/(2*pi); if Ls>=0 Ls11=Ls; else Ls11=0.5+Ls; end Ls=-(atan(Yo/B21))/(2*pi); if Ls>=0 Ls21=Ls; else Ls21=0.5+Ls; end Ls=-(atan(Yo/B12))/(2*pi); if Ls>=0 Ls12=Ls; else Ls12=0.5+Ls; end Ls=-(atan(Yo/B22))/(2*pi); if Ls>=0 Ls22=Ls; else Ls22=0.5+Ls; end hold off; r=R0/Zo; x=X0/Zo; z=r+i*x; y=1/z; g=real(y); b=imag(y); Gamma2=(z-1)/(z+1); Mod=abs(Gamma2); Phi=angle(Gamma2); Lambda=(pi-Phi)/(4*pi); Alpha=(y-1)/(y+1); plot(real(Alpha),imag(Alpha),'gp'); hold on; plot(real(Gamma2),imag(Gamma2),'gp'); hold on; aa=[real(Alpha),real(Gamma2)]; bb=[imag(Alpha),imag(Gamma2)]; polyfit(aa,bb,1); plot(aa,bb,'g'); hold on; if X0<0 if(Phi>=0) Lmin=Phi/(4*pi); Lmax=0.25+Lmin; else Lmin=(pi+Phi)/(4*pi); Lmax=0.25+Lmin; end else if(Phi>=0) Lmax=Phi/(4*pi); Lmin=0.25+Lmax; else Lmax=(pi+Phi)/(4*pi); Lmin=0.25+Lmax; end end %画出单位圆和标出电刻度 t=0:0.0001:2*pi; plot(cos(t),sin(t),'--g'); text (-1.2,0,'0', 'fontname', 'arial','color','b', 'fonta', 'italic');  text (-0.1,1.03,'0. 125', 'fontname', 'arial','color','b', 'fonta', 'italic');  text (1.03,0,'0.25', 'fontname', 'arial','color','b', 'fonta', 'italic'); text (-0.1, -1.18, '0.375', 'fontname', 'arial','color','b', 'fonta', 'italic'); hold on; plot([-1,1],[0,0],'g'); hold on; plot([0,0],[-1,1],'g'); hold on; axis('equal',[-1,1,-1,1]); %画出等G圆 if g==inf plot(1,0,'rp'); axis('equal',[-1,1,-1,1]); else a=g/(1+g); g1=1/(1+g);  plot((g1*cos(t)+a),(g1*sin(t)),'r'); axis('equal',[-1,1,-1,1]); hold on; end; %画出等B圆 if b==inf plot(1,0,'rp'); axis('equal',[-1,1,-1,1]); elseif b==0 plot([-1,1],[0,0],'r'); axis('equal',[-1,1,-1,1]); else b1=1/b; r2=1/b;  plot((r2*cos(t)+1),(r2*sin(t)+b1),'m'); axis('equal',[-1,1,-1,1]); hold on; end; %画出等反射圆和匹配圆 y=g+j*b; gamma=(y-1)/(y+1); Mod=abs(gamma); Phi=angle(gamma); plot(Mod*cos(t),Mod*sin(t),'b');
本文档为【微波实验报告 smith原图 matlab】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_842972
暂无简介~
格式:doc
大小:122KB
软件:Word
页数:65
分类:互联网
上传时间:2019-02-22
浏览量:21