# How to solve Microwave Engineering Pozar problem 2.29 with MATLAB

#### John_2016

Joined Nov 23, 2016
55
the literature source is available here:
https://www.amazon.co.uk/Microwave-...-1&keywords=David+Pozar+Microwave+Engineering

There's also a solutions manual available here:
https://www.scribd.com/doc/176505749/Microwave-engineering-pozar-4th-Ed-solutions-manual

the question

Z0=50 % ohm

Zgen=50
Vgen=10 % Volt
ZL=100

syms lambda
alpha_dB=.5/lambda % [dB/lambda]
Np2dB=10*log10(exp(1)^2)
alpha_Np=alpha_dB/Np2dB

beta=2*pi/lambda % [m^-1]
L=2.3*lambda % length of transmission line [m]

gamma=alpha_Np+1j*beta
gamma_L=gamma*L

sometimes for the complex propagation constant gamma, units Np/m and degree are mixed as done in the solutions manual for this exercise.

For this exercise the solutions manual shows gamma=.1325 +1j*108º. 108 degree is the remainder of imag(gamma_degree)/360

14.4513*180/pi-floor(14.4513*180/pi/360)*360

reflection coefficients on both sides of the transmission line

TL input impedance (from generator)

Results:

alpha_dB
=1/(2*lambda)
Np2dB
= 8.685889638065037
alpha_Np
=281474976710656/(4889721167171369*lambda)
= 0.132398642847158 +14.451326206513048i

= 0.333333333333333

refl_gen

= -0.206936161907528 + 0.150347922208021i
Zin
= 31.588363022059227 +10.163454575205781i

TL input power

= 0.198382847405214

= 0.144789944222718

Power loss

= 0.053592903182496

Comment 1: perhaps of use too, the maximum available power from generator:

Pmax_gen=.5*(abs(Vgen))^2/(4*real(Zgen))
Pmax_gen = 0.25

Alternatively

alpha_dB and alpha_Np are per meter.
alpha=double(alpha_Np*L)
= 0.132398642847158
Pout=Pin*exp(-2*alpha)
= 0.152231357248704

Error in the solutions manual: assumes that both generator and load both matched; generator to TL and TL to load. And then calculates V0plus

= 4.379958588165586

It's reasonable to consider that V0plus =Vgen*Zin/(Zgen+Zin)*(exp(g_L)+refl_gen*exp(-gamma_L_rad)) should be used, 2.89a in [POZAR] pg81

absVin=abs(Vin)

Vin
= 0.155584072758048 - 3.279133570422918i

absVin

= 3.282822471040817

would be the correct start voltage for the procedure followed in the solutions manual.

This Pin is the same as the above used

= 4.035947066681602

And it's not the other apparently correct

Vgen*Zin/(Zin+Zgen)
abs(Vgen*Zin/(Zin+Zgen))

Loss_dB=double(alpha_dB*L)

= 1.367657186248119
10*log10(exp(2*alpha))
= 1.150000000000000

0.21 dB missing, the perturbation method is not exact

Generator and TL are matched, but TL and load are not. And it's not the other apparently correct

Vgen*Zin/(Zin+Zgen)
= 3.965319190462363 + 0.751739611040107i
abs(Vgen*Zin/(Zin+Zgen))
= 4.035947066681602

Comment: Zin with lossless TL would be

= 26.928588541323347 +11.871170407231441i

same as

Zin_lossless=Z0*(ZL+1j*Z0*tan(2*pi*2.3))/(Z0+1j*ZL*tan(2*pi*2.3))
= 26.928588541323329 +11.871170407231373i

Now with Smith Chart:
sm1=smithchart; ax=gca; hold all;
refl_ZL=(ZL-Z0)/(ZL+Z0);

plot(ax,real(refl_ZL),imag(refl_ZL),...
'o','Color',[1 0 0],...
'LineWidth',2,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[.8 .2 .2],...

'MarkerSize',7) % ZL

plot(ax,refl_mod(end).*cos(a(end)),refl_mod(end).*sin(a(end)),...
'o','Color',[1 0 0],...
'LineWidth',2,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[.2 .8 .2],...

'MarkerSize',7) % Zin at generator

[x_swr,y_swr]=Smith_plotGammaCircle(ax,ZL,Z0,[1 .4 .4])

refl_in=refl_mod(end).*cos(a(end))+1j*refl_mod(end).*sin(a(end))

Zin_gen=Z0*(1+refl_in)/(1-refl_in)
[x_swr,y_swr]=Smith_plotGammaCircle(ax,Zin_gen,Z0,[.4 1 .4])

SWR_gen=(1+abs(refl_in))/(1-abs(refl_in))

str_swr_gen=['SWR Generator = ' num2str(SWR_gen)]

legend(ax,'off')

Smith_plotRefLine2PhaseCircle(ax,ZL,Z0,[.6 1 .6])
Smith_plotRefLine2PhaseCircle(ax,Zin_gen,Z0,[.6 1 .6])

syms lambda

alpha_dB=.5/lambda % [dB/lambda]
Np2dB=10*log10(exp(1)^2);alpha_Np=alpha_dB/Np2dB
beta=2*pi/lambda;L=2.3*lambda

g=alpha_Np+1j*beta % g=gamma=alpha+1j*beta

g_L=g*L;g_L=double(simplify(g_L))

angle to run along TL: beta*L=pi rad means 360º around Smith Chart
so to match the imag(g_L) angle with Smith chart angle, double it.

N1=100
da=2*pi/N1 % angle differential for 2*pi around Smith Chart = lambda/2

amount_full_turns=floor(14.4513*180/pi/360)

angle rads left when no full turns left

14.4513-floor(14.4513*180/pi/360)
amount_da_rem=floor((14.4513-floor(14.4513*180/pi/360))/da)

total amount angle steps needed to achieve N1 resolution

N2=N1*amount_full_turns+amount_da_rem
a0=angle(refl_ZL)
a=double(linspace(a0,2*imag(g_L),N2));

refl_mod=linspace(refl_ZL,refl_ZL*exp(-real(g_L)),N2)
plot(ax,refl_mod.*cos(a),refl_mod.*sin(a),…
'-','LineWidth',.5,'Color',[1 0 0])

plot(ax,refl_mod(end).*cos(a(end)),refl_mod(end).*sin(a(end)),…
'o','Color',[0 1 0],...
'LineWidth',2,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[.8 .2 .2],...

'MarkerSize',7) % ZL

axis([-0.4008 0.3832 -0.4103 0.3737])

Comment, possible error in solutions manual:
the value of tanh(gamma*L) does not correspond to tanh of the calculated gamma*L

It's actually increased by 1/exp(alpha*L) but it's not mentioned anywhere.

Comment, the following expressions shouldn't be used in this exercise because they are for lossless transmission lines only:

Custom support functions I have used:

1.- Smith_plotRefLine2PhaseCircle.m

function a=Smith_plotRefLine2PhaseCircle(ax,Z,Z0,colour)
% plot reference line from origin through ZL to outer phase reference circle
% added color option with field colour [r g b] r,g,b within [0 1]

gamma_L=(Z-Z0)/(Z+Z0)

a=angle(gamma_L)
plot(ax,[0 real(exp(1j*a))],[0 imag(exp(1j*a))],'Color',colour,'LineWidth',1)

function input_checks

[szc1 szc2]=size(colour);
if szc1>1 || szc2~=3
disp('\ncolour wrong amount elements\n');
return;
end

if max(colour>1) || min(colour<0)
disp('\ncolour component(s) out of range\n');
return;
end

if numel(Z0)>1
disp('\nZ0 cannot be vector\n');
return;
end

Z=Z( : );
[sz1 sz2]=size(Z);
cas=1;
if sz2>1
cas=2;
end
end
end

2.- Smith_plotGammaCircle.m

function [x_data,y_data]=Smith_plotGammaCircle(ax,Z,Z0,colour)
% plot SWR circle, lossless TL
% color format [r g b] each ranging[0 1] where 0:white 1:black
input_checks;

gamma=z2gamma(Z,Z0);
r=abs(gamma);
alpha=0:2*pi/100:2*pi;
hold all;
sub_hp2=plot(ax,r*cos(alpha),r*sin(alpha),'-','LineWidth',.5,'Color',colour);

x_data=sub_hp2.XData;
y_data=sub_hp2.YData;

function input_checks

[szc1 szc2]=size(colour);
if szc1>1 || szc2~=3
disp('\ncolour wrong amount elements\n');
return;
end

if max(colour>1) || min(colour<0)
disp('\ncolour component(s) out of range\n');
return;
end

if numel(Z0)>1
disp('\nZ0 cannot be vector\n');
return;
end

Z=Z( : );
[sz1 sz2]=size(Z);
cas=1;
if sz2>1
cas=2;
end
end
end

Last edited:

#### WBahn

Joined Mar 31, 2012
27,379
Is there a question here?

Or are you just posting solutions to random textbook problems for others to copy and turn in to get credit as their own work?

#### John_2016

Joined Nov 23, 2016
55
Hi WBahn

I am going through all exercises of the above mentioned literature reference. If time and licences available I am going to also include solutions with simulators like Genesys (Eesof) ADS (Agilent now Keysight) and others, to then compare.

It's good you have posted your question because it's made realize that perhaps best way to publish these MATLAB solutions is in my blog.

I am aware of the practice of adding a licence text file to free scripts only asking for the original author to be mentioned

In my opinion, this and other good-faith conventions don't work: I am the author, if some one claims credit
for my work, since I haven't filed for copyrights, it's up to the professors collecting plagiarism to detect it and act accordingly.

In your logo, the aircraft is an F22, isn't it?

#### WBahn

Joined Mar 31, 2012
27,379
Hi WBahn

I am going through all exercises of the above mentioned literature reference. If time and licences available I am going to also include solutions with simulators like Genesys (Eesof) ADS (Agilent now Keysight) and others, to then compare.

It's good you have posted your question because it's made realize that perhaps best way to publish these MATLAB solutions is in my blog.

I am aware of the practice of adding a licence text file to free scripts only asking for the original author to be mentioned

In my opinion, this and other good-faith conventions don't work: I am the author, if some one claims credit
for my work, since I haven't filed for copyrights, it's up to the professors collecting plagiarism to detect it and act accordingly.

In your logo, the aircraft is an F22, isn't it?
A blog is a much better place for posting something like that. Posting in the forums here is not appropriate. We expect students requesting help with their assignments to show their best efforts so that we can help them discover their mistakes and misconceptions so that they can learn from them. Having solutions available here for them to just copy seriously undermines that philosophy.

The aircraft is an F-15 (which was called the Eagle, hence why F-15 maintenance personnel referred to ourselves as Eagle Keepers).

#### John_2016

Joined Nov 23, 2016
55
When I try a new entry in my blog, the following message appears:

#### bertus

Joined Apr 5, 2008
22,088
Hello,

New members are blocked from starting a blog, to prevent spam.
You can start a blog when you have reached a postcount of 10.

Bertus