function u=MAFC()
ts=1:1:3000;
yd=pi/9*sin(pi/180*ts);u=zeros(1,3000);y=zeros(1,3000);
fi=ones(1,3000);t=0;
for i=2:2999
y(i)=(u(i-1)+60*y(i-1))/61;
if t==0
fi(i)=fi(i-1);
else
fi(i)=fi(i-1)+0.00005*(u(i-1)-u(i-2))*(yd(i+1)-y(i)-fi(i-1)*(u(i-1)-u(i-2)))/(1+(u(i-1)-u(i-2))^2);
end
u(i)=u(i-1)+0.8*fi(i)*(yd(i+1)-y(i))/(0.005+fi(i)^2);
t=t+1;
end
plot(yd)
hold on
plot(y,'r')
评论6