Advertisement
Ostu

Untitled

Mar 26th, 2021
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.12 KB | None | 0 0
  1. s=tf('s')
  2. wfal=8;
  3. for n=2:10
  4. e=sqrt(10^(wfal/10)-1);
  5. u=(1/n)*asinh(1/e) ;
  6. omc=1/(cosh(1/n*acosh(sqrt((2*e^2+1)/e^2))));
  7. if mod(n,2)==0
  8.     F=1;
  9.     for k=1:(n/2)  
  10.     alp=((2*k-1)/(2*n))*pi;
  11.     B=1/(cosh(u)^2-cos(alp)^2);
  12.     A=2*B*sinh(u)*cos(alp);
  13.     a=A/omc;
  14.     b=B/(omc.^2);
  15.     L=1;
  16.     M=[b a 1]
  17.     h=tf(L,M)
  18.     F=F*h
  19.     end
  20.     H(n)=F
  21. else
  22.     F= 1/(1/sinh(u)/omc*s +1)
  23.     for k=2:((n+1)/2)
  24.         bet=((k-1)/n)*pi;
  25.         B=1/(cosh(u)^2-cos(bet)^2)
  26.         A=2*B*sinh(u)*cos(bet)
  27.         a=A/omc
  28.         b=B/(omc.^2)
  29.         L=1;
  30.         M=[b a 1]
  31.         h=tf(L,M)
  32.         F=F*h
  33.     end
  34.     H(n)=F
  35.     end
  36. end
  37. %% BODE
  38. figure(1)
  39. bode(H(2),H(3),H(4),H(5),H(6),H(7),H(8),H(9),H(10))
  40. legend('n=2','n=3','n=4','n=5','n=6','n=7','n=8','n=9','n=10')
  41. %% JEDNOSTKOWY
  42. figure(2)
  43. step(H(2),H(3),H(4),H(5),H(6),H(7),H(8),H(9),H(10))
  44. legend('n=2','n=3','n=4','n=5','n=6','n=7','n=8','n=9','n=10')
  45. %% BIEGUNY
  46. figure(3)
  47. pzmap(H(2),H(4),H(6),H(8),H(10))
  48. legend('n=2','n=4','n=6','n=8','n=10')
  49. figure(4)
  50. pzplot(H(3),H(5),H(7),H(9))
  51. legend('n=3','n=5','n=7','n=9')
  52. xlim([-1.2 0.1])
  53. ylim([-1.1 1.1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement