diff --git a/RTX class/sim_antpos.m b/RTX class/sim_antpos.m index 5ff10c4d1ae93db46d33fc2684f230080313dad5..18e0fb299b5b0ca1292b387e676927c5ff17f2a1 100644 --- a/RTX class/sim_antpos.m +++ b/RTX class/sim_antpos.m @@ -1,57 +1,3 @@ -clear -close all - -antPhi = 360/180*pi; -antPos = linspace(0.5, 1.5, 3); -planeRefSize = 2;%linspace(1.8, 2.2, 5); -parabSize = 4; -lambda = 0.3; -dirs = zeros(1,length(antPos)); -beamWidth = zeros(1,length(antPos)); -rtx = RTX.empty(); -%freq = []; -for k = 1:length(antPos) -% wavelength = 3e8/freq(k); - reflectors = [PlaneReflector([2 0], planeRefSize), ParabolaReflector([0 0], parabSize, 3)]; - %reflectors = [PlaneReflector([-1 1], 0)]; - aperture2 = SegmentedAperture([2.0001 0], 20); - antAngle = 90; - - 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 = 2000; - - rtx(k) = RTX(reflectors, aperture2, antenna, lambda, nRay2); - rtx(k).trace(); - figure(1); - subplot(2,1,1); - hold on; - subplot(2,1,2); - hold on; - rtx(k).plotApertureField(); - subplot(2,1,1); - hold off; - subplot(2,1,2); - hold off; - - figure(2); - hold on; - rtx(k).plotFarField(); - hold off; -% rtx2.calculateFarField(); - - dirs(k) = rtx(k).calcDirectivity(); - beamWidth(k) = rtx(k).farField.getBeamWidth(); -end - -figure(3); -subplot(2, 1, 1); -scatter(antPos, beamWidth, 'x'); -subplot(2, 1, 2); -scatter(antPos, dirs, 'x'); - - %% clear close all diff --git a/RTX class/sim_planesize.m b/RTX class/sim_planesize.m index 17e3416a0880ad19947e269cd0f03182af3c4fff..b4472b4cff2393c156112e245d182446e6077259 100644 --- a/RTX class/sim_planesize.m +++ b/RTX class/sim_planesize.m @@ -1,54 +1,104 @@ clear close all -antPhi = 360/180*pi; -antPos = 1;%linspace(0.5, 1.5, 5); -planeRefSize = linspace(2, 3.5, 5); -parabSize = 4; -lambda = 0.3; -dirs = zeros(1,length(planeRefSize)); -beamWidth = zeros(1,length(planeRefSize)); -rtx = RTX.empty(); -%freq = []; -for k = 1:length(planeRefSize) -% wavelength = 3e8/freq(k); - reflectors = [PlaneReflector([2 0], planeRefSize(k)), ParabolaReflector([0 0], parabSize, 3)]; - %reflectors = [PlaneReflector([-1 1], 0)]; - aperture2 = SegmentedAperture([2.0001 0], 20); - - antenna = Antenna(Vect(antPos,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000)); -% antenna = Antenna(Vect(antPos(k),0)); - %wavelength = 3e8/1e9; - nRay2 = 1000; - - rtx(k) = RTX(reflectors, aperture2, antenna, lambda, nRay2); - rtx(k).trace(); - figure(1); - subplot(2,1,1); - hold on; - subplot(2,1,2); - hold on; - rtx(k).plotApertureField(); - subplot(2,1,1); - hold off; - subplot(2,1,2); - hold off; - - figure(2); - hold on; - rtx(k).plotFarField(); - hold off; -% rtx2.calculateFarField(); - - dirs(k) = rtx(k).calcDirectivity(); - beamWidth(k) = rtx(k).farField.getBeamWidth(); +planeRefSize = linspace(2, 3, 3); + +reflectors1 = [PlaneReflector([2 0], planeRefSize(1)), ParabolaReflector([0 0], 4, 3)]; +reflectors2 = [PlaneReflector([2 0], planeRefSize(2)), ParabolaReflector([0 0], 4, 3)]; +reflectors3 = [PlaneReflector([2 0], planeRefSize(3)), 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; +antenna = Antenna(Vect(1,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000)); +rtx1 = RTX(reflectors1, aperture1, antenna, wavelength, nRay); +rtx1.trace(); +rtx1.calculateFarField(); +rtx2 = RTX(reflectors2, aperture2, antenna, wavelength, nRay); +rtx2.trace(); +rtx2.calculateFarField(); +rtx3 = RTX(reflectors3, aperture3, antenna, 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, segédreflektor méretének hatása"); +legend(['d=' num2str(planeRefSize(1))], ['d=' num2str(planeRefSize(2))], ['d=' num2str(planeRefSize(3))], '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_planesize_aperture_field',file_format); end -figure(3); -subplot(2, 1, 1); -scatter(planeRefSize, beamWidth, 'x'); -subplot(2, 1, 2); -scatter(planeRefSize, dirs, 'x'); +%% 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, segédreflektor méretének hatása"); +legend(['d=' num2str(planeRefSize(1))], ['d=' num2str(planeRefSize(2))], ['d=' num2str(planeRefSize(3))], '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_planesize_far_field',file_format); +end