问题简述:要画bode图的传递函数由不同的多项式G1、G2、G3表示,-G2/(G1*s^2+G2),但是一直出错
代码如下:
% 参数设置
f_w0 = 500*1;
f_wc = 50*1;
w0 = f_w0 * 2 * pi;
wc = f_wc * 2 *pi;
b0=3*w0;
b1=3*w0*w0;
b2=w0*w0*w0;
kp=wc*wc;
kd=2*wc;
Td=0.005;
r=0.5;
% 传递函数
lamda=[1 b0 b1 b2];
s=tf('s');
G1=s^3+(b0+kd)*s^2+(b1+kd*b0+kp)*s;
G2=(kp+s*kd)*lamda-(kd*s^4+(kd*b0+kp)*s^3-b2*s^2);
G3=lamda*kp;
ntf=-G2/(G1*s^2+G2);
bode(ntf)
运行之后,在‘ntf=-G2/(G1*s^2+G2);’这一句出现‘错误使用 / (line 65) In "SYS1/SYS2", the model SYS2 must have the same number of inputs as outputs.’
这种情况有人遇见过吗?求解答,或者有没有其他可以实现复杂传函求bode图的方法??

 Réponse acceptée

0 votes

对啊!!!
matlab中就没有这种写法,所以叫你看看bode函数的帮助文档啊,你就知道想要画bode图该怎么写了

Plus de réponses (0)

Catégories

En savoir plus sur System Identification Toolbox dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!