我把code发出来,请大家帮我看看!
clc
clear all
T =[0.9999 0.0250 0.0002;
-0.0125 0.9995 0.0125;
-0.9997 0.9875 -0.0004];
L = [0.0001 0.0125 0.9997]';
Phi(1)=0; Phi1(1)=0; Phi2(1)=0; Y(:,1)=[Phi(1) Phi1(1) Phi2(1)]';
e=0.0001;i=1;k=1; t=0.25;
Eta(1)=sin(t)+Phi(1)+Phi(1)^3+Phi2(1)+Phi2(1)^3;
Phi(2)=T(1,:) *[Phi(1),Phi1(1),Phi2(1)]'+L(1,:)*Eta(1);
S1=(Phi(2)-Phi(1))^2;
S2=Phi(1)^2;
for i=1:20 %递代计算(1)
while sqrt(S1/S2)>e %递代计算条件(3)
Eta(k)=sin(t)+Phi(k)+Phi(k)^3+Phi2(k)+Phi2(k)^3;
Y(:,k+1)=T*[Phi(i),Phi1(i),Phi2(i)]'+L*Eta(k);
Phi(k+1)=Y(1,k+1);
Phi1(k+1)=Y(2,k+1);
Phi2(k+1)=Y(3,k+1);
S1=S1+(Phi(k+1)-Phi(k))^2;
S2=S2+Phi(k)^2;
k=k+1;
Y;
Y1(:,i)=Y(:,k-1);
end
Y(:,i+1)=T*Y1(:,i)+L*Eta(k-2)
pause
S1=(Y(1,i+1)-Y(1,i))^2;
S2=Y(1,i)^2;
i=i+1
end |