Ts15 = K / (0.5 * s + 1); Ys15 = Ts15 / s; yt15 = ilaplace(Ys15); yt15 = subs(yt15);
Ts1 = K / (1 * s + 1); Ys1 = Ts1 / s; yt1 = ilaplace(Ys1); yt1 = subs(yt1);
fori = 1:length(t)-1 if( (double(yt125(i))<=0.98) && (double(yt125(i+1))>=0.98)) ts125 = i/100 end if( (double(yt15(i))<=0.98) && (double(yt15(i+1))>=0.98)) ts15 = i/100 end if( (double(yt1(i))<=0.98) && (double(yt1(i+1))>=0.98)) ts1 = i/100 end end
figure(1) subplot(3,1,1) plot(t,yt125) title('一阶系统的阶跃响应曲线 - T = 0.25') ylabel('y(t)'); xlabel('t'); grid on axis([0401.5]); hold on subplot(3,1,2) plot(t,yt15) title('一阶系统的阶跃响应曲线 - T = 0.5') ylabel('y(t)'); xlabel('t'); grid on axis([0401.5]); hold on subplot(3,1,3) plot(t,yt1) title('一阶系统的阶跃响应曲线 - T = 1.0') ylabel('y(t)'); xlabel('t'); grid on axis([0401.5]); hold on
figure(2) subplot(4,1,1) plot(t,yt225) title('二阶系统的阶跃响应曲线 - ξ = 0.25') ylabel('y(t)'); xlabel('t'); grid on axis([02001.5]); hold on subplot(4,1,2) plot(t,yt25) title('二阶系统的阶跃响应曲线 - ξ = 0.5') ylabel('y(t)'); xlabel('t'); grid on axis([02001.5]); hold on subplot(4,1,3) plot(t,yt27) title('二阶系统的阶跃响应曲线 - ξ = 0.707') ylabel('y(t)'); xlabel('t'); grid on axis([02001.5]); hold on subplot(4,1,4) plot(t,yt2) title('二阶系统的阶跃响应曲线 - ξ = 1.0') ylabel('y(t)'); xlabel('t'); grid on axis([02001.5]); hold on