Diary

download Diary

If you can't read please download the document

description

dfgdf

Transcript of Diary

echo on 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? z = ''if isempty(z) z = '50';endZo=str2num(z)Zo = 50freq=input('Cul es la frecuencia de la red en Mhz? ','s')Cul es la frecuencia de la red en Mhz? freq = ''if isempty(freq) freq = '150';ends5=[ freq 'Mhz']s5 =150Mhzf=str2num(freq)*1e6f = 150000000w=2*pi*f %calculate omega, w from frequency of operationw = 9.4248e+008zr=input('Cul es la parte real de la impedancia normalizada necesario? ','s')Cul es la parte real de la impedancia normalizada necesario? zr = ''if isempty(zr) zr = '.1';endz1=str2num(zr)z1 = 0.1000zi=input('Cul es la parte imaginaria de la impedancia normalizada necesario? ','s')Cul es la parte imaginaria de la impedancia normalizada necesario? zi = ''if isempty(zi) zi = '.6';endz2=str2num(zi)z2 = 0.6000zcomplex=z1+j*z2 %this is the desired impedancezcomplex = 0.1000 + 0.6000igama=(zcomplex-1)/(zcomplex+1) %this is the desired reflection coefficientgama = -0.4013 + 0.7643i%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%plot the reflection coefficient on the Smith chart%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%figure(1)smith3plot(gama,'rx')title('impedancia compleja deseada normalizada')s3=[' z=' zr '+j' zi]s3 = z=.1+j.6text(real(gama),imag(gama),s3)ycomplex=1/zcomplex %this is the needed complex admittanceycomplex = 0.2703 - 1.6216imag=abs(gama)mag = 0.8633angle1=180/pi*angle(gama) %angle in degreesangle1 = 117.6995xlabel(['y deseado=' num2str(ycomplex) ' gama deseado= ' num2str(mag) ' deg=' num2str(angle1)])%intersecciones al 1 +/- js admitancia crculo%*******************************************s=sqrt(1/z1-1)s = 3yInterceptP=1+j*syInterceptP = 1.0000 + 3.0000i yInterceptM=1-j*syInterceptM = 1.0000 - 3.0000i%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %intersecciones al 1 +/- jX crculo de impedancia%******************************************* zInterceptM=1/yInterceptPzInterceptM = 0.1000 - 0.3000i zInterceptP=1/yInterceptMzInterceptP = 0.1000 + 0.3000i%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %impdeances to rotate from the 1+/-js admittance circle%*******************************************deltaZP=imag(zInterceptP)-z2deltaZP = -0.3000 deltaZM=imag(zInterceptM)-z2deltaZM = -0.9000 if (deltaZP > 0 & imag(s)==0) % Shunt L Series C zInterceptP %*******************************************elseif (deltaZP < 0 & imag(s)==0) % Shunt L Series L zInterceptP%case2shuntL=Zo/(w*s)shuntL = 1.7684e-008 seriesL=abs(deltaZP*Zo)/wseriesL = 1.5915e-008figure(3)smith3gama1=(zInterceptP-1)/(zInterceptP+1)gama1 = -0.6923 + 0.4615it=num2str(s);s4=[ ' Y=1 - j' t]s4 = Y=1 - j3plot(gama1,'rx')text(real(gama1),imag(gama1),s4) s1=['Shunt L ' num2str(shuntL) ' Series L ' num2str(seriesL)]s1 =Shunt L 1.7684e-008 Series L 1.5915e-008title(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.0000iz = 0.1000 + 0.6000i{??? Undefined function or variable 'end_diary'.Error in ==> shuntL_seriesL at 15end_diaryError in ==> two_element_matching at 127 [zTest]=shuntL_seriesL(shuntL,seriesL,w,Zo)}clc% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);two_element_matchingclear allclose alldelete diary.txt{Warning: File not found or permission denied}> In two_element_matching at 10diary diary.txtecho on 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? 75z =75if isempty(z)endZo=str2num(z)Zo = 75freq=input('Cul es la frecuencia de la red en Mhz? ','s')Cul es la frecuencia de la red en Mhz? 5freq =5if isempty(freq)ends5=[ freq 'Mhz']s5 =5Mhzf=str2num(freq)*1e6f = 5000000w=2*pi*f %calculate omega, w from frequency of operationw = 3.1416e+007zr=input('Cul es la parte real de la impedancia normalizada necesario? ','s')Cul es la parte real de la impedancia normalizada necesario? 50zr =50if isempty(zr)endz1=str2num(zr)z1 = 50zi=input('Cul es la parte imaginaria de la impedancia normalizada necesario? ','s')Cul es la parte imaginaria de la impedancia normalizada necesario? -3zi =-3if isempty(zi)endz2=str2num(zi)z2 = -3zcomplex=z1+j*z2 %this is the desired impedancezcomplex = 50.0000 - 3.0000igama=(zcomplex-1)/(zcomplex+1) %this is the desired reflection coefficientgama = 0.9609 - 0.0023i%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%plot the reflection coefficient on the Smith chart%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%figure(1)smith3plot(gama,'rx')title('impedancia compleja deseada normalizada')s3=[' z=' zr '+j' zi]s3 = z=50+j-3text(real(gama),imag(gama),s3)ycomplex=1/zcomplex %this is the needed complex admittanceycomplex = 0.0199 + 0.0012imag=abs(gama)mag = 0.9609angle1=180/pi*angle(gama) %angle in degreesangle1 = -0.1371xlabel(['y deseado=' num2str(ycomplex) ' gama deseado= ' num2str(mag) ' deg=' num2str(angle1)])%intersecciones al 1 +/- js admitancia crculo%*******************************************s=sqrt(1/z1-1)s = 0 + 0.9899iyInterceptP=1+j*syInterceptP = 0.0101 yInterceptM=1-j*syInterceptM = 1.9899%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %intersecciones al 1 +/- jX crculo de impedancia%******************************************* zInterceptM=1/yInterceptPzInterceptM = 99.4975 zInterceptP=1/yInterceptMzInterceptP = 0.5025%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %impdeances to rotate from the 1+/-js admittance circle%*******************************************deltaZP=imag(zInterceptP)-z2deltaZP = 3 deltaZM=imag(zInterceptM)-z2deltaZM = 3 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 Cz=sqrt(1/real(ycomplex)-1)z = 7.0128zInterceptP=1+j*zzInterceptP = 1.0000 + 7.0128i zInterceptM=1-j*zzInterceptM = 1.0000 - 7.0128i yInterceptM=1/zInterceptPyInterceptM = 0.0199 - 0.1398i yInterceptP=1/zInterceptMyInterceptP = 0.0199 + 0.1398ideltaYP=imag(yInterceptP)-imag(ycomplex)deltaYP = 0.1386 deltaYM=imag(yInterceptM)-imag(ycomplex)deltaYM = -0.1409 %intersections to the 1+/-z circle %*******************************************if (deltaYM < 0 & imag(z)==0 ) % Series L Shunt C zInterceptP%case1 seriesL=abs(z*Zo)/wseriesL = 1.6742e-005 shuntC=abs(deltaYM)/(Zo*w)shuntC = 5.9821e-011figure(6)smith3gama1=(zInterceptP-1)/(zInterceptP+1)gama1 = 0.9248 + 0.2637it=num2str(z);s4=[ ' Z=1 +j' t]s4 = Z=1 +j7.0128plot(gama1,'rx')text(real(gama1),imag(gama1),s4) s=['Series L ' num2str(seriesL) ' Shunt C ' num2str(shuntC)]s =Series L 1.6742e-005 Shunt C 5.9821e-011title(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 ==> seriesL_shuntC at 16end_diaryError in ==> two_element_matching at 202 [zTest]=seriesL_shuntC(seriesL,shuntC,w,Zo)} opentoline('C:\Users\Dr.Moe\Desktop\smith_chart_demo1\two_element_matching.m',10,1)clcuiopen('C:\Users\Dr.Moe\Desktop\smiths\scDraw.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scDrawans = 1uiopen('C:\Users\Dr.Moe\Desktop\smiths\scMatchCirc.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scMatchCircuiopen('C:\Users\Dr.Moe\Desktop\smiths\scRay.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scRay{??? Input argument "point" is undefined.Error in ==> scRay at 39 r1 = point(1);}% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scRay{??? Input argument "point" is undefined.Error in ==> scRay at 39 r1 = point(1);}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scPOI.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scPOI{??? Input argument "x" is undefined.Error in ==> scPOI at 38if x~=0,}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scMove.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scMove{??? Input argument "Pos1" is undefined.Error in ==> scMove at 40 r1 = Pos1(1);}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scInv.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scInv{??? Error using ==> scInv at 30scInv.m: One input argument required...You may give LinCol as second argument as well}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scConCirc.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scConCirc{??? Input argument "r" is undefined.Error in ==> scConCirc at 36 x = linspace(-r,r,200);}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scArc.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scArc{??? Input argument "Point" is undefined.Error in ==> scArc at 40 r1 = Point(1);}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scConCirc.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scConCirc{??? Input argument "r" is undefined.Error in ==> scConCirc at 36 x = linspace(-r,r,200);}uiopen('C:\Users\Dr.Moe\Desktop\smiths\scDraw.m',1)% Modify expression to add input arguments.% Example:% a = [1 2 3; 4 5 6]; % foo(a);scDrawans = 1x=1x = 1xx = 1clc