Guest User

Untitled

a guest
Jul 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 7.09 KB | None | 0 0
  1. %bonificacion
  2. %Un cable coaxial tiene una impedancia característica de 75 @ 3GHz.
  3. %La frecuencia central de operación de el generador es 1.600GHz y,
  4. %mediante el cable, alimenta una carga desconocida. Mediciones en el
  5. %sistema dan los siguientes datos: la relación de onda estacionaria es de
  6. %1.9 y los mínimos de voltage se corren 11cm hacia el generador, respecto
  7. %de los nulos cuando la línea se carga con un corto circuito. Suponiendo
  8. %que la permitividad relativa del aislante del coaxial es 1.75. De los dos
  9. %"stubs" posibles, cuál recomendaría teniendo en cuenta que el enlace se    
  10. %realiza con un pequeño ancho de banda alrededor de la frecuencia de
  11. %operación. Entregue la profundidad del stub recomendado en centímetros.
  12. clc
  13. clear all
  14. close all
  15. % calculo de las posibles dimensiones del stub
  16. %%
  17. a = 23.586e-3;
  18. b = 11.792e-3;
  19. e_r = 1;
  20. f_g = mean([0.6360e10,1.2719e10])
  21. BW = [f_g - 0.05*f_g,f_g + 0.05*f_g];
  22. %Z_l = 120-80i;
  23.  
  24. v = 3e8;
  25. f_g = mean(BW);
  26. f_c_mn = @(v,m,n,a,b) (v/2).*sqrt((m./a).^2+(n./b).^2);
  27. Z_TM = @(fcmn,f) 120*pi.*sqrt(1-(fcmn./f).^2);
  28. Z_TE = @(fcmn,f) 120*pi./sqrt(1-(fcmn./f).^2);
  29. n_modes = 100;
  30. f_cut = zeros(n_modes*n_modes,3);
  31. k = 1;
  32. f_cut_4_f_g = [0,0,0];
  33. for m = 0:n_modes
  34.     for n = 0:n_modes
  35.         f_cut(k,1) = f_c_mn(v,m,n,a,b);
  36.         f_cut(k,2) = m;
  37.         f_cut(k,3) = n;
  38.         if(f_cut(k,1) > f_cut_4_f_g(1) && f_cut(k,1) < f_g)
  39.             f_cut_4_f_g = [f_cut(k,1),m,n];
  40.         end
  41.         k = k +1;
  42.     end
  43. end
  44. f_cut = f_cut(find(f_cut(:,1) <= f_g),:);
  45. f_cut = sortrows(f_cut,1);
  46. %f_cut_4_f_g(1) = 2.08;
  47. beta_mn = @(v,f,f_c) (2*pi./v)*sqrt(f.^2-f_c.^2);
  48. beta = beta_mn(v,f_g,f_cut_4_f_g(1));
  49. Z_0_TE_mn = Z_TE(f_cut_4_f_g(1), f_g);
  50. Z_0_TM_mn = Z_TM(f_cut_4_f_g(1), f_g);
  51. Z_0 = Z_0_TE_mn;
  52.  
  53. SWR = 7.02;
  54. e_r = 1;
  55. v_p = v/sqrt(e_r);
  56. %lambda = v_p/f_g;
  57. %dmin = lambda/2;
  58. lambda = 2*pi/beta;
  59. dmin = lambda/2;
  60. mov = 0.97e-2;
  61. prop = mov/dmin;
  62. first_min = -(2*dmin-mov);
  63. %beta = 2*pi/lambda;
  64. psi = pi - 2*beta*first_min;
  65. rho_l = ((SWR-1)/(SWR+1))*exp(1i*psi);
  66. Z_l = Z_0*((1+rho_l)/(1-rho_l));
  67.  
  68.  
  69.  
  70. %%
  71. Z_0 = Z_0_TE_mn;
  72. rho_l = (Z_l-Z_0)/(Z_l-Z_0);
  73. para_stub = para_coupling(1/Z_0,1/Z_l,beta);
  74. check1 = 1/(1/(impedancia(Z_0,Z_l,1i*beta,-para_stub(1,1)))...
  75.                     +1/(impedancia(Z_0,0,1i*beta,-para_stub(1,2))))
  76. series_stub = series_coupling(Z_0,Z_l,beta);
  77. check2 =impedancia(Z_0,Z_l,1i*beta,-series_stub(1,1))...
  78.                     +(impedancia(Z_0,0,1i*beta,-series_stub(1,2)))
  79.                
  80. check3 = 1/(1/(impedancia(Z_0,Z_l,1i*beta,-para_stub(2,1)))...
  81.                     +1/(impedancia(Z_0,0,1i*beta,-para_stub(2   ,2))))
  82. series_stub = series_coupling(Z_0,Z_l,beta);
  83. check4 =impedancia(Z_0,Z_l,1i*beta,-series_stub(2,1))....
  84.                     +(impedancia(Z_0,0,1i*beta,-series_stub(2,2)))
  85. %end ----- calculo de las posibles dimensiones del stub
  86.  
  87. % calculo del SWR para los otros valores de la banda de trabajo
  88. freq = BW(1):(BW(2)-BW(1))/100:BW(2);
  89. beta = beta_mn(v,freq,f_cut_4_f_g(1));
  90. SWR_f = @(rho_l) (1+abs(rho_l))./(1-abs(rho_l));
  91. rho_f = @(Z_z,Z_0) ((Z_z-Z_0)./(Z_z+Z_0));
  92. %analisis paralelo
  93. Z_0 = Z_TE(f_cut_4_f_g(1), freq);
  94. rho_l = (Z_l-Z_0)./(Z_l-Z_0);
  95. Z_coupling_1 = 1./(1./(line_impedance(Z_0,Z_l,1i*beta,-para_stub(1,1)))...
  96.                     +1./(line_impedance(Z_0,0,1i*beta,-para_stub(1,2))));
  97. SWR_1 = SWR_f(rho_f(Z_coupling_1,Z_0));
  98. Z_coupling_2 = 1./(1./(line_impedance(Z_0,Z_l,1i*beta,-para_stub(2,1)))...
  99.                     +1./(line_impedance(Z_0,0,1i*beta,-para_stub(2,2))));
  100. SWR_2 = SWR_f(rho_f(Z_coupling_2,Z_0));
  101.  
  102. %analisis serie
  103.  
  104. Z_coupling_3 = line_impedance(Z_0,Z_l,1i*beta,-series_stub(1,1))...
  105.                             +(line_impedance(Z_0,0,1i*beta,-series_stub(1,2)));
  106. SWR_3 = SWR_f(rho_f(Z_coupling_3,Z_0));
  107. Z_coupling_4 = line_impedance(Z_0,Z_l,1i*beta,-series_stub(2,1))...
  108.                             +(line_impedance(Z_0,0,1i*beta,-series_stub(2,2)));
  109. SWR_4 = SWR_f(rho_f(Z_coupling_4,Z_0));
  110. sel_mat_1 = [[mean(SWR_1.^2),para_stub(1,1),para_stub(1,2),0];
  111.              [mean(SWR_2.^2),para_stub(2,1),para_stub(2,2),0];
  112.              [mean(SWR_3.^2),series_stub(1,1),series_stub(1,2),1];
  113.              [mean(SWR_4.^2),series_stub(2,1),series_stub(2,2),1];]
  114. sel_mat_1 = sortrows(sel_mat_1,1);
  115.  
  116.  
  117. sel_mat_2 = [[mean(SWR_1([1,end])),para_stub(1,1),para_stub(1,2),0];
  118.              [mean(SWR_1([1,end])),para_stub(2,1),para_stub(2,2),0];
  119.              [mean(SWR_1([1,end])),series_stub(1,1),series_stub(1,2),1];
  120.              [mean(SWR_1([1,end])),series_stub(2,1),series_stub(2,2),1];]
  121. sel_mat_2 = sortrows(sel_mat_1,1);
  122.  
  123. figure(1)
  124. plot(freq*1e-9,SWR_1,'r') %paralelo
  125. hold on
  126. plot(freq*1e-9,SWR_2,'g') %paralelo
  127. hold on
  128. plot(freq*1e-9,SWR_3,'b') %serie
  129. hold on
  130. plot(freq*1e-9,SWR_4,'k') %serie
  131. hold on
  132. legend(['paralelo l_s = ',num2str(para_stub(1,1)),'[m] p_s = ',...
  133.         num2str(para_stub(1,2)),'[m]'],...
  134.         ['paralelo l_s = ',num2str(para_stub(2,1)),'[m] p_s = ',...
  135.         num2str(para_stub(2,2)),'[m]'],...
  136.         ['serie l_s = ', num2str(series_stub(1,1)),'[m] p_s = ',...
  137.         num2str(series_stub(1,2)),'[m]'],...
  138.         ['serie l_s = ', num2str(series_stub(2,1)),'[m] p_s = ',...
  139.         num2str(series_stub(2,2)),'[m]']);
  140. title('SWR(f)')
  141. xlabel('Frecuencia [GHz]');
  142.  
  143. rho_l_abs_1 = ((SWR_1-1)./(SWR_1+1));
  144. rho_l_abs_2 = ((SWR_2-1)./(SWR_2+1));
  145. rho_l_abs_3 = ((SWR_3-1)./(SWR_3+1));
  146. rho_l_abs_4 = ((SWR_4-1)./(SWR_4+1));
  147.  
  148. CLdB_1 = 10*log10(1-rho_l_abs_1.^2);
  149. CLdB_2 = 10*log10(1-rho_l_abs_2.^2);
  150. CLdB_3 = 10*log10(1-rho_l_abs_3.^2);
  151. CLdB_4 = 10*log10(1-rho_l_abs_4.^2);
  152. figure(2)
  153. semilogx(freq*1e-9,CLdB_1,'r') %paralelo
  154. hold on
  155. semilogx(freq*1e-9,CLdB_2,'g') %paralelo
  156. hold on
  157. semilogx(freq*1e-9,CLdB_3,'b') %serie
  158. hold on
  159. semilogx(freq*1e-9,CLdB_4,'k') %serie
  160. hold on
  161. legend(['paralelo l_s = ',num2str(para_stub(1,1)),'[m] p_s = ',...
  162.         num2str(para_stub(1,2)),'[m]'],...
  163.         ['paralelo l_s = ',num2str(para_stub(2,1)),'[m] p_s = ',...
  164.         num2str(para_stub(2,2)),'[m]'],...
  165.         ['serie l_s = ', num2str(series_stub(1,1)),'[m] p_s = ',...
  166.         num2str(series_stub(1,2)),'[m]'],...
  167.         ['serie l_s = ', num2str(series_stub(2,1)),'[m] p_s = ',...
  168.         num2str(series_stub(2,2)),'[m]']);
  169. title('CL[dB](f)')
  170. xlabel('Frecuencia [GHz]');
  171. ylabel('CL[dB]')
  172.  
  173. RL_dB_1 = 20*log10(rho_l_abs_1);
  174. RL_dB_2 = 20*log10(rho_l_abs_2);
  175. RL_dB_3 = 20*log10(rho_l_abs_3);
  176. RL_dB_4 = 20*log10(rho_l_abs_4);
  177. figure(3)
  178. semilogx(freq*1e-9,RL_dB_1,'r') %paralelo
  179. hold on
  180. semilogx(freq*1e-9,RL_dB_2,'g') %paralelo
  181. hold on
  182. semilogx(freq*1e-9,RL_dB_3,'b') %serie
  183. hold on
  184. semilogx(freq*1e-9,RL_dB_4,'k') %serie
  185. hold on
  186. legend(['paralelo l_s = ',num2str(para_stub(1,1)),'[m] p_s = ',...
  187.         num2str(para_stub(1,2)),'[m]'],...
  188.         ['paralelo l_s = ',num2str(para_stub(2,1)),'[m] p_s = ',...
  189.         num2str(para_stub(2,2)),'[m]'],...
  190.         ['serie l_s = ', num2str(series_stub(1,1)),'[m] p_s = ',...
  191.         num2str(series_stub(1,2)),'[m]'],...
  192.         ['serie l_s = ', num2str(series_stub(2,1)),'[m] p_s = ',...
  193.         num2str(series_stub(2,2)),'[m]']);
  194. title('RL[dB](f)')
  195. xlabel('Frecuencia [GHz]');
  196. ylabel('CL[dB]')
Add Comment
Please, Sign In to add comment