xi = [0 0.2 0.4 0.6 0.8 1.0 2.0 3.0]; wn = sqrt(1); num = wn^2; den = [1 2*xi*wn wn^2]; t = 0:0.01:10; sys = tf(num,den); for i = 1:length(xi) den = [1 2*xi(i)*wn wn^2]; sys = tf(num,den); [y,t] = step(sys,t); overshot = max(y)-1; [p,t_p] = max(y); t_p = t(t_p); t_s = 4/(xi(i)*wn); if xi(i) == 1 t_s = 3/(xi(i)*wn); end完善剩下的代码
时间: 2023-06-10 18:06:19 浏览: 217
ax*x+bx + c = 0
disp(['xi = ', num2str(xi(i))]); disp(['Overshoot = ', num2str(overshot)]); disp(['Peak time = ', num2str(t_p)]); disp(['Settling time = ', num2str(t_s)]); end
阅读全文