HW7 Solution

P 8.27
%P8.27
%Bode plots
K=0.75
p=K*[1 50]; q=[1 10 25]; sys=tf(p,q);
bode(sys)
grid on
%Bandwith for K
wn=sqrt(50*K+25);
damping=(10+K)/(2*wn);
wb=wn*(-1.1961*damping+1.8508)
Script run
K=
0.7500
wb =
8.2028
Bode Diagram
Magnitude (dB)
20
0
ï20
System: sys
Frequency (rad/sec): 3.42
Magnitude (dB): 0.207
ï40
ï60
Phase (deg)
ï80
0
ï45
ï90
ï135
ï1
10
0
10
1
10
Frequency (rad/sec)
Figure P8.27 K=0.75
2
10
3
10
Bode Diagram
Magnitude (dB)
20
0
ï20
ï40
Phase (deg)
ï60
0
ï45
ï90
ï135
ï1
10
0
10
1
10
Frequency (rad/sec)
Figure P8.27 K=1
2
10
3
10
Bode Diagram
Magnitude (dB)
40
20
0
ï20
Phase (deg)
ï40
0
ï45
ï90
ï135
ï1
10
0
10
1
10
Frequency (rad/sec)
2
3
10
10
Figure P8.27 K=10
K
L Gain at w=0 db
wb rad/s
wc rad/s
0.75
3.52
8.20
3.42
1
6.02
9.4
5.48
10
26
30.44
22.5
AP8.5
%AP8.5
%Log-magnitude-phase curve
phase=[101.42 250.17 267.53 268.93 269.77];
magnitude=[40 4.85 -13.33 -20.61 -33.94];
plot(phase,magnitude)
xlabel('phase, degree')
ylabel('Magnitude GcG, db')
grid on
40
30
Magnitude GcG, db
20
10
0
ï10
ï20
ï30
ï40
100
120
140
160
180
200
phase, degree
220
240
260
280
Figure AP8.5
By checking the poles, we can conclude that the open-loop system is unstable and that the
closed-loop system is stable.
DP8.6
%DP8.6
syms
A=[0
B=[K
C=[0
s K p
1; -1 -p]
;0]
1]
% closed-loop transfer function
C*inv(s*eye(2)-A)*B
%Bode plot
p=-1; q=[1 1.38 1]; sys=tf(p,q);
bode(sys)
grid on
Script run
A=
[ 0, 1]
[ -1, -p]
B=
K
0
C=
0 1
ans =
-K/(s^2 + p*s + 1)
Using the transfer function from the Matlab script, we determined that the steady error is
zero for K=-1. For a percent overshoot of 5%, the damping ratio is 0.69 and so p is
determined to be 1.38. The natural frequency is wn=1rad/s.
Using the approximation wb=(-1.19*ζ+1.85)*wn=1.028rad/s.
The Bode plot is shown on Figure DP86. The bandwidth is wb=1.02rad/s.
Bode Diagram
20
10
System: sys
Frequency (rad/sec): 1.02
Magnitude (dB): ï3.01
0
Magnitude (dB)
ï10
ï20
ï30
ï40
ï50
ï60
ï70
ï80
180
Phase (deg)
135
90
45
0
ï2
10
ï1
10
0
10
Frequency (rad/sec)
Figure DP86
1
10
2
10
CP8.3
%CP8.3
%Bode plot a)
p=2000; q=[1 110 1000]; sys=tf(p,q);
figure (1)
clf;
bode(sys)
grid on
%Bode plot b)
p=100; q=[1 11 12 2]; sys=tf(p,q);
figure (2)
clf;
bode(sys)
grid on
%Bode plot c)
p=[50 5000]; q=[1 51 50]; sys=tf(p,q);
figure (3)
clf;
bode(sys)
grid on
%Bode plot b)
p=100*[1 14 50]; q=[1 503 1502 1000]; sys=tf(p,q);
figure (4)
clf;
bode(sys)
grid on
Bode Diagram
20
Magnitude (dB)
0
ï20
ï40
ï60
ï80
Phase (deg)
ï100
0
ï45
ï90
ï135
ï180
ï1
10
0
10
1
2
10
10
Frequency (rad/sec)
3
10
Figure CP83 a) the crossover frequency is 17.1rad/sec
4
10
Bode Diagram
Magnitude (dB)
50
0
ï50
ï100
ï150
0
Phase (deg)
ï45
ï90
ï135
ï180
ï225
ï270
ï3
10
ï2
10
ï1
10
0
1
10
10
Frequency (rad/sec)
Figure CP83 b) the crossover frequency is 3rad/sec
2
10
3
10
Bode Diagram
Magnitude (dB)
40
20
0
ï20
Phase (deg)
ï40
0
ï45
ï90
ï135
ï2
10
ï1
10
0
1
10
10
Frequency (rad/sec)
2
10
Figure CP83 c) the crossover frequency is 70.7rad/sec
3
10
Bode Diagram
20
Magnitude (dB)
10
0
ï10
ï20
ï30
Phase (deg)
ï40
0
ï45
ï90
ï2
10
ï1
10
0
10
1
2
10
10
Frequency (rad/sec)
Figure CP83 d) the crossover frequency is 3.2rad/sec
3
10
4
10