P 13.

4-1
( )

(

)

%------------------------------------wmin=1;
wmax=100000;
w = logspace(log10(wmin),log10(wmax));
%------------------------------------K = 2;
z = 20;
p1 = 500;% p2 = 20; p3 = 80;
%-------------------------------------for k=1: length(w)
H(k)=K*(1+j*w(k)/z)/((1+j*w(k)/p1));
mag(k) = abs(H(k));
phase(k) = angle(H(k));
end
%-------------------------------------subplot(2,1,1), semilogx(w/(2*pi),20*log10(mag))
xlabel('Frequency, Hz'), ylabel('Gain, dB')
grid on;
title('Bode plot')
subplot(2,1,2), semilogx(w/(2*pi),phase)
xlabel('Frequency, Hz'), ylabel('Phase, deg')
grid on;

4-2 ( ) %------------------------------------wmin=1. Hz'). wmax=100000.phase) xlabel('Frequency.2). title('Bode plot') subplot(2. phase(k) = angle(H(k)).1.log10(wmax)). mag(k) = abs(H(k)).P 13.1). p1 = 50. ylabel('Phase. deg') grid on. semilogx(w/(2*pi). w = logspace(log10(wmin). semilogx(w/(2*pi).1. %-------------------------------------for k=1: length(w) H(k)=K*(1+j*w(k)/z1)/((1+j*w(k)/p1)). p3 = 80. z1 = 5. ylabel('Gain.20*log10(mag)) xlabel('Frequency. %------------------------------------K = 1. end %-------------------------------------subplot(2. dB') grid on. .% p2 = 20. Hz').

20*log10(mag)) xlabel('Frequency. wmax=100000. Hz'). dB') grid on.( ) ( ) %------------------------------------wmin=1.1. Hz'). %------------------------------------K = 20.% p2 = 20. p3 = 80. ylabel('Gain.phase) xlabel('Frequency. p1 = 50.2).1).1. semilogx(w/(2*pi). phase(k) = angle(H(k)). semilogx(w/(2*pi). z1 = 5. title('Bode plot') subplot(2. %-------------------------------------for k=1: length(w) H(k)=K*(1+j*w(k)/z1)/((1+j*w(k)/p1)). . mag(k) = abs(H(k)). deg') grid on.log10(wmax)). ylabel('Phase. end %-------------------------------------subplot(2. w = logspace(log10(wmin).

5. p1 = 50. semilogx(w/(2*pi). deg') grid on. .1.1). ylabel('Gain. %-------------------------------------for k=1: length(w) H(k)=K*(1+j*w(k)/z1)/(((1+j*w(k)/p1)*(1+j*w(k)/p2))). Hz'). wmax=100000. dB') grid on. p2 = 20. phase(k) = angle(H(k)).P 13.2). title('Bode plot') subplot(2. z1 = 5.log10(wmax)).4-3 ( ) ( ( )( ) ) %------------------------------------wmin=1. %------------------------------------K = 0. w = logspace(log10(wmin).20*log10(mag)) xlabel('Frequency. ylabel('Phase. semilogx(w/(2*pi). mag(k) = abs(H(k)). Hz').phase) xlabel('Frequency. end %-------------------------------------subplot(2.1.

2). ylabel('Gain. title('Bode plot') subplot(2.1. mag(k) = abs(H(k)). w = logspace(log10(wmin). deg') grid on.log10(wmax)). semilogx(w/(2*pi).2.P 13. p1 = 25.1. semilogx(w/(2*pi).4-7 ( ) ( ) %------------------------------------wmin=1. phase(k) = angle(H(k)). Hz'). ylabel('Phase. Hz'). %-------------------------------------for k=1: length(w) H(k)=K*(1+j*w(k)/z1)/(((1+j*w(k)/p1))).1).20*log10(mag)) xlabel('Frequency. end %-------------------------------------subplot(2. . z1 = 5. dB') grid on. wmax=100000.phase) xlabel('Frequency. %------------------------------------K = 0.

%------------------------------------K = 2.20*log10(mag)) xlabel('Frequency. ylabel('Gain. phase(k) = angle(H(k)). semilogx(w/(2*pi).P 13. mag(k) = abs(H(k)). title('Bode plot') subplot(2. z = 200.1).log10(wmax)). semilogx(w/(2*pi). ) . Hz'). end %-------------------------------------subplot(2.1. wmax=100000. ylabel('Phase.4-13 ( ) ( %------------------------------------wmin=1. Hz'). deg') grid on.phase) xlabel('Frequency. p1 = 500. w = logspace(log10(wmin). dB') grid on.1.2). %-------------------------------------for k=1: length(w) H(k)=K*(1+j*w(k)/z)/((1+j*w(k)/p1)).

Sign up to vote on this title
UsefulNot useful