相关代码 |
|
clear; clc; error_1=0;%e(k-1)=0 error_2=0; u_1=0; %u(k-1)=0 u_2=0; %u(k-2)=0 u_3=0; %u(k-3)=0 y_1=0; %y(k-1)=0 for k=1:25 y(1)=0; r(k)=1; error(k)=r(k)-y(k); u(k)=0.607*u_1+0.393*u_3+0.622*error(k)-1.368*0.622*error_1+0.368*0.622*error_2; y(k+1)=1.368*y(k)-0.368*y_1+0.368*u_2+0.368*0.718*u_3; y_1=y(k); error_1=error(k); u_2=u_1; u_1=u(k); end plot(y);
相关资源 |
|