Vous êtes sur la page 1sur 10

MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

5.3

single shunt open circuit stub with transmission line, both stub and
transmission line with Z0=75, to match ZL=100+1j*80.

matching shunt-stubs requires calculating 2 TL lengths, that expressed


in multiples of wavelength: beta*L=2*pi/lambda*lambda*D=2*pi*D
D is wavelength multiple, or the phase, halved angle measured on
Smith chart.

1.- the length of the TL where the shunt is placed: D_TL


2.- the length of the parallel shunt stub itself: D_oc_stub

There are 2 solutions, towards generator, CW, along SWR circle, until

real(Zin)==Z0

pozar_05_exercise_03.m

Z0=75; ZL=100+1j*80;
gamma_ZL=(ZL-Z0)/(ZL+Z0);

hf(1)=figure(1);sm(1)=smithchart; ax(1)=hf(1).CurrentAxes;
hold(ax(1),'on')
plot(ax(1),real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0]) % ZL

YL=1/ZL
gamma_YL=-gamma_ZL
gamma_YL_angle=angle(gamma_YL);gamma_YL_mod=abs(gamma_YL)
if gamma_YL_angle<0 gamma_YL_angle=2*pi+gamma_YL_angle; end
if gamma_YL_angle>(2*pi) gamma_YL_angle=gamma_YL_angle-2*pi;
end
Smith_plotY(ax(1),YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax(1),YL,1/Z0,[.6 1 .6])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(1),ZL,Z0,[1 .6 .6])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[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')

gb1=xint(1)+1j*yint(1);

gb1_angle=angle(gb1);gb1_mod=abs(gb1)
if gb1_angle<0 gb1_angle=2*pi+gb1_angle; end
if gb1_angle>(2*pi) gb1_angle=gb1_angle-2*pi; end
checking stub already on r=1 circle
Yb_1=(1/Z0*(1-gb1)/(1+gb1)) %^-1
1/Yb_1 % check real(Z) spot on r=1 circle 1/Yb_1 = 75.009858443284173 -
72.565629355776338i
Smith_plotRefLine2PhaseCircle(ax(1),1/Yb_1,Z0,[.6 1 .6])

% on Smith chart
isequal(Yb_1,gamma2z(-gb1,1/Z0)) =
logical
da=1/1000;arc1=da
1
a0=gamma_YL_angle;a1=gb1_angle;gamma_mod=gamma_YL_mod
D1_TL_lambda=arc1/(4*pi) D1_TL_lambda =
while abs(a0-a1)>da
0.405924682355882
a0=a0-da;arc1=arc1+da;
if a0<0 a0=2*pi+a0; end % avoid negative angle
D1_TL_angle_deg=D1_TL_lambda*180/.5 D1_TL_angle_deg =
if a0>(2*pi) a0=a0-2*pi; end
1.461328856481175e+02
gamma=gamma_mod*(cos(a0)+1j*sin(a0));
plot(ax(1),real(gamma),imag(gamma),'ro','LineWidth',1.5);
% drawnow
end
plot(ax(1),xint,yint,'go')

% checking stub input impedance already on r=1 circle


1/Yb_1
isequal(Yb_1,gamma2z(-gb1,1/Z0)) % same, -gb1 to bring gamma Y2Z

D1_TL_lambda=arc1/(4*pi)
D1_TL_angle_deg=D1_TL_lambda*180/.5
% lambda/2 is 180º electric length that is 360º on Smith Chart

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 1 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

The following are all 3 equivalent:

electric length in fractions of wavelength electric length in degree arc angle on Smith Chart

/2 180º 360º

hf(2)=figure(2);sm(2)=smithchart; ax(2)=hf(2).CurrentAxes;
hold(ax(2),'on')
plot(ax(2),real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0]) % ZL

gamma_YL_angle=angle(gamma_YL);gamma_YL_mod=abs(gamma_YL)
if gamma_YL_angle<0 gamma_YL_angle=2*pi+gamma_YL_angle; end
if gamma_YL_angle>(2*pi) gamma_YL_angle=gamma_YL_angle-2*pi;
end
Smith_plotY(ax(2),YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax(2),YL,1/Z0,[.2 .8 .2])

[x_swr,y_swr]=Smith_plotGammaCircle(ax(2),ZL,Z0,[.8 .2 .2])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[xr1,yr1]=Smith_plotRcircle(ax(2),Z0,Z0,[0 0 1])

[xint,yint]=intersections(x_swr,y_swr,xr1,yr1,1);
plot(ax(2),xint,yint,'go')

gb2=xint(2)+1j*yint(2);
gb2_angle=angle(gb2);gb2_mod=abs(gb2)
if gb2_angle<0 gb2_angle=2*pi+gb2_angle; end 1/Yb_2 1/Yb_2 =
if gb2_angle>(2*pi) gb2_angle=gb2_angle-2*pi; end 75.009858443284173
+72.565629355776380i
Yb_2=(1/Z0*(1-gb2)/(1+gb2)) %^-1 isequal(Yb_2,gamma2z(-gb2,1/Z0)) = 1
1/Yb_2 % check real(Z) spot on r=1 circle
D2_TL_lambda=arc2/(4*pi) D2_TL_lambda =
Smith_plotRefLine2PhaseCircle(ax(2),1/Yb_2,Z0,[.2 .8 .2]) D2_TL_angle_rad=arc2/2 0.228387343336868
D2_TL_angle_deg=arc2*90/pi D2_TL_angle_rad =
da=1/1000;arc2=da 1.434999999999
a0=gamma_YL_angle;a1=gb2_angle;gamma_mod=gamma_YL_mod D2_TL_angle_deg =
while abs(a0-a1)>da 82.219443601272644
a0=a0-da;arc2=arc2+da;
if a0<0 a0=2*pi+a0; end % avoid negative angle
if a0>(2*pi) a0=a0-2*pi; end
gamma=gamma_mod*(cos(a0)+1j*sin(a0));
plot(ax(2),real(gamma),imag(gamma),'ro','LineWidth',1.5);
% drawnow
end
plot(ax(2),xint,yint,'go')

1/Yb_2 = 75.009858443284173 +72.565629355776380i

isequal(Yb_2,gamma2z(-gb2,1/Z0)) =
logical
1

D2_TL_lambda=arc2/(4*pi) D2_TL_lambda = 0.227671146092940

D2_TL_angle_deg=D2_TL_lambda*180/.5 D2_TL_angle_deg = 81.961612593458412

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 2 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

% calculating stub lenght Dstub1

hf(3)=figure(3);sm(3)=smithchart; ax(3)=hf(3).CurrentAxes; hold(ax(3),'on');

plot(ax(3),real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0])

gamma_YL_angle=angle(gamma_YL);gamma_YL_mod=abs(gamma_YL)
if gamma_YL_angle<0 gamma_YL_angle=2*pi+gamma_YL_angle; end
if gamma_YL_angle>(2*pi) gamma_YL_angle=gamma_YL_angle-2*pi; end
Smith_plotY(ax(3),YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax(3),YL,1/Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(3),ZL,Z0,[1 .6 .6])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[xr1,yr1]=Smith_plotRcircle(ax(3),Z0,Z0,[0 0 1])
[xint,yint]=intersections(x_swr,y_swr,xr1,yr1,1);
plot(ax(3),xint,yint,'go')

gb1=xint(1)+1j*yint(1);gb1_angle=angle(gb1);gb1_mod=abs(gb1)
if gb1_angle<0 gb1_angle=2*pi+gb1_angle; end
if gb1_angle>(2*pi) gb1_angle=gb1_angle-2*pi; end

yb_1=1/Z0*((1+gb1)/(1-gb1))^-1
1/yb_1 % check already on r=1
Smith_plotRefLine2PhaseCircle(ax(3),1/yb_1,Z0,[.2 .8 .2]) % 1st intersection

gstub=conj(gb1) % where Zin has to move next


plot(ax(3),real(gstub),imag(gstub),'bo')

% using Z Smith chart values as if reversed Y Smith chart


Zbs=(1/Z0*(1-gstub)/(1+gstub)) ^-1

Zbs2=1j*imag(Zbs)

refl_Zstub=(Z0-Zbs2)/(Z0+Zbs2)
refl_Ystub=-refl_Zstub % where stub Zin has to be

plot(ax(3),real(refl_Ystub),imag(refl_Ystub),'ro')

Smith_plotRefLine2PhaseCircle(ax(3),Zbs2,Z0,[.2 .2 .8])
Smith_plotBarc(ax(3),Zbs,Z0,[1 0 1])

da=1/100;a_stub=[angle(refl_Ystub):da:pi];arc_stub1=da;

for k=1:1:numel(a_stub)
gamma_stub=cos(a_stub)+1j*sin(a_stub);
arc_stub1=arc_stub1+da;
plot(ax(3),real(gamma_stub),imag(gamma_stub),'bo','LineWidth',1.5);
end
arc_stub1=arc_stub1-da;

http://i63.tinypic.com/2l9sb6a.jpg

directly from the intersection points

Dstub1_lambda=abs(-pi-angle(gstub))*.25/pi Dstub1_lambda = 0.160864794588070

electric length of OC stub

Dstub1_angle_rad=abs(-pi-angle(gstub))/2 Dstub1_angle_rad = 1.010743313798222


Dstub1_angle_deg=abs(-pi-angle(gstub))*90/pi Dstub1_angle_deg = 57.911326051705117

from the arc on Smith chart

arc_stub1*180/pi
arc_stub1_lambda=.25/pi*arc_stub1 arc_stub1_lambda = 0.122549306180760

same as

Dstub1_lambda=arc_stub1/(4*pi) Dstub1_lambda = 0.122549306180760


Dstub1_angle_deg= arc_stub1/2*360/(2*pi) Dstub1_angle_deg = 44.117750225073422

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 3 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.
% calculating stub lenght Dstub2

hf(4)=figure(4);sm(4)=smithchart; ax(4)=hf(4).CurrentAxes;hold(ax(4),'on');

plot(ax(4),real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0])

Smith_plotY(ax(4),YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax(4),YL,1/Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax(4),ZL,Z0,[1 .6 .6])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[xr1,yr1]=Smith_plotRcircle(ax(4),Z0,Z0,[0 0 1])
[xint,yint]=intersections(x_swr,y_swr,xr1,yr1,1);
plot(ax(4),xint,yint,'go')

gb2=xint(2)+1j*yint(2);gb2_angle=angle(gb2);gb2_mod=abs(gb2)
if gb2_angle<0 gb2_angle=2*pi+gb2_angle; end
if gb2_angle>(2*pi) gb2_angle=gb2_angle-2*pi; end

Yb_2=1/Z0*((1+gb2)/(1-gb2)) ^-1
1/Yb_2 % check already on r=1
Smith_plotRefLine2PhaseCircle(ax(4),1/Yb_2,Z0,[.2 .8 .2])

gstub=conj(gb2)
plot(ax(4),real(gstub),imag(gstub),'bo')

Zbs=(1/Z0*(1-gstub)/(1+gstub)) ^-1

% using Z Smith chart values as if reversed Y Smith chart

Smith_plotBarc(ax(4),Zbs,Z0,[1 0 1])

% constant reactance arc plot line can also be called after defining Zbs

Zbs2=1j*imag(Zbs)

refl_Zstub=(Z0-Zbs2)/(Z0+Zbs2)
refl_Ystub=-refl_Zstub

plot(ax(4),real(refl_Ystub),imag(refl_Ystub),'ro')

Smith_plotRefLine2PhaseCircle(ax(4),Zbs2,Z0,[.2 .2 .8])

da=1/100;a_stub=[angle(refl_Ystub):da:pi];arc_stub2=da;

for k=1:1:numel(a_stub)
gamma_stub=cos(a_stub)+1j*sin(a_stub);
arc_stub2=arc_stub2+da;
plot(ax(4),real(gamma_stub),imag(gamma_stub),'bo','LineWidth',1.5);
end
arc_stub2=arc_stub2-da;

http://i68.tinypic.com/35mir1h.jpg

directly from the intersection points

Dstub2_lambda=abs(-pi-angle(stub))*.5/pi Dstub2_lambda = 0.321729589176140


Dstub2_angle_rad=abs(-pi-angle(stub))/2 Dstub2_angle_rad = 1.010743313798222
Dstub2_angle_deg=abs(-pi-angle(stub))*90/pi Dstub2_angle_deg = 57.911326051705117

Dstub2_lambda=abs(-pi-angle(gstub))*.25/pi Dstub2_lambda = 0.160864794588070

electric length of OC stub


Dstub2_angle_rad=abs(-pi-angle(gstub))/2 Dstub2_angle_rad = 1.010743313798222
Dstub2_angle_deg=abs(-pi-angle(gstub))*90/pi Dstub2_angle_deg = 57.911326051705117

from the arc on Smith chart


arc_stub2_lambda=.25/pi*arc_stub2 arc_stub2_lambda = 0.377992989843247

same as

Dstub2_lambda=arc_stub2/(4*pi) Dstub2_lambda = 0.377992989843247


Dstub2_angle_deg=arc_stub2/2*360/(2*pi) Dstub2_angle_de = 1.360774763435689e+02

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 4 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

Equations trimmed for all stub lengths:

Without Smith chart, [POZAR] solves this single open shunt stub match directly with the following equations

RL=real(ZL);XL=imag(ZL);Y0=1/Z0;

% when RLZ0
t1=(XL+((RL*((Z0-RL)^2+XL^2))/Z0)^.5)/(RL-Z0) t1 = 7.071261637588793
t2=(XL-((RL*((Z0-RL)^2+XL^2))/Z0)^.5)/(RL-Z0) t2 = -0.671261637588793

% when RL=Z0
D1_TL=1/(2*pi)*atan(t1);if atan(t1)<0 D1_TL=D1_TL+.5; end D1_TL = 0.227640974365225
D2_TL=1/(2*pi)*atan(t2);if atan(t2)<0 D2_TL=D2_TL+.5; end D2_TL = 0.405911259087935

B1=(RL^2*t1-(Z0-XL*t1)*(XL+Z0*t1))/(Z0*(RL^2+(XL+Z0*t1)^2)) B1 = 0.012904205458629
B2=(RL^2*t2-(Z0-XL*t2)*(XL+Z0*t2))/(Z0*(RL^2+(XL+Z0*t2)^2)) B2 = -0.012904205458629

Dstub1oc=1/(2*pi)*atan(-B1/Y0); if Dstub1<0 Dstub1=Dstub1+.5; end Dstub1oc = 0.377602825442526


Dstub2oc=1/(2*pi)*atan(-B2/Y0); if Dstub1<0 Dstub2=Dstub2+.5; end Dstub2oc = 0.122397174557474

B1 and B2 are the reactances on the circle r=Z0. so stub input reactances 1j*Bs1 and 1j*Bs2
have to be the conjugates of 1j*B1 and 1j*B2

Frequency Response:

Checking frequency notch is correctly generated where expected. First gathering together all transmission line and stub lengths:

D_TL=[D1_TL_lambda D2_TL_lambda] D_TL = 0.405924682355882 0.227671146092940


Dstub=[Dstub1_lambda Dstub2_lambda] Dstub = 0.122549306180760 0.377992989843247

from the equations


D_TL_eq=[D1_TL D2_TL] D_TL_eq = 0.227640974365225 0.405911259087935
Dstub_eq=[Dstub1oc Dstub2oc] Dstub_eq = 0.377602825442526 0.122397174557474

either combine
D_TL(1) = 0.405924682355882
Dstub(1) = 0.122549306180760

or
D_TL(2) = 0.227671146092940
Dstub(2) = 0.161542267238274

D=[D_TL D_TL_eq;Dstub Dstub_eq] D=


Columns 1 through 3
0.405924682355882 0.227671146092940 0.227640974365225
c0=2.998e8;
0.122549306180760 0.377992989843247 0.377602825442526
f0=2e9;
Column 4
df=1e3;f1=1e9;f2=3e9;f=[f1:df:f2];
0.405911259087935
0.122397174557474

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 5 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

Then the physical lengths of all transmission lines and stubs are:
L=D*c0/f0 L=
Columns 1 through 3
0.060848109885147 0.034127904799332 0.034123382057347
0.024334472488865 0.050851890303933 0.056602663533835
Column 4
0.060846097737281
0.018347336466165

GL=real(YL);BL=imag(YL);

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));

% series transmission line input impedance


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)));
end

% open circuit shunt stub input impedance


for k=1:1:size(D,2)
Zin_stb_oc(k,:)=Z0./(1j*tan(2*pi*L(2,k)*f/c0));
end

Zin=1./(ZinTL.^-1+Zin_stb_oc.^-1);

s11=(Zin-Z0)./(Zin+Z0);
s11_mod=abs(s11);

for k=1:1:size(s11_mod,1)
figure(10);plot(f,s11_mod(k,:));hold all;
end
grid on
title('TL + OC shunt stub |s11|');xlabel('f [Hz]')
legend('arc1','arc2','eq1','eq2','Location','northwest')

% 012-1
% 012-2

Directly sweeping frequency f, is equivalent to sweeping relative frequency f/f0 same frequency plot is obtained with the following lines:

frel=linspace(.5,1.5,numel(f));
% series transmission line input impedance
for k=1:1:size(L,2)
ZinTL(k,:)=Z0*(ZL+1j*Z0*tan(2*pi*frel*f0/c0*L(1,k)))./(Z0+1j*ZL*tan(2*pi*frel*f0/c0*L(1,k)));
end
% open circuit shunt stub input impedance
for k=1:1:size(D,2)
Zin_stb_oc(k,:)=Z0./(1j*tan(2*pi*L(2,k)*frel*f0/c0));
end
Zin=1./(ZinTL.^-1+Zin_stb_oc.^-1);
s11=(Zin-Z0)./(Zin+Z0);
s11_mod=abs(s11);

for k=1:1:size(s11_mod,1)
figure(11);plot(frel,s11_mod(k,:));hold all;
end
grid on
title('TL + OC shunt stub |s11|');xlabel('frel=f/f0')
legend('arc1','arc2','eq1','eq2','Location','northwest')

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 6 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

And same as sweeping the wavelength fraction D

Drel=linspace(.5,1.5,numel(f));

for k=1:1:size(L,2)
ZinTL(k,:)=Z0*(ZL+1j*Z0*tan(2*pi*Drel*D(1,k)))./(Z0+1j*ZL*tan(2*pi*Drel*D(1,k)));
% series transmission line input impedance
end

for k=1:1:size(D,2)
Zin_stb_oc(k,:)=Z0./(1j*tan(2*pi*Drel*D(2,k)));
% open circuit shunt stub input impedance
end

Zin=1./(ZinTL.^-1+Zin_stb_oc.^-1);

s11=(Zin-Z0)./(Zin+Z0);
s11_mod=abs(s11);

for k=1:1:size(s11_mod,1)
figure(12);plot(Drel,s11_mod(k,:));hold all;
end
grid on
title('TL + OC shunt stub |s11|');xlabel('Drel=[D/a a*D]')
legend('arc1','arc2','eq1','eq2','Location','northwest')

Complete overlap of frequency responses, between transmission lines and stub lengths obtained with the Smith chart and with the equations.

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 7 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

Comment Smith Chart stub Zin reading error to frequency response:

When erroneously following the line and applying the following stub impedance instead of the correct reactance reading:

% calculating stub lenght Dstub1

Z0=75; ZL=100+1j*80;sm1=smithchart; ax=gca; hold all;


gamma_ZL=(ZL-Z0)/(ZL+Z0);
plot(ax,real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0])
YL=1/ZL;gamma_YL=-gamma_ZL
gamma_YL_angle=angle(gamma_YL);
gamma_YL_mod=abs(gamma_YL)
if gamma_YL_angle<0
gamma_YL_angle=2*pi+gamma_YL_angle; end
if gamma_YL_angle>(2*pi)
gamma_YL_angle=gamma_YL_angle-2*pi; end
Smith_plotY(ax,YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax,YL,1/Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax,ZL,Z0,[1 .6 .6])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[xr1,yr1]=Smith_plotRcircle(ax,Z0,Z0,[0 0 1])
[xint,yint]=intersections(x_swr,y_swr,xr1,yr1); plot(ax,xint,yint,'go')

gb1=xint(1)+1j*yint(1);gb1_angle=angle(gb1);gb1_mod=abs(gb1)
if gb1_angle<0 gb1_angle=2*pi+gb1_angle; end
if gb1_angle>(2*pi) gb1_angle=gb1_angle-2*pi; end

yb_1=1/Z0*((1+gb1)/(1-gb1))^-1
1/yb_1 % check already on r=1
Smith_plotRefLine2PhaseCircle(ax,1/yb_1,Z0,[.2 .8 .2])

gstub=conj(gb1) % where should OC stub Zin be


plot(ax,real(gstub),imag(gstub),'bo')
Ybs=(1/Z0*(1-gstub)/(1+gstub)) % ^-1;

Smith_plotRefLine2PhaseCircle(ax,1/Ybs,Z0,[.2 .2 .8])
Smith_plotBarc(ax,Zbs,Z0,[.8 .2 .8])

da=1/1000;a_stub=[angle(gstub):-da:-pi];arc_stub1=da;
erroneous reading, do not follow the line. but the arc, to correctly read
for k=1:1:numel(a_stub) reactances on the Smith Chart.
gamma_stub=.99*(cos(a_stub)+1j*sin(a_stub));
arc_stub1=arc_stub1+da;
plot(ax,real(gamma_stub),imag(gamma_stub),'bo','LineWidth',1.5);
end

directly from the intersection points

Dstub1_lambda_err=abs(-pi-angle(gstub))*.25/pi Dstub1_lambda_err = 0.339135205411930


Dstub1_angle_rad_err=abs(-pi-angle(gstub))/2 Dstub1_angle_rad_err = 2.130849339791571

electric length of OC stub

Dstub1_angle_deg_err=abs(-pi-angle(gstub))*90/pi Dstub1_angle_deg_err = 1.220886739482949e+02

% from the arc on Smith chart

arc_stub1_lambda_err=.25/pi*arc_stub1 arc_stub1_lambda_err = 0.161542267238274


same as
Dstub1_lambda_err=arc_stub1/(4*pi) Dstub1_lambda_err = 0.161542267238274

Dstub1_angle_deg_err=arc_stub1/2*360/(2*pi) Dstub1_angle_deg_err = 58.155216205778579

While operating the equations, decision points keep showing up where signs
have to be discerned.

Yet, reading the covered arc, from the intersection point to Y Smith chart
Open Circuit -1+0*1j, it's simple and straight to get how long the stub has
to be.

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 8 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.
% calculating stub lenght Dstub2

Z0=75; ZL=100+1j*80;sm1=smithchart; ax=gca; hold all;


gamma_ZL=(ZL-Z0)/(ZL+Z0);
plot(ax,real(gamma_ZL),imag(gamma_ZL),'o','Color',[1 0 0])
YL=1/ZL;gamma_YL=-gamma_ZL
gamma_YL_angle=angle(gamma_YL);gamma_YL_mod=abs(gamma_YL)
if gamma_YL_angle<0
gamma_YL_angle=2*pi+gamma_YL_angle; end
if gamma_YL_angle>(2*pi)
gamma_YL_angle=gamma_YL_angle-2*pi; end
Smith_plotY(ax,YL,1/Z0)

Smith_plotRefLine2PhaseCircle(ax,YL,1/Z0,[.2 .6 .2])
[x_swr,y_swr]=Smith_plotGammaCircle(ax,ZL,Z0,[1 .6 .6])

[g1x,g1y]=pol2cart(gamma_YL_angle,gamma_YL_mod)

[xr1,yr1]=Smith_plotRcircle(ax,Z0,Z0,[0 0 1])
[xint,yint]=intersections(x_swr,y_swr,xr1,yr1); plot(ax,xint,yint,'go')

gb2=xint(2)+1j*yint(2);gb2_angle=angle(gb2);gb2_mod=abs(gb2)
if gb2_angle<0 gb2_angle=2*pi+gb2_angle; end
if gb2_angle>(2*pi) gb2_angle=gb2_angle-2*pi; end

Yb_2=1/Z0*((1+gb2)/(1-gb2))^-1
1/Yb_2 % check already on r=1
Smith_plotRefLine2PhaseCircle(ax,1/Yb_2,Z0,[.2 .8 .2])

gstub=conj(gb2)
plot(ax,real(gstub),imag(gstub),'bo')
Ybs=(1/Z0*(1+gstub)/(1-gstub)) % ^-1;
Smith_plotRefLine2PhaseCircle(ax,Ybs,1/Z0,[.2 .2 .8])
Smith_plotBarc(ax,Zbs,Z0,[.8 .2 .8])

da=1/1000;
a_stub=[angle(gstub):-da:-pi]; % Y Smtih chart, OC is -1+0*1j
arc_stub2=da;

for k=1:1:numel(a_stub)
gamma_stub=.99*(cos(a_stub)+1j*sin(a_stub));
arc_stub2=arc_stub2+da;
plot(ax,real(gamma_stub),imag(gamma_stub),'bo','LineWidth',1.5);
end

directly from the intersection points

Dstub2_lambda_err=abs(-pi-angle(gstub))*.25/pi Dstub2_lambda_err = 0.160864794588070


Dstub2_angle_rad_err=abs(-pi-angle(gstub))/2 Dstub2_angle_rad_err = 1.010743313798222

electric length of OC stub

Dstub2_angle_deg_err=abs(-pi-angle(gstub))*90/pi Dstub2_angle_deg_err = 57.911326051705117

from the arc on Smith chart

arc_stub2_lambda_err=.25/pi*arc_stub2 arc_stub2_lambda_err = 0.339795803501193

same as

Dstub2_lambda_err=arc_stub2/(4*pi) Dstub2_lambda_err = 0.339795803501193

Dstub2_angle_deg_err=arc_stub2/2*360/(2*pi) Dstub2_angle_deg_err = 1.223264892604294e+02

While operating the equations, decision points keep showing up where signs
have to be discerned.

Yet, reading the covered arc, from the intersection point to Y Smith chart
Open Circuit -1+0*1j, it's simple and straight to get how long the stub has
to be.

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 9 / 10
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 03 10/09/2018 23:19:02.

The error introduced by cutting OC shunt stubs a little bit shorter or longer is apparently a small angle error:

errD=Dstub-Dstub_err = -0.038992961057514 0.038197186342054

errD_rad=errD*pi/.25 = -0.490000000000000 0.479999999999989

errD_deg=errD*pi/.25*180/pi = -28.074931961410318 27.501974166278909

Yet when comparing frequency responses:

D_TL=[D1_TL_lambda D2_TL_lambda]
Dstub_err=[Dstub1_lambda_err Dstub2_lambda_err]

D=[D_TL D_TL_eq;Dstub_err Dstub_eq]

c0=2.998e8;
f0=2e9;
df=1e3;f1=1e9;f2=3e9;f=[f1:df:f2];

L=D*c0/f0

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)));

end

for k=1:1:size(D,2)
Zin_stb_oc(k,:)=Z0./(1j*tan(2*pi*L(2,k)*f/c0));
end

Zin=1./(ZinTL.^-1+Zin_stb_oc.^-1);

s11=(Zin-Z0)./(Zin+Z0);
s11_mod=abs(s11);

for k=1:1:size(s11_mod,1)
hf(100)=figure(100);plot(f,s11_mod(k,:));hold all;
end
grid on
title('TL + error 2nd decimal OC shunt stub |s11|');
xlabel('f [Hz]')
legend('arc1','arc2','eq1','eq2','Location','northwest')

Observation: On reading the wrong OC shunt stub input reactance on the Smith chart, despite both stubs being then a little bit too short, one OC stub
pushes the deteriorated frequency notch to a slightly higher frequency , while the other, still being a bit shorter than it should be, it shifts the deteriorated
frequency notch to a slightly lower frequency. So, for fine tuning, it's not always 'shorter' for higher frequencies or 'longer' for lower frequencies.

________________________________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com attached: -- pozar_05_exercisee_03.m 10 / 10