j=sqrt(-1) %use j as the complex operator to keep
j =
0.0000 + 1.0000i
%consistent with electronic literature on this subject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%input section for characteristic impedance Zo
%input section for frequency of operation in Mhz
%input section for real part of desired impedance
%input section for imaginary part of desired impedance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
z=input('What is the characteristic impedance Zo? ','s')
What is the characteristic impedance Zo?
z =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(z)
z = '50';
end
Zo=str2num(z)
Zo =
50
freq=input('What is the frequency of the network in Mhz? ','s')
What is the frequency of the network in Mhz?
freq =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(freq)
freq = '150';
end
s5=[ freq 'Mhz']
s5 =
'150Mhz'
f=str2num(freq)*1e6
f =
150000000
w=2*pi*f %calculate omega, w from frequency of operation
w =
9.4248e+08
zr=input('What is the real part of the normalized impedance needed? ','s')
What is the real part of the normalized impedance needed?
zr =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(zr)
zr = '.1';
end
z1=str2num(zr)
z1 =
0.1000
zi=input('What is the imaginary part of the normalized impedance needed? ','s')
What is the imaginary part of the normalized impedance needed?
zi =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(zi)
zi = '.6';
end
z2=str2num(zi)
z2 =
0.6000
zcomplex=z1+j*z2 %this is the desired impedance
zcomplex =
0.1000 + 0.6000i
gama=(zcomplex-1)/(zcomplex+1) %this is the desired reflection coefficient
gama =
-0.4013 + 0.7643i
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%plot the reflection coefficient on the Smith chart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1)
smith3
plot(gama,'rx')
title('normalized desired complex impedance')
s3=[' z=' zr '+j' zi]
s3 =
' z=.1+j.6'
text(real(gama),imag(gama),s3)
ycomplex=1/zcomplex %this is the needed complex admittance
ycomplex =
0.2703 - 1.6216i
mag=abs(gama)
mag =
0.8633
angle1=180/pi*angle(gama) %angle in degrees
angle1 =
117.6995
xlabel(['y desired=' num2str(ycomplex) ' gama desired= ' num2str(mag) ' deg=' num2str(angle1)])
%intersections to the 1+/-js admittance circle
%*******************************************
s=sqrt(1/z1-1)
s =
3
yInterceptP=1+j*s
yInterceptP =
1.0000 + 3.0000i
yInterceptM=1-j*s
yInterceptM =
1.0000 - 3.0000i
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%intersections to the 1+/-jX impedance circle
%*******************************************
zInterceptM=1/yInterceptP
zInterceptM =
0.1000 - 0.3000i
zInterceptP=1/yInterceptM
zInterceptP =
0.1000 + 0.3000i
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%impdeances to rotate from the 1+/-js admittance circle
%*******************************************
deltaZP=imag(zInterceptP)-z2
deltaZP =
-0.3000
deltaZM=imag(zInterceptM)-z2
deltaZM =
-0.9000
if (deltaZP > 0 & imag(s)==0) % Shunt L Series C zInterceptP
%*******************************************
elseif (deltaZP < 0 & imag(s)==0) % Shunt L Series L zInterceptP
%case2
shuntL=Zo/(w*s)
shuntL =
1.7684e-08
seriesL=abs(deltaZP*Zo)/w
seriesL =
1.5915e-08
figure(3)
smith3
gama1=(zInterceptP-1)/(zInterceptP+1)
gama1 =
-0.6923 + 0.4615i
t=num2str(s);
s4=[ ' Y=1 - j' t]
s4 =
' Y=1 - j3'
plot(gama1,'rx')
text(real(gama1),imag(gama1),s4)
s1=['Shunt L ' num2str(shuntL) ' Series L ' num2str(seriesL)]
s1 =
'Shunt L 1.7684e-08 Series L 1.5915e-08'
title(s1)
plot(gama,'rx')
text(real(gama),imag(gama),s3)
text(.5,1,s5)
[zTest]=shuntL_seriesL(shuntL,seriesL,w,Zo)
Zt =
5.0000 +30.0000i
z =
0.1000 + 0.6000i
{函数或变量 'end_diary' 无法识别。
出错 <a href="matlab:matlab.internal.language.introspective.errorDocCallback('shuntL_seriesL', 'G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\shuntL_seriesL.m', 15)" style="font-weight:bold">shuntL_seriesL</a> (<a href="matlab: opentoline('G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\shuntL_seriesL.m',15,0)">第 15 行</a>)
end_diary
出错 <a href="matlab:matlab.internal.language.introspective.errorDocCallback('two_element_matching', 'G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\two_element_matching.m', 127)" style="font-weight:bold">two_element_matching</a> (<a href="matlab: opentoline('G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\two_element_matching.m',127,0)">第 127 行</a>)
[zTest]=shuntL_seriesL(shuntL,seriesL,w,Zo)
}
opentoline('G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\two_element_matching.m',127,0)
opentoline('G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\shuntL_seriesL.m',15,0)
two_element_matching
%tw0_elelment_matching.m
%This is a file to calculate series/shunt or shunt/series
%2 element matching components from a given
%normalized impedance at a specific frequency.
%the characteristic impedance is selectable
%all calculations are done with normalized impdeances
% John Wetters
clear all
close all
delete diary.txt
[警告: 未找到文件或者权限被拒绝]
[> 位置:<a href="matlab:matlab.internal.language.introspective.errorDocCallback('two_element_matching', 'G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\two_element_matching.m', 10)" style="font-weight:bold">two_element_matching</a> (<a href="matlab: opentoline('G:\B_大规模资源库\0016-基于matlab史密斯圆图演示源码程序\基于matlab史密斯圆图演示源码程序\史密斯圆图演示\smith_chart_demo1\two_element_matching.m',10,0)">第 10 行</a>)]
diary diary.txt
echo on
j=sqrt(-1) %use j as the complex operator to keep
j =
0.0000 + 1.0000i
%consistent with electronic literature on this subject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%input section for characteristic impedance Zo
%input section for frequency of operation in Mhz
%input section for real part of desired impedance
%input section for imaginary part of desired impedance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
z=input('What is the characteristic impedance Zo? ','s')
What is the characteristic impedance Zo?
z =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(z)
z = '50';
end
Zo=str2num(z)
Zo =
50
freq=input('What is the frequency of the network in Mhz? ','s')
What is the frequency of the network in Mhz?
freq =
空的 0×0 <a href="matlab:helpPopup char" style="font-weight:bold">char</a> 数组
if isempty(freq)
freq = '150';
end
s5=[ freq 'Mhz']
s5 =
'150Mhz'
f=str2num(freq)*1e6
f =
150000000
w=2*pi*f %calculate omega, w from frequency of operation
w =
9.4248e+08
zr=input('What is the real part of the normalized impedance needed? ','s')
What is the real part of the normalized impedance needed?
zr =