%求方程的解
x=sym(\'x\');
fx=(3*x*x+2*x)*(x*x+2.32*x+4)-(2*x+2.32)*(x*x*x+x*x)
expand(fx)
den=[1 116/25 358/25 8];
roots(den)
%绘制根轨迹图
num=[1 1 0 0];
den=[1 2.32 4];
s1=tf(num,den)%多项式相除,得分式
rlocus(s1)
%绘制根轨迹图
num=1;
den=conv([1 1],[1 6 10])%展开多项式
s1=tf(num,den)
rlocus(s1)
%绘制伯德图,求相角裕度、增益裕度
num=1;
den=conv([1 1],conv([0.8 1],[0.2 1]));
s1=tf(num,den);
bode(s1)
hold on
margin(s1)
hold off
%反馈校正
num=100;
den=conv([1 0],conv([0.1 1],[0.0067 1]));
s1=tf(num,den)
hold on;
num1=0.0167*[1 0 0];
den1=[0.2 1];
s2=tf(num1,den1)
s0=feedback(s1,s2)
bode(s0)
%非最小相位系统
close all
num=[1 1];
den=[2 1];
s1=tf(num,den)
bode(s1)
hold on;
num=-[1 -1];
den=[2 1];
s1=tf(num,den)
bode(s1)
hold off
%根轨迹&阶跃响应
num=[1 1];
den=conv([1 0],[1 -3]);
s1=tf(num,den);
rlocus(s1)
num=9*[1 1];
den=conv([1 0],[1 -3]);
s1=tf(num,den);
H=1;
cloop=feedback(s1,H);
step(cloop)
%滞后系统根轨迹
num=1;
den=[1 1];
s1=tf(num,den)
[num1,den1]=pade(1,10);
sdelay=tf(num1,den1);
s2=s1*sdelay;
rlocus(s2);
%单位脉冲响应
close all
num=25;
den=[1 4 25];
s1=tf(num,den);
step(s1)
hold on
impulse(s1)
hold off
legend({\'step\',\'impulse\'});
%求截止频率
num=100*[0.25 1];
den1=conv([1 0 0],[0.005 1]);
s1=tf(num,den1);
bode(s1)
[mag,phase,w]=bode(s1);
[l,c]=size(mag);
mag1=zeros(c,1);
for i=1:c
mag1(i)=20*log10(mag(1,1,i));
end
wc=interp1(mag1,w,0,\'spline\')
请发表评论