UtamaDonny

BodePlot_simbolik

Jun 5th, 2020
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. syms s
  2. Gs=80/(s^2*(1000*s+40));
  3. x=logspace(-2,2);
  4. xv=x';
  5. GsF=vpa(subs(Gs,s,x*1i),3);
  6. GsFAbs=abs(GsF);
  7. GsFMag=20*log10(GsFAbs);
  8. figure(1);
  9. subplot(2,1,1);
  10. semilogx(x,GsFMag);xlabel('Frequency(rad/sec)');ylabel('Magnitude(dB)');title("Frequency response for "+string(Gs))
  11. set(gca,'XLim',[0 max(x)]);
  12. subplot(2,1,2);
  13. GsFPh=angle(GsF)*180/pi;
  14. semilogx(x,GsFPh);xlabel('Frequency(rad/sec)');ylabel('Phase(deg)');
  15. set(gca,'XLim',[0 max(x)]);
RAW Paste Data