基于Matlab绘制偶极子和矩形孔径天线方向图

简介: 基于Matlab绘制偶极子和矩形孔径天线方向图

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

研究了直线天线的两种简单分析模型:无穷小偶极子和有限长偶极子.建立了偶极子辐射强度和方向性系数数学模型.应用MATLAB对其性能进行了仿真分析.通过仿真分析比较,得出了和实际结果相符的结论,从而为天线的研究提供了有价值的基础理论.

⛄ 部分代码

function varargout = Dipole_Aperture_Aid(varargin)

% DIPOLE_APERTURE_AID M-file for Dipole_Aperture_Aid.fig

%      DIPOLE_APERTURE_AID, by itself, creates a new DIPOLE_APERTURE_AID or raises the existing

%      singleton*.

%

%      H = DIPOLE_APERTURE_AID returns the handle to a new DIPOLE_APERTURE_AID or the handle to

%      the existing singleton*.

%

%      DIPOLE_APERTURE_AID('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in DIPOLE_APERTURE_AID.M with the given input arguments.

%

%      DIPOLE_APERTURE_AID('Property','Value',...) creates a new DIPOLE_APERTURE_AID or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before Dipole_Aperture_Aid_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to Dipole_Aperture_Aid_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 Dipole_Aperture_Aid


% Last Modified by GUIDE v2.5 30-Dec-2010 21:53:47


% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

                  'gui_Singleton',  gui_Singleton, ...

                  'gui_OpeningFcn', @Dipole_Aperture_Aid_OpeningFcn, ...

                  'gui_OutputFcn',  @Dipole_Aperture_Aid_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 Dipole_Aperture_Aid is made visible.

function Dipole_Aperture_Aid_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 Dipole_Aperture_Aid (see VARARGIN)


%%__________________________________________________________________

%%____________________Start of the Program__________________________

%%__________________________________________________________________


%Variable Definition Specially Global and Preset ones

% Some values have default values so that it could be sketch by a single

% click

global PhiMax;

PhiMax = 2*pi;      % set default Phi


global ThetaMax;

ThetaMax = pi;      % set default Theta


global dimension;

dimension = 50;      %set default dimension


global Length

Length=1;            % set default Length

% Choose default command line output for Dipole_Aperture_Aid

handles.output = hObject;


% Update handles structure

guidata(hObject, handles);


% UIWAIT makes Dipole_Aperture_Aid wait for user response (see UIRESUME)

% uiwait(handles.figure1);



% --- Outputs from this function are returned to the command line.

function varargout = Dipole_Aperture_Aid_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 selection change in popupmenu1.

function popupmenu1_Callback(hObject, eventdata, handles)

% hObject    handle to popupmenu1 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)


% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from popupmenu1

%%____________________ Gather user information for Phi range

global PhiMax

content = get(hObject,'Value');

switch content

   case 1

     PhiMax=2*pi;

      PhiMax

     

   case 2

      PhiMax=1.5*pi;

       PhiMax


   case 3  

       PhiMax=pi;

       PhiMax

   

   case 4

       PhiMax=.5*pi;

       PhiMax

       

   otherwise

       disp('input wrong'); %% Otherwise condition will never happend

end



% --- Executes during object creation, after setting all properties.

function popupmenu1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to popupmenu1 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called


% Hint: popupmenu 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 selection change in popupmenu2.

function popupmenu2_Callback(hObject, eventdata, handles)

% hObject    handle to popupmenu2 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)


% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from popupmenu2

%%____________ Gather user information for Theta ____________________

global ThetaMax

content = get(hObject,'Value'); % returned value is Theta angle , stored in content

switch content

   case 1

       ThetaMax=pi;

       ThetaMax

   case 2

       ThetaMax=.75*pi;

       ThetaMax

   case 3

       ThetaMax=.5*pi;

       ThetaMax

   otherwise

       disp('Non Above , actually this condition will never ever happen')

end



% --- Executes during object creation, after setting all properties.

function popupmenu2_CreateFcn(hObject, eventdata, handles)

% hObject    handle to popupmenu2 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called


% Hint: popupmenu 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 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 (see GUIDATA)


% Hints: get(hObject,'String') returns contents of edit1 as text

%        str2double(get(hObject,'String')) returns contents of edit1 as a double

%%____________ Returns the dimension of phi & theta matrix assigned by user

global dimension

dimension=str2double(get(hObject,'String'));

dimension=floor(dimension);    % as floats arent accepted dimension floored for example


%if dimension ( announced as Quality ) = 112.5 it's gonna turn into 112



zlabel('Axis Z');

title(['L =  ',num2str(Length),'Lambda'])


% --- Executes on button press in pushbutton3.

function pushbutton3_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton3 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

%%__________________ Sketch using Plot3 ___________________________

global phi

global theta

global Length

global R

global x

global y

global z

[THETA,PHI]=meshgrid(theta,phi);

R=abs((cos(Length.*pi.*cos(THETA))- cos(Length.*pi))./(sin(THETA)));

x=R.*sin(THETA).*cos(PHI);

y=R.*sin(THETA).*sin(PHI);

z=R.*cos(THETA);

%figure

plot3(x,y,z);

%clear all

set(gca,'PlotBoxAspectRatio',[1,1,1])

axis equal;

xlabel('Axis X');

ylabel('Axis Y');

zlabel('Axis Z');

title(['L =  ',num2str(Length),'Lambda'])


% --- Executes on button press in pushbutton4.

function pushbutton4_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton4 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

%______________________ Sketch Using Surf_________________________

global phi

global theta

global Length

global R

global x

global y

global z

[THETA,PHI]=meshgrid(theta,phi);

R=abs((cos(Length.*pi.*cos(THETA))- cos(Length.*pi))./(sin(THETA)));

x=R.*sin(THETA).*cos(PHI);

y=R.*sin(THETA).*sin(PHI);

z=R.*cos(THETA);

%Length

%figure

surf(x,y,z);

%clear all

set(gca,'PlotBoxAspectRatio',[1,1,1])

axis equal;

xlabel ('Axis X');

ylabel ('Axis Y');

zlabel ('Axis Z');

title(['L =  ',num2str(Length),'Lambda'])

% --- Executes on button press in pushbutton5.

function pushbutton5_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton5 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

%________________Sketch 2Dimension E Plane Using Polar____________________

global phi

global theta

global Length

global r


r=abs((cos(Length.*pi.*cos(phi))- cos(Length.*pi))./(sin(phi)));

%figure

polar(phi,r);

axis equal

title(['L =  ',num2str(Length),'Lambda'])

%clear all




function edit3_Callback(hObject, eventdata, handles)

% hObject    handle to edit3 (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 edit3 as text

global ap_a;

ap_a = str2double(get(hObject,'String')); % returns contents of edit3 as a double



% --- Executes during object creation, after setting all properties.

function edit3_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 COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'),...

       get(0,'defaultUicontrolBackgroundColor'))

   set(hObject,'BackgroundColor','white');

end




function edit6_Callback(hObject, eventdata, handles)

% hObject    handle to edit6 (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 edit6 as text

global ap_b;

ap_b = str2double(get(hObject,'String'));% returns contents of edit6 as a double



% --- Executes during object creation, after setting all properties.

function edit6_CreateFcn(hObject, eventdata, handles)

% hObject    handle to edit6 (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 pushbutton6.

function pushbutton6_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton6 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

% ploting aperture antenna 3D

global ap_a;

global ap_b;

global phi;

global theta;

[Phi,Theta]=meshgrid(phi,theta);

% ap_a & ap_b are dimensions of the notch

% U = sin(theta).cos(phi)   v = sin(theta).sin(phi) for 3D plot

U = sin(Theta).*cos(Phi);

V = sin(Theta).*sin(Phi);

B=2*pi;

% u & v both in lowercase for 2D plot

u = sin(theta).*cos(0);

v = sin(theta).*sin(0);

% rho is 2D polar pattern

rho = abs (sinc(B*ap_a/2.*u).*sinc(B*ap_b/2.*v));

% E for 3D pattern

E = abs( sinc(B*ap_a/2.*U).*sinc(B*ap_b/2.*V));

x = E.*cos(Phi).*sin(Theta);

y = E.*sin(Phi).*sin(Theta);

z = E.*cos(Theta);

% polar plot

plot(rho.*sin(phi),rho.*cos(phi));

set(gca,'PlotBoxAspectRatio',[1,3,1])

xlabel('Axis X');

ylabel('Axis Y');

title(['Rectangular Aperture Antenna Cross Section for '...

   ,num2str(ap_a),',',num2str(ap_b),' Lambda'])


figure('Name','3D Aperture Plot');

mesh(x,y,z)

set(gca,'PlotBoxAspectRatio',[.5,.5,2])

xlabel('Axis X');

ylabel('Axis Y');

zlabel('Axis Z');

title(['Rectangular Aperture Antenna '...

   ,num2str(ap_a),',',num2str(ap_b),'Lambda'])


⛄ 运行结果

⛄ 参考文献

[1]张清泉, 吉安平, 行小帅,等. 基于MATLAB的偶极子辐射性能仿真分析[J]. 仪器仪表与分析监测, 2011(3):3.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
7月前
|
编解码
MATLAB | 科研绘图第十一期动态趋势图
MATLAB | 科研绘图第十一期动态趋势图
74 0
|
5月前
|
算法 数据可视化 图形学
网络通信系统的voronoi图显示与能耗分析matlab仿真
在MATLAB2022a中,该程序模拟了两层基站网络,使用泊松分布随机生成Macro和Micro基站,并构建Voronoi图。它计算每个用户的信号强度,选择最强连接,并分析SINR和数据速率。程序还涉及能耗计算,包括传输、接收、处理和空闲能耗的分析。Voronoi图帮助可视化网络连接和优化能源效率。
|
7月前
|
数据安全/隐私保护
matlab批量计算地震加速度反应谱、速度谱、位移谱,伪速度谱、伪加速度谱;反应谱对比图
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
|
7月前
|
算法 计算机视觉
基于表面法线法的二维人脸图构建三维人脸模型matlab仿真
该内容概述了一个使用MATLAB2022a的二维人脸图像三维重建算法。首先,通过人脸检测和对齐,然后运用深度信息估计技术(如Shape from Shading)获取表面法线。接着,结合预训练的三维人脸模型库和二维关键点,通过迭代优化和全局优化构建三维模型。核心程序涉及图像处理、光源方向转换、反射率和表面法线计算,最终重构高度图并显示结果。该方法依赖多视角图像,单幅图像重建可能存在挑战。
|
7月前
|
Shell
MATLAB 求解特征方程的根轨迹图稳定性分析
MATLAB 求解特征方程的根轨迹图稳定性分析
|
7月前
matlab脉冲响应图的时域特征
matlab脉冲响应图的时域特征
|
7月前
|
编解码
MATLAB | 科研绘图第十期四象限的正弦图
MATLAB | 科研绘图第十期四象限的正弦图
78 0
|
4月前
|
安全
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
本文介绍了2023年高教社杯数学建模竞赛D题的圈养湖羊空间利用率问题,包括问题分析、数学模型建立和MATLAB代码实现,旨在优化养殖场的生产计划和空间利用效率。
236 6
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
|
4月前
|
存储 算法 搜索推荐
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
本文提供了2022年华为杯数学建模竞赛B题的详细方案和MATLAB代码实现,包括方形件组批优化问题和排样优化问题,以及相关数学模型的建立和求解方法。
143 3
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
|
4月前
|
数据采集 存储 移动开发
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码
本文介绍了2023年五一杯数学建模竞赛B题的解题方法,详细阐述了如何通过数学建模和MATLAB编程来分析快递需求、预测运输数量、优化运输成本,并估计固定和非固定需求,提供了完整的建模方案和代码实现。
111 0
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码

热门文章

最新文章