实验四 应用Matlab研究频率特性
一、实验目的
1.学会用Matlab工具分析系统的频率特性
2.学会频率发分析系统的稳定性
二、实验内容
1.单位负反馈系统开环传递函数如下,针对每个系统分别取两个不同的K值绘制Nyquist和Bode图(同一个系统的图绘在一个坐标系内)。
取K=1和K=10
2.求第1题中各传函的增益裕度和相位裕度。
3. 用Nyquist判据判定1题中各系统的稳定性。
每一棵草都会开花(1)
num1=[0 0 1];
den1=conv([0 1 1],conv([0 2 1],[0 10 1]));
G1=tf(num1,den1);
num2=[0 0 5];
den2=conv([0 1 1],conv([0 2 1],[0 10 1]));
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm = 19.8024
Pm = -180
Wcg = 0.8063
Wcp = 0
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm = 3.9605
Pm = 49.0377
Wcg = 0.8063
Wcp =0.3656
Nyquist判据:
系统是稳定的。
(2)
num1=[0 0 1];
den1=conv([0 1 0],conv([0 1 1],[0 2 1]));
G1=tf(num1,den1);
num2=[0 0 5];
den2=conv([0 1 0],conv([0 1 1],[0 2 1]));
G2=tf(num2,den2);
春天的味道subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =1.5000
Pm = 11.4304
Wcg = 0.7071
Wcp =0.5715
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =0.3000
Pm = -28.0814
广西旅游景点大全Wcg =0.7071
Wcp = 1.2126
Nyquist判据:
系统是稳定的。
(3)
num1=[0 0 1];
den1=conv([1 0 0],[0 1 1]);
G1=tf(num1,den1);
num2=[0 0 5];
den2=conv([1 0 0],[0 1 1]);
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm = Inf
Pm = -40.9750
Wcg = NaN
Wcp =0.8685
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =Inf
Pm =-58.3182
Wcg =NaN
Wcp = 1.6203
Nyquist判据:
系统是不稳定的。
(4)
num1=conv([0 0 1],[0 1 1]);
den1=conv([1 0 0],[0 2 1]);
G1=tf(num1,den1);
num2= conv([0 0 5],[0 1 1]);
den2=conv([1 0 0],[0 2 1]);
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =Inf
Pm =-19.2738
Wcg =Inf
Wcp =0.8205
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =Inf
Pm =-14.2414
Wcg =Inf
Wcp =1.6707
黄色美甲
Nyquist判据:
系统是不稳定的。
(5)
num1=[0 0 0 1];
den1=[1 0 0 0];
G1=tf(num1,den1);
num2=[0 0 0 5];
den2=[1 0 0 0];
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =Inf
Pm = -90.0000
Wcg = NaN
Wcp =1
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =Inf
Pm =-90.0000
Wcg =NaN
Wcp =1.7100
Nyquist判据:
我的什么故事
系统是不稳定的。
(6)
num1=conv([0 0 1],conv([0 1 1],[0 2 1]));
den1=[1 0 0 0];
G1=tf(num1,den1);
num2=conv([0 0 5],conv([0 1 1],[0 2 1]));
den2=[1 0 0 0];
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度刘涛演过的电视剧
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =0.1667
Pm =53.4109
Wcg =0.7071
Wcp =2.2434
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =0.0333
Pm =81.4814
Wcg =0.7071
Wcp =10.0641
Nyquist判据:
系统是稳定的。
(7)
num1=conv([0 0 1],conv([0 5 1],[0 15 1]));
den1=conv([0 1 0],conv([0 1 1],conv([0 2 1],conv([0 10 1],[0 20 1]))));
编花篮儿歌
G1=tf(num1,den1);
num2=conv([0 0 5],conv([0 5 1],[0 15 1]));
den2=conv([0 1 0],conv([0 1 1],conv([0 2 1],conv([0 10 1],[0 20 1]))));
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =2.5940
Pm =20.8239
Wcg =0.5770
Wcp = 0.3334
[Gm,Pm,Wcg,Wcp]=margin(G2)
Warning: The clod-loop system is unstable.
Gm =0.5188
Pm =-14.6107
Wcg =0.5770
Wcp =0.7975
Nyquist判据:
系统是不稳定的。
(8)
num1=[0 0 1];
den1=[0 1 -1];
G1=tf(num1,den1);
num2=[0 0 5];
den2=[0 1 -1];
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Warning: The clod-loop system is unstable.
Gm =1
Pm =0
Wcg =0
Wcp =0
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =0.2000
Pm =78.4630
Wcg =0
Wcp =4.8990
Nyquist判据:
系统是稳定的。
(9)
num1=[0 0 -1];
den1=[0 -1 1];
G1=tf(num1,den1);
num2=[0 0 -5];
den2=[0 -1 1];
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Warning: The clod-loop system is unstable.
Gm =1
Pm =0
Wcg =0
Wcp =0
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =0.2000
Pm =78.4630
Wcg =0自考网站官网
Wcp = 4.8990
Nyquist判据:
系统是稳定的。
(10)
num1=[0 0 1];
den1=conv([0 1 0],[0 1 1]);
G1=tf(num1,den1);
num2=[0 0 5];
den2=conv([0 1 0],[0 1 1]);
G2=tf(num2,den2);
subplot(121)
Nyquist(G1,G2)
subplot(122)
Bode(G1,G2)
求得增益裕度和相位裕度
[Gm,Pm,Wcg,Wcp]=margin(G1)
Gm =Inf
Pm =51.8273
Wcg =Inf
Wcp =0.7862
[Gm,Pm,Wcg,Wcp]=margin(G2)
Gm =Inf
Pm =25.1801
Wcg =Inf
Wcp =2.1270
Nyquist判据:
系统是不稳定的。
4. 单位负反馈系统开环传递函数
(1)当K=4,计算系统的增益裕度,并通过MATLAB验证;
(2)如果希望增益裕度为16dB,求出对应的K值,并通过MATLAB验证。
解:
(1)计算:由,h=-20lg(A(w))=-L(w)dB代入.
当k=4时系统的增益裕度为Gm=1.5
Matlab验证:
num=[0 0 4];
den=conv([0 1 0],conv([0 1 1],[0 1 2]));
G=tf(num,den);
[Gm,Pm,Wcg,Wcp]=margin(G)
Gm =1.5000
Pm =1.4304
Wcg =1.4142
Wcp =1.1431
(2) 若增益裕度为16dB, 由h=-20lg(A(w))=-L(w)dB得出k=0.375