Professional Documents
Culture Documents
5.10
pozar_05_exercise_10.m
Z0=50;ZL=Z0/(.4+1j*1.2);
D3=3/8;
Dstep=.0002;drange=[0:Dstep:.5];
D1=drange;D2=D1;
Zin4=zeros(numel(drange),numel(drange));
s11=zeros(numel(drange),numel(drange));
for k=1:1:numel(D1)
for s=1:1:numel(D2)
Zin_stub1=Z0*1j*tan(2*pi*D1(k));
Zin2=(Zin_stub1.^-1+ZL.^-1).^-1;
Zin3=Z0*(Zin2+1j*Z0*tan(2*pi*D3))./(Z0+1j*Zin2*tan(2*pi*D3));
Zin_stub2=Z0*1j*tan(2*pi*D2(s));
Zin4(k,s)=(Zin_stub2.^-1+Zin3.^-1).^-1;
s11(k,s)=(Zin4(k,s)-Z0)/(Zin4(k,s)+Z0);
end
end
hf1=figure(1);hs1=surf(D1,D2,abs(s11))
ax1=hf1.CurrentAxes;
hs1.LineStyle='none'
xlabel('D2');ylabel('D1')
campos(ax1,10*[0 0 100]);
camroll(ax1,-45)
ax1.PlotBoxAspectRatio=[1 1 1]
hold(ax1,'on')
n0=find(drange==.5) % plotting corner to box D1<.5 D2<.5
plot3(ax1,[drange(n0) drange(n0) 0],[0 drange(n0) drange(n0)],…
[5 5 5],'Color',[1 0 0],'LineWidth',3)
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 1/ 6
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 10 23/09/2018 15:17:27.
% V=1-(abs(s11));
V=10^3*del2(abs(s11));
hf2=figure(2);ax2=gca;surf(V,'Lines','none');xlabel('D1');ylabel('D2');
ax2.XTickLabelMode='manual';
ax2.YTickLabelMode='manual';
ax2.XTickLabel=[0:0.1:.5];ax2.YTickLabel=[0:0.1:.5];
[pks,locs]=findpeaks(V(:),'MinPeakHeight',.99,'MinPeakDistance',200);
[nd1,nd2]=ind2sub(size(V),locs);
hold all;plot3(nd2,nd1,V(nd2,nd1)+2,'ro'); % verifying peaks locations
Dstep=.0002;drange=[0:Dstep:.5];
D1=drange;D2=D1;
D1=unique(sort(D1(nd1))) D1 =
Columns 1 through 3
0.050600000000000 0.050800000000000 0.051000000000000
Columns 4 through 6
0.051200000000000 0.051400000000000 0.051600000000000
% same as Columns 7 through 9
D1=drange;D2=D1; 0.051800000000000 0.098600000000000 0.098800000000000
D1=D1(unique(sort(nd1)))
D1 =
Columns 1 through 3
0.050600000000000 0.050800000000000 0.051000000000000
Columns 4 through 6
0.051200000000000 0.051400000000000 0.051600000000000
Columns 7 through 9
0.051800000000000 0.098600000000000 0.098800000000000
D2=unique(sort(D2(nd2)))
D2 =
Columns 1 through 3
0.048600000000000 0.048800000000000 0.049000000000000
Columns 4 through 6
0.049200000000000 0.049400000000000 0.049600000000000
..
0.374400000000000 0.374600000000000 0.374800000000000
Columns 31 through 33
0.375000000000000 0.375200000000000 0.375400000000000
Columns 34 through 35
0.375600000000000 0.375800000000000
Now the quite different shape of the peaks returns a different amount of peak locations despite from both previous graphs one can tell that there are 2
clear |s11| nulls. Here is where function kmeans comes quite handy
On the right hand side, the closest that the above locs1 locs2 pks1 pks2
surface and chosen conditioning gets us to peaks = = = =
locations, so far. 608003 4679866 1.037676749975155 1.022294122904170
610504 4682367 1.127321441557838 1.288112420134564
613005 4684868 1.219759148078254 1.616498278070448
Since from |s11| it's highly likely that |s11| has 2 615506 4687369 1.307902495524382 1.813192017180561
nulls within [0 .5] x [0 .5] wavelength fraction D, L 618006 4689870 1.436938848741699 1.479922650697164
stub ength, L=D* , let's use kmeans with k=2. 620507 4692370 1.626818258880166 1.467160456281476
623008 4694871 1.828290158620465 1.526533687583176
625509 4697372 2.008170018700442 1.328279542622017
628009 4699873 2.327551443905220 1.096739121053541
630510 2.920029348588793
633011 3.609215877084772
635512 4.005216276204536
638012 4.917328558982023
640513 10.188490651197503
643014 5.714683330692673
645514 3.641781956334297
648015 3.487384399634491
650516 2.877672242184274
653017 2.296011113485124
655517 1.878303169964850
658018 1.711972650510920
660519 1.518129552003200
663020 1.332318001956141
665520 1.185153344920222
668021 1.096700695677261
670522 1.005028697436138
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 2/ 6
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 10 23/09/2018 15:17:27.
[n1_pk1,n2_pk1]=ind2sub(size(V),loc_peak1)
n1_pk1 =
640513 is pointer equivalent to [257 257] 257
n2_pk1 =
257
[n1_pk2,n2_pk2]=ind2sub(size(V),loc_peak2) n1_pk2 =
495
4687369 is pointer equivalent to [495 1875] n2_pk2 =
1875
check on V surface
hold all;plot3(n2_pk1,n1_pk1,V(n2_pk1,n1_pk1)+2,'go',...
'MarkerEdgeColor','g',…
'MarkerFaceColor','g',…
'MarkerSize',10)
hold all;plot3(n2_pk2,n1_pk2,V(n2_pk2,n1_pk2)+2,'ro',...
'MarkerEdgeColor','g',…
'MarkerFaceColor','g',…
'MarkerSize',10)
D1=drange;D2=D1;
D11=D1(n1_pk1) D11 = 0.051200000000000
D12=D1(n1_pk2) D12 = 0.098800000000000
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 3/ 6
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 10 23/09/2018 15:17:27.
c0=2.998e8;
L=D*c0/f0
L3=D3*c0/f0
f0=2e9;
df=1e6;
f1=1e9;f2=3e9; f=[f1:df:f2];
frel=linspace(f1/f0,f2/f0,numel(f));
connecting impedances
Zin_stub1=Z0*1j*tan(2*pi*frel*f0/c0*L(1,1))
Zin2=(Zin_stub1.^-1+ZL.^-1).^-1;
Zin3=Z0*(Zin2+1j*Z0*tan(2*pi*frel*f0/c0*L3))./…
(Z0+1j*Zin2.*tan(2*pi*frel*f0/c0*L3)) ;
Zin_stub2=Z0*1j*tan(2*pi*frel*f0/c0*L(2,1));
Zin4=(Zin_stub2.^-1+Zin3.^-1).^-1
s11_1=(Zin4-Z0)./(Zin4+Z0)
Zin_stub1=Z0*1j*tan(2*pi*frel*f0/c0*L(1,2))
Zin2=(Zin_stub1.^-1+ZL.^-1).^-1;
Zin3=Z0*(Zin2+1j*Z0*tan(2*pi*frel*f0/c0*L3))./…
(Z0+1j*Zin2.*tan(2*pi*frel*f0/c0*L3)) ;
Zin_stub2=Z0*1j*tan(2*pi*frel*f0/c0*L(2,2));
Zin4=(Zin_stub2.^-1+Zin3.^-1).^-1
s11_2=(Zin4-Z0)./(Zin4+Z0)
hf3=figure(3);%ax3=hf3.CurrentAxes
plot(frel,abs(s11_1),frel,abs(s11_2));grid on;
xlabel('f/f0')
title('|s11(f)|')
legend({'D(1,1) D(2,1)','D(1,2) D(2,2)'},…
'location','northeastoutside')
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 4/ 6
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 10 23/09/2018 15:17:27.
double-stub match. TL length between short circuit stubs 3/8. YL=Y0*(.4+1j*1.2) straight to Optimiser. D3=3*/8 requirement not observed.
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 5/ 6
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 10 23/09/2018 15:17:27.
_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 6/ 6