Professional Documents
Culture Documents
*L=E
L=D*
beta=2*pi/
therefore
E(rad)=2*pi*D()
and
E(º)=D()/360
Comment:
On the right hand side, ADS optimiser apparently accepts variable var_name into the
optimiser by simply adding var_name {o}, but the optimiser doesn't start until
keying in 'var_name unit opt{a unit to b unit}' where b>a, having previously
changed Variable Eq entry mode to Name=Value.
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 1/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
E1=297.27º E2=260.86º
E1=117.29º E2=80.86º
Sol1=[297.27 260.86]
Sol2_rad=Sol1/180*pi
Sol2_rad/(2*pi) = 0.825750000000000 0.724611111111111
Sol2=[117.29 80.86]
Sol2_rad=Sol1/180*pi
Sol2_rad/(2*pi) = 0.325805555555556 0.224611111111111
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 2/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
pozar_05_exercise_05.m
reusing code from 5.3, the lines below replaced with just the line below.
The 4 lines on left hand side now in function Smith_plotZ
gamma_ZL_angle=angle(gamma_ZL);gamma_ZL_mod=abs(gamma_ZL)
if gamma_ZL_angle<0 gamma_ZL_angle=2*pi+gamma_ZL_angle; end [gamma_ZL_angle,gamma_ZL_mod]=Smith_plotZ(ax(1),ZL,Z0,[1 0 0],1)
if gamma_ZL_angle>(2*pi) gamma_ZL_angle=gamma_ZL_angle-2*pi; end
…
Smith_plotZ(ax(1),ZL,Z0,[1 0 0])
Calculating D1_TL
Z0=75; ZL=90+1j*60;
gamma_ZL=(ZL-Z0)/(ZL+Z0);
hf(1)=figure(1);sm(1)=smithchart;ax(1)=hf(1).CurrentAxes;hold(ax(1),'on')
Smith_plotZ(ax(1),ZL,Z0,[1 0 0],1)
Smith_plotRefLine2PhaseCircle(ax(1),ZL,Z0,[.6 1 .6])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(1),ZL,Z0,[1 .6 .6])
[xr1,yr1]=Smith_plotRcircle(ax(1),Z0,Z0,[0 0 1])
[xint,yint]=intersections(x_swr,y_swr,xr1,yr1,1);
plot(ax(1),xint,yint,'go')
refl_zx1=xint(1)+1j*yint(1);
refl_zx1_angle=angle(refl_zx1);refl_zx1_mod=abs(refl_zx1)
if refl_zx1_angle<0 refl_refl_zx1_angle=2*pi+refl_zx1_angle; end
if refl_zx1_angle>(2*pi) refl_zx1_angle=refl_zx1_angle-2*pi; end
% check
Z_1=Z0*(1+refl_zx1)/(1-refl_zx1)
real(Z_1)
Smith_plotRefLine2PhaseCircle(ax(1),Z_1,Z0,[.6 1 .6])
da=1/100;arc1=da
a0=gamma_ZL_angle;a1=refl_zx1_angle;gamma_mod=gamma_ZL_mod
a0*180/pi
a1*180/pi
% preventing while loop missing target because step not small enough
a0=da*floor(1/da*a0)
a1=da*floor(1/da*a1)
while da*floor(1/da*abs(a0-a1))>da
a0=a0-da;arc1=arc1+da; Z_1 =
if a0<0 a0=2*pi+a0; end % avoid negative angles 75.003511824677943
if a0>(2*pi) a0=a0-2*pi; end +56.434078007705629i
gamma=gamma_mod*(cos(a0)+1j*sin(a0));
plot(ax(1),real(gamma),imag(gamma),'ro','LineWidth',1.5); isequal(da*floor(1/da*real(Z_1)),… =
% drawnow da*floor(1/da*real(Z0))) logical
end 1
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 3/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
Calculating D2_TL
Smith_plotRefLine2PhaseCircle(ax(2),ZL,Z0,[.6 1 .6])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(2),ZL,Z0,[1 .6 .6])
[xr1,yr1]=Smith_plotRcircle(ax(2),Z0,Z0,[0 0 1])
plot(ax(2),xint,yint,'go')
refl_zx2=xint(2)+1j*yint(2); % 2nd intersection point
refl_zx2_angle=angle(refl_zx2);refl_zx2_mod=abs(refl_zx2)
if refl_zx2_angle<0 refl_refl_zx2_angle=2*pi+refl_zx2_angle; end
if refl_zx2_angle>(2*pi) refl_zx2_angle=refl_zx2_angle-2*pi; end
% check
Z_2=Z0*(1+refl_zx2)/(1-refl_zx2)
real(Z_2)
Smith_plotRefLine2PhaseCircle(ax(2),Z_2,Z0,[.6 1 .6])
da=1/100;arc2=da
a0=gamma_ZL_angle;a1=refl_zx2_angle;gamma_mod=gamma_ZL_mod
a0=da*floor(1/da*a0)
% this prevents while loop spinning endlessly if step not small enough
a1=da*floor(1/da*a1)
checking stub input impedance already on r=1
while da*floor(1/da*abs(a0-a1))>da
circle
a0=a0-da;arc2=arc2+da;
=
if a0<0 a0=2*pi+a0; end % avoid negative angles
Z_2 75.003511824677943
if a0>(2*pi) a0=a0-2*pi; end
+56.434078007705629i
gamma=gamma_mod*(cos(a0)+1j*sin(a0));
plot(ax(2),real(gamma),imag(gamma),'ro','LineWidth',1.5); isequal(da*floor(1/da*real(Z_2)),… =
da*floor(1/da*real(Z0))) logical
% drawnow
1
end
D2_TL_lambda=arc2/(4*pi) D2_TL_lambda =
plot(ax(2),xint,yint,'go')
0.480647928137517
D2_TL_angle_deg=D2_TL_lambda*180/.5 D2_TL_angle_deg =
1.730332541295062e+02
hf(3)=figure(3);sm(3)=smithchart; ax(3)=hf(3).CurrentAxes;
hold(ax(3),'on');
gamma_ZL=Smith_plotZ(ax(3),ZL,Z0,[1 0 0],0)
Smith_plotRefLine2PhaseCircle(ax(3),ZL,Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(3),ZL,Z0,[1 .6 .6])
[xr1,yr1]=Smith_plotRcircle(ax(3),Z0,Z0,[0 0 1])
plot(ax(3),xint,yint,'go')
% 1st intersection
refl_zb1=xint(1)+1j*yint(1);
refl_zb1_angle=angle(refl_zb1);refl_zb1_mod=abs(refl_zb1)
if refl_zb1_angle<0 refl_zb1_angle=2*pi+refl_zb1_angle; end
if refl_zb1_angle>(2*pi) refl_zb1_angle=refl_zb1_angle-2*pi; end
Zbs=Z0*((1+refl_zb1)/(1-refl_zb1))
refl_zstub=conj(refl_zb1) % where stub imag(Zin) has to be
plot(ax(3),real(refl_zstub),imag(refl_zstub),'bo')
Zbs2=Z0*(1+refl_zstub)/(1-refl_zstub)
Smith_plotBarc(ax(3),Zbs2,Z0,[1 0 1]) % reading sought stub reactance
Zbs3=1j*imag(Zbs2)
refl_Zstub=(Zbs3-Z0)/(Zbs3+Z0)
plot(ax(3),real(refl_Zstub),imag(refl_Zstub),'ro')
Smith_plotRefLine2PhaseCircle(ax(3),Zbs3,Z0,[.2 .2 .8])
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 4/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
hf(4)=figure(4);sm(4)=smithchart; ax(4)=hf(4).CurrentAxes;
hold(ax(4),'on');
gamma_ZL=Smith_plotZ(ax(4),ZL,Z0,[1 0 0],0)
Smith_plotRefLine2PhaseCircle(ax(4),ZL,Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(4),ZL,Z0,[1 .6 .6])
[xr1,yr1]=Smith_plotRcircle(ax(4),Z0,Z0,[0 0 1])
plot(ax(4),xint,yint,'go')
% 2nd intersection
refl_zb2=xint(2)+1j*yint(2);
refl_zb2_angle=angle(refl_zb2);refl_zb2_mod=abs(refl_zb2)
if refl_zb2_angle<0 refl_zb2_angle=2*pi+refl_zb2_angle; end
if refl_zb2_angle>(2*pi) refl_zb2_angle=refl_zb2_angle-2*pi; end
Zbs=Z0*((1+refl_zb2)/(1-refl_zb2))
refl_zstub=conj(refl_zb2) % where stub imag(Zin) has to be
plot(ax(4),real(refl_zstub),imag(refl_zstub),'bo')
Zbs2=Z0*(1+refl_zstub)/(1-refl_zstub)
Smith_plotBarc(ax(4),Zbs2,Z0,[1 0 1]) % reading sought stub reactance
Zbs3=1j*imag(Zbs2)
refl_Zstub=(Zbs3-Z0)/(Zbs3+Z0)
plot(ax(4),real(refl_Zstub),imag(refl_Zstub),'ro')
Smith_plotRefLine2PhaseCircle(ax(4),Zbs3,Z0,[.2 .2 .8])
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 5/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
Frequency sweep
D=[D1_TL_lambda D2_TL_lambda; D=
Dstub2_lambda Dstub1_lambda] 0.231397640694349 0.424104164889466
0.148014097075463 0.353323973664004
Let be the following f0 and band:
c0=2.998e8;
f0=2e9;
df=1e5;f1=1e9;f2=3e9;f=[f1:df:f2];
Then the physical lengths of all transmission lines and stubs are:
L=D*c0/f0 L=
0.034686506340083 0.063573214316931
0.022187313151612 0.052963263652234
s11=zeros(size(D,2),numel(f));
ZinTL=zeros(size(D,2),numel(f));
Zin_stb_oc=zeros(size(D,2),numel(f));
Zin=zeros(size(D,2),numel(f));
for k=1:1:size(L,2)
ZinTL(k,:)=Z0*(ZL+1j*Z0*tan(2*pi*f/c0*L(1,k)))./…
(Z0+1j*ZL*tan(2*pi*f/c0*L(1,k))); % series transmission line
end
Zin=ZinTL+Zin_stb_oc;
s11=(Zin-Z0)./(Zin+Z0);
s11_mod=abs(s11);
hf(10)=figure(10);
plot(f,s11_mod(1,:));plot(f,s11_mod(2,:));grid on
for k=1:1:size(s11_mod,1)
hf(10)=figure(10);plot(f,s11_mod(k,:));hold all;
end
grid on
title('TL + OC series stub |s11| - f sweep');xlabel('f[Hz]')
legend('arc1','arc2','eq1','eq2','Location','northwest')
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 6/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
There's also an alternative graph to find the required transmission line and stub lengths; |s11| surface.
Z1=Z0*(ZL+1j*Z0*tan(2*pi*D1))./(Z0+1j*ZL*tan(2*pi*D1));
Zin_stub=Z0./(1j*tan(2*pi*D2)); % series oc stub
Zin=Z1+Zin_stub;
s11=(Zin-Z0)./(Zin+Z0);
surf(abs(s11),'LineStyle','none')
ax=gca
xlabel('D1');ylabel('D2');
ax.XTickLabelMode='manual'; ax.YTickLabelMode='manual';
ax.XTickLabel=[0:0.1:1];ax.YTickLabel=[0:0.1:1];
ax.XTick=[0:100:1000];ax.YTick=[0:100:1000];
ax.PlotBoxAspectRatio=[1 1 1]
With Threshold=2 doesn't catch a single peak but Threshold=1 gets the
right amount of peaks.
To get zeros exact locations, it's useful to invert |s11| surface just plotted,
with the Laplacian of the surface, command del2
V=1e3*del2(abs(s11));
figure(2);ax=gca;surf(V,'Lines','none');
xlabel('D1');ylabel('D2');
ax.XTickLabelMode='manual';
ax.YTickLabelMode='manual';
ax.XTickLabel=[0:0.1:1];ax.YTickLabel=[0:0.1:1];
ax.XTick=[0:100:1000];ax.YTick=[0:100:1000];
[pks,locs]=findpeaks(V(:),'Threshold',1);
[nd1,nd2]=ind2sub(size(V),locs);
hold all;figure(2);plot3(nd2,nd1,V(nd2,nd1)+2,'ro'); % plot peaks
ax.PlotBoxAspectRatio=[1 1 1]
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 7/8
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 05 11/09/2018 01:14:02.
abs(s11(sub2ind(size(V),nd1,nd2))) = 0.001390798787950
0.001390798787950
0.002883920448033
0.002883920448033
0.001390798787950
0.001390798787950
0.002883920448033
0.002883920448033
numel(nd1) = 8
s11=zeros(1,numel(f));s11_mod=zeros(1,numel(f));
L1=D1*c0/f0
L2=D2*c0/f0
s11_mod=abs((Zin-Z0)./(Zin+Z0));
figure(2);plot(f,s11_mod);grid on
hold all
s11_mod=abs((Zin-Z0)./(Zin+Z0));
figure(2);plot(f,s11_mod);grid on
quick check how short circuit and open circuit stubs behave over frequency:
Zin_sc_stub=1j*Z0*tan(beta*L)
Zin_oc_stub=-1j*Z0*cot(beta*L)
da=pi/2000;a=[-2*pi:da:2*pi];
y_OC=-cot(a); y_SC=tan(a);
figure;plot(a,y_OC,a,y_SC);
grid on;axis([-2*pi 2*pi -10 10])
legend('SC','OC')
ylabel('Stub Z_i_n');xlabel('\betaL')
xticks([-2*pi -2*pi*3/4 -pi -pi/2 0 pi/2 pi 3*pi/2 2*pi])
xticklabels({'-2\pi','-3\pi/4','-\pi','-\pi/2','0','\pi/2','\pi','3\pi/2','2\pi'})
______________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- 8/8