Skip to content
Snippets Groups Projects
Commit ff80392b authored by ftomi's avatar ftomi
Browse files

more sims

parent 5975696e
Branches
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ classdef SegmentedAperture < Aperture
function [x, y] = plotApertureField(obj)
[histogram,x1, x2] = obj.getCollisionHistogram();
x1 = [-obj.size/2, x1, x1(end)];
x1 = [-obj.size/2, x1, x2(end)];
x2 = [x1(2), x2, obj.size/2];
histogram = [0 histogram 0];
x = [x1; x2];
......
......@@ -3,22 +3,22 @@ close all
reflectors = [PlaneReflector([2 0], 2), ParabolaReflector([0 0], 4, 3)];
%reflectors = [PlaneReflector([-1 1], 0)];
aperture = BalazsAperture([2.0001 0], 20, 1000);
aperture1 = BalazsAperture([2.0001 0], 20, 1000);
aperture2 = SegmentedAperture([2.0001 0], 20);
antenna = Antenna(Vect(1,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
%antenna = Antenna(Vect(1,0), ones(1,10000), zeros(1,10000));
wavelength = 3e8/1e9;
nRay = 10000;
lambda = 3e8/1e9;
nRay1 = 10000;
nRay2 = 2000;
rtx = RTX(reflectors, aperture, antenna, wavelength, nRay);
rtx.trace();
figure; rtx.plotApertureField();
figure; rtx.plotFarField();
rtx2 = RTX(reflectors, aperture2, antenna, wavelength, nRay2);
rtx1 = RTX(reflectors, aperture1, antenna, lambda, nRay1);
rtx1.trace();
rtx1.calculateFarField();
rtx2 = RTX(reflectors, aperture2, antenna, lambda, nRay2);
rtx2.trace();
figure; rtx2.plotApertureField();
figure; rtx2.plotFarField();
rtx2.calculateFarField();
dir = rtx.calcDirectivity();
......@@ -2,7 +2,7 @@ clear
close all
antPhi = 360/180*pi;
antPos = linspace(0.5, 1.5, 5);
antPos = linspace(0.5, 1.5, 3);
planeRefSize = 2;%linspace(1.8, 2.2, 5);
parabSize = 4;
lambda = 0.3;
......@@ -20,7 +20,7 @@ for k = 1:length(antPos)
antenna = Antenna(Vect(antPos(k),0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
% antenna = Antenna(Vect(antPos(k),0));
%wavelength = 3e8/1e9;
nRay2 = 1000;
nRay2 = 2000;
rtx(k) = RTX(reflectors, aperture2, antenna, lambda, nRay2);
rtx(k).trace();
......@@ -52,4 +52,108 @@ subplot(2, 1, 2);
scatter(antPos, dirs, 'x');
%%
clear
close all
antPos = linspace(0.5, 1.5, 3);
reflectors = [PlaneReflector([2 0], 2), ParabolaReflector([0 0], 4, 3)];
%reflectors = [PlaneReflector([-1 1], 0)];
%antenna = Antenna(Vect(1,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
aperture1 = SegmentedAperture([2.0001 0], 20);
aperture2 = SegmentedAperture([2.0001 0], 20);
aperture3 = SegmentedAperture([2.0001 0], 20);
% antenna = Antenna(Vect(1,0), ones(1,10000), zeros(1,10000));
wavelength = 3e8/1e9;
nRay = 2000;
antenna1 = Antenna(Vect(antPos(1),0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
antenna2 = Antenna(Vect(antPos(2),0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
antenna3 = Antenna(Vect(antPos(3),0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
rtx1 = RTX(reflectors, aperture1, antenna1, wavelength, nRay);
rtx1.trace();
rtx1.calculateFarField();
rtx2 = RTX(reflectors, aperture2, antenna2, wavelength, nRay);
rtx2.trace();
rtx2.calculateFarField();
rtx3 = RTX(reflectors, aperture3, antenna3, wavelength, nRay);
rtx3.trace();
rtx3.calculateFarField();
% for k = 1:length(antPos)
% antenna = Antenna(Vect(antPos(k),0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
% rtx(k) = RTX(reflectors, aperture, antenna, wavelength, nRay);
% rtx(k).trace();
% rtx(k).calculateFarField();
% end
%% Plot settings
plot_width = 1200;
h_width = plot_width * 0.55;
height = 400;
file_format = 'png';
save_plot = 1;
%% Sim_characteristics_aperture_field
[x1, y1] = rtx1.plotApertureField();
[x2, y2] = rtx2.plotApertureField();
[x3, y3] = rtx3.plotApertureField();
close all;
figure(1)
subplot(2,1,1);
hold on;
plot(x1, abs(y1), 'LineWidth', 1);
plot(x2, abs(y2), 'LineWidth', 1);
plot(x3, abs(y3), 'LineWidth', 1);
hold off
grid on;
xlabel("r'");
ylabel("|E(r')| [V/m]");
xlim([-5, 5]);
title("Cassegrain antenna megvilágítási függvénye, ideális primer sugárzó pozícióhibáinak vizsgálata");
legend('Távol', 'Fókuszban', 'Közel', 'Location', 'northeast', 'Orientation', 'vertical');
subplot(2,1,2);
hold on;
plot(x1, angle(y1), 'LineWidth', 1);
plot(x2, angle(y2), 'LineWidth', 1);
plot(x3, angle(y3), 'LineWidth', 1);
hold off
grid on;
xlabel("r'");
ylabel("argE(r') [rad]");
xlim([-5, 5]);
ylim([-pi, pi]);
yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]);
yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',...
'0', '', '^{1}/_{2}\pi', '', '\pi'});
legend('Távol', 'Fókuszban', 'Közel', 'Location', 'northeast', 'Orientation', 'vertical');
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_andpos_aperture_field',file_format);
end
%% Sim_characteristics_far_field
[x1, y1] = rtx1.plotFarField();
[x2, y2] = rtx2.plotFarField();
[x3, y3] = rtx3.plotFarField();
close all;
plot(x1, y1, x2, y2, x3, y3, 'LineWidth', 1.5);
grid on;
title("Cassegrain antenna távoltere, ideális primer sugárzó pozícióhibáinak vizsgálata");
legend('Távol', 'Fókuszban', 'Közel', 'Location', 'northeast', 'Orientation', 'vertical');
xlabel("\Theta [°]");
ylabel("S_{rel} [dB]");
ylim([-60 1]);
xlim([-15 15]);
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_andpos_far_field',file_format);
end
......@@ -42,7 +42,7 @@ grid on;
xlabel("r'");
ylabel("|E(r')| [V/m]");
xlim([-5, 5]);
title("Cassegrain antenna megvilágítási függvénye");
title("Cassegrain antenna megvilágítási függvénye, izotróp primer sugárzó");
legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 'vertical');
subplot(2,1,2);
......@@ -62,7 +62,7 @@ legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 've
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_diff_aperture_field',file_format);
saveas(gcf,'Sim_diff_iso_aperture_field',file_format);
end
%% Sim_characteristics_far_field
......@@ -74,7 +74,7 @@ close all;
plot(x1, y1, 'b',...
x2, y2, 'r', 'LineWidth', 1.5);
grid on;
title("Cassegrain antenna távoltere");
title("Cassegrain antenna távoltere, izotróp primer sugárzó");
legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 'vertical');
xlabel("\Theta [°]");
ylabel("S_{rel} [dB]");
......@@ -83,7 +83,7 @@ xlim([-15 15]);
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_diff_far_field',file_format);
saveas(gcf,'Sim_diff_iso_far_field',file_format);
end
clear
close all
reflectors = [PlaneReflector([2 0], 2), ParabolaReflector([0 0], 4, 3)];
%reflectors = [PlaneReflector([-1 1], 0)];
aperture1 = BalazsAperture([2.0001 0], 20, 1000);
aperture2 = SegmentedAperture([2.0001 0], 20);
antenna = Antenna(Vect(1,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000));
%antenna = Antenna(Vect(1,0), ones(1,10000), zeros(1,10000));
wavelength = 3e8/1e9;
nRay = 10000;
nRay2 = 2000;
rtx1 = RTX(reflectors, aperture1, antenna, wavelength, nRay);
rtx1.trace();
rtx1.calculateFarField();
rtx2 = RTX(reflectors, aperture2, antenna, wavelength, nRay2);
rtx2.trace();
rtx2.calculateFarField();
%% Plot settings
plot_width = 1200;
h_width = plot_width * 0.55;
height = 400;
file_format = 'png';
save_plot = 1;
%% Sim_characteristics_aperture_field
[x1, y1] = rtx1.plotApertureField();
[x2, y2] = rtx2.plotApertureField();
close all;
figure(1)
subplot(2,1,1);
hold on;
plot(x1, abs(y1), 'b', 'LineWidth', 1);
plot(x2, abs(y2), 'r', 'LineWidth', 1);
hold off
grid on;
xlabel("r'");
ylabel("|E(r')| [V/m]");
xlim([-5, 5]);
title("Cassegrain antenna megvilágítási függvénye, ideális primer sugárzó");
legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 'vertical');
subplot(2,1,2);
hold on;
plot(x1, angle(y1), 'b', 'LineWidth', 1);
plot(x2, angle(y2), 'r', 'LineWidth', 1);
hold off
grid on;
xlabel("r'");
ylabel("argE(r') [rad]");
xlim([-5, 5]);
ylim([-pi, pi]);
yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]);
yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',...
'0', '', '^{1}/_{2}\pi', '', '\pi'});
legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 'vertical');
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_diff_ideal_aperture_field',file_format);
end
%% Sim_characteristics_far_field
[x1, y1] = rtx1.plotFarField();
[x2, y2] = rtx2.plotFarField();
close all;
plot(x1, y1, 'b',...
x2, y2, 'r', 'LineWidth', 1.5);
grid on;
title("Cassegrain antenna távoltere, ideális primer sugárzó");
legend('1. módszer', '2. módszer', 'Location', 'northeast', 'Orientation', 'vertical');
xlabel("\Theta [°]");
ylabel("S_{rel} [dB]");
ylim([-60 1]);
xlim([-15 15]);
set(gcf, 'position', [0 0 h_width height]);
if save_plot
saveas(gcf,'Sim_diff_ideal_far_field',file_format);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment