Вы находитесь на странице: 1из 6

j=sqrt(-1) %use j as the complex operator to keep

j =
0 + 1.0000i
%consistent with electronic literature on this subject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% seccin de entrada de impedancia caracterstica Zo
% seccin de entrada para la frecuencia de funcionamiento en MHz
%seccin de entrada para la parte real de la impedancia deseada
%seccin de entrada para la parte imaginaria de la impedancia deseada
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
z=input('Cul es la impedancia caracterstica Zo? ','s')
Cul es la impedancia caracterstica Zo? 40
z =
40
if isempty(z)
end
Zo=str2num(z)
Zo =
40
freq=input('Cul es la frecuencia de la red en Mhz? ','s')
Cul es la frecuencia de la red en Mhz? 0.0027
freq =
0.0027
if isempty(freq)
end
s5=[ freq 'Mhz']
s5 =
0.0027Mhz
f=str2num(freq)*1e6
f =
2700
w=2*pi*f %calculate omega, w from frequency of operation
w =
1.6965e+004
zr=input('Cul es la parte real de la impedancia normalizada necesario?

','s')

Cul es la parte real de la impedancia normalizada necesario?

102

zr =
102
if isempty(zr)
end
z1=str2num(zr)
z1 =
102
zi=input('Cul es la parte imaginaria de la impedancia normalizada necesario?
's')
Cul es la parte imaginaria de la impedancia normalizada necesario? 0+60j
zi =
0+60j
if isempty(zi)
end
z2=str2num(zi)
z2 =
0 +60.0000i
zcomplex=z1+j*z2 %this is the desired impedance
zcomplex =
42
gama=(zcomplex-1)/(zcomplex+1) %this is the desired reflection coefficient
gama =
0.9535
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%plot the reflection coefficient on the Smith chart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1)
smith3
plot(gama,'rx')
title('impedancia compleja deseada normalizada')
s3=[' z=' zr '+j' zi]
s3 =
z=102+j0+60j
text(real(gama),imag(gama),s3)
ycomplex=1/zcomplex %this is the needed complex admittance

',

ycomplex =
0.0238
mag=abs(gama)
mag =
0.9535
angle1=180/pi*angle(gama) %angle in degrees
angle1 =
0
xlabel(['y deseado=' num2str(ycomplex) '
num2str(angle1)])

gama deseado= ' num2str(mag) ' deg='

%intersecciones al 1 +/- js admitancia crculo


%*******************************************
s=sqrt(1/z1-1)
s =
0 + 0.9951i
yInterceptP=1+j*s
yInterceptP =
0.0049
yInterceptM=1-j*s
yInterceptM =
1.9951
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%intersecciones al 1 +/- jX crculo de impedancia
%*******************************************
zInterceptM=1/yInterceptP
zInterceptM =
203.4988
zInterceptP=1/yInterceptM
zInterceptP =
0.5012
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%impdeances to rotate from the 1+/-js admittance circle
%*******************************************
deltaZP=imag(zInterceptP)-z2

deltaZP =
0 -60.0000i
deltaZM=imag(zInterceptM)-z2
deltaZM =
0 -60.0000i

if (deltaZP > 0 & imag(s)==0) % Shunt L Series C zInterceptP


%*******************************************
elseif (deltaZP < 0 & imag(s)==0) % Shunt L Series L zInterceptP
if (deltaZM < 0 & imag(s)==0) % Shunt C Series L zInterceptM
%*******************************************
elseif (deltaZM > 0 & imag(s)==0) % Shunt C Series C zInterceptM
%intersections to the 1+/-z circle
%Series L or C to shunt L or C
z=sqrt(1/real(ycomplex)-1)
z =
6.4031
zInterceptP=1+j*z
zInterceptP =
1.0000 + 6.4031i
zInterceptM=1-j*z
zInterceptM =
1.0000 - 6.4031i
yInterceptM=1/zInterceptP
yInterceptM =
0.0238 - 0.1525i
yInterceptP=1/zInterceptM
yInterceptP =
0.0238 + 0.1525i
deltaYP=imag(yInterceptP)-imag(ycomplex)
deltaYP =
0.1525

deltaYM=imag(yInterceptM)-imag(ycomplex)
deltaYM =
-0.1525
%intersections to the 1+/-z circle
%*******************************************
if (deltaYM < 0 & imag(z)==0 ) % Series L Shunt C zInterceptP
%case1
seriesL=abs(z*Zo)/w
seriesL =
0.0151
shuntC=abs(deltaYM)/(Zo*w)
shuntC =
2.2467e-007
figure(6)
smith3
gama1=(zInterceptP-1)/(zInterceptP+1)
gama1 =
0.9111 + 0.2846i
t=num2str(z);
s4=[ ' Z=1 +j' t]
s4 =
Z=1 +j6.4031
plot(gama1,'rx')
text(real(gama1),imag(gama1),s4)
s=['Series L ' num2str(seriesL) ' Shunt C ' num2str(shuntC)]
s =
Series L 0.015098 Shunt C 2.2467e-007
title(s)
plot(gama,'rx')
text(real(gama),imag(gama),s3)
text(.5,1,s5)
[zTest]=seriesL_shuntC(seriesL,shuntC,w,Zo)
{??? Undefined function or variable 'end_diary'.
Error in ==> <a href="matlab: opentoline('C:\Users\Dr.Moe\Desktop\smith_chart_de
mo1\seriesL_shuntC.m',16,0)">seriesL_shuntC at 16</a>
end_diary
Error in ==> <a href="matlab: opentoline('C:\Users\Dr.Moe\Desktop\smith_chart_de
mo1\two_element_matching.m',202,0)">two_element_matching at 202</a>
[zTest]=seriesL_shuntC(seriesL,shuntC,w,Zo)
}
opentoline('C:\Users\Dr.Moe\Desktop\smith_chart_demo1\two_element_matching.m',2

02,0)
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
Smith
************************************************************************
Welcome to Smith
Smith is a software tool to solve smith chart on computer ruling out old
methods of pencil and paper with embedded features to reduce effort and
improved accuracy
************************************************************************
************************************************************************
Thanks for trying Smith
For feedback and suggestions contact : gauravgg@iitk.ac.in
gaurav71531@gmail.com
************************************************************************
clc

Вам также может понравиться