x=0;
y=2;
h=(x+y)/2;
while abs(y-x)>1e-10
h=(x+y)/2;
%第一阶段
G1=10000;
Fchui=0.625*2*(2-h)*144;
Ffu=10250*pi*h;
thita=zeros(1,5);
thita1=zeros(1,5);
alpha=zeros(1,211);
alpha1=zeros(1,211);
ff=zeros(1,5);
FF=zeros(1,211);
if Ffu-G1<0
continue;
end
thita(1)=atan(Fchui/(Ffu-G1));
ff(1)=sqrt(Ffu^2+Fchui^2+G1^2-2*Ffu*G1);
%第二阶段
Ffu2=25.625*pi;
G2=100;
for i=1:4
thita(i+1)=atan(ff(i)*sin(thita(i))/(ff(i)+Ffu2-G2));
ff(i+1)=ff(i)*sin(thita(i))/sin(thita(i+1));
while thita(i+1)<0||thita(i+1)>pi/2
if thita(i+1)<0
thita(i+1)=thita(i+1)+pi;
else
thita(i+1)=thita(i+1)-pi;
end
end
end
%第三阶段
Ffu3=922.5*pi;
G3=13000;
alpha(1)=atan(ff(5)*sin(thita(5))/(Ffu3+ff(5)*cos(thita(5))-G3));
FF(1)=ff(5)*sin(thita(5))/sin(alpha(1));
%第四阶段
G4=7.35;
for i=1:210
alpha(i+1)=atan(FF(i)*sin(alpha(i))/(FF(i)*cos(alpha(i))-G4));
FF(i+1)=FF(i)*sin(alpha(i))/sin(alpha(i+1));
if alpha(i+1)<0
alpha(i+1)=alpha(i+1)+pi;
end
if alpha(i+1)>pi/2
alpha(i+1)=pi/2;
break;
end
end
for i=1:211
if alpha(i)==0
alpha(i)=pi/2;
end
end
%求和阶段
L1=1;
L2=0.105;
l1=0;
l2=0;
H=0;
for i=1:5
l1=l1+L1*cos(thita(i));
end
for i=1:210
l2=l2+L2*cos(alpha(i));
end
H=h+l1+l2;
if h+l1+l2>18
y=h;
else
x=h;
end
end
for i=1:5
thita1(i)=thita(i)*180/pi;
end
for i=1:211
alpha1(i)=alpha(i)*180/pi;
end
m1=90-alpha1(210);
m2=thita1(4);
plot(alpha1)