q=2;
v=36;
eps=0.0001;
eps1=0.01;
g=9.8;
hs=18;
ha=0.3;
hb=2;
l=[1,1,1,1,1];
for jj=1:(22.05/0.105)
l=[1,0.105];
end
for mm1=1200:10:3000
while (1)
Ha=fH(q,mm1,hs,v,g,ha);
Hb=fH(q,mm1,hs,v,g,hb);
hx=0.5*(ha+hb);
[Hx,phy1]=fH(q,mm1,hs,v,g,hx);
if Ha>hs||Hb<hs
break
end
if Hx>hs
hb=hx;
else
ha=hx;
end
if abs(Hx-hs)<eps&&abs( phy1(5)-85/180*pi)<eps1&&abs(phy1(215)-16/180*pi)<eps1
H=Hx;
mm2=mm1;
break
end
end
end
jd=phy1;
yy=0;
xx=0;
xx1=[];
yy1=[];
yfx=sin(phy1).*l;
xfx=cos(phy1).*l;
for i=length(yfx):-1:6
yy=yy+yfx(i);
yy1=[yy1,yy];
xx=xx+xfx(i);
xx1=[xx1,xx];
end
plot(xx1,yy1)
R=sum(cos(jd).*l)
function [Hk,phy1] =fH(q,mm1,hs,v,g,hx)
zhunzhongli1=[];
cd=[0.078 0.105 0.12 0.15 0.18];
zl=[3.2,7,12.5,19.5,28.12];
m=[1000 10 10 10 10 100];
for j=1:(22.05/0.105)
m1=zl(q)*cd(q);
m=[m,m1];
end
l=[1,1,1,1,1];
for jj=1:(22.05/0.105)
l=[l,0.105];
end
g=9.8;
for i=1:length(m)
if i==1
zhunzhongli=m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i<=5&&i>=2
v1=0.025^2*pi*l;
zhunzhongli=-1025*g*v1+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i==6
v2=0.15^2*pi*1;
zhunzhongli=-1025*g*v2+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i>=7
zl2=zl(q)*cd(q);
v3=zl2./7850;
zhunzhongli=-1025*g*v3+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
end
end
fx=[];
fy=[];
h2=[];
phy=zeros(1,215);
h1=[];
fuli=ffuli(g,hx);
fengli=ffengli(v,hx);
fx(1)=fengli;
fy(1)=fuli-zhunzhongli1(1);
phy(1)=atan(((2*fy(1))-zhunzhongli1(2))/fx(1)/2);
for j=2:215
if j==6
vz=mm1./7850;
fll=-1025*vz*g+mm1.*g;
fy(6)=fy(5)-zhunzhongli1(5)-fll;
fx(6)=fx(5);
phy(j)=atan(((2*fy(j-1))-zhunzhongli1(j))/(fx(j-1)*2));
else
fy(j)=fy(j-1)-zhunzhongli1(j);
fx(j)=fx(j-1);
phy(j)=atan(((2*fy(j-1))-zhunzhongli1(j))/(fx(j-1)*2));
end
if fy(j)<0
break
end
end
phy1=phy;
h1=sin(phy).*l;
Hk=sum(h1)+hx;
end
function [fengli] = ffengli( v,hx )
s=(2-hx)*2;
fengli=0.625*s*v.*v;
end
function [ fuli, ro ] = ffuli(g,hx )
ro=1025;
r=1;
vpai=pi*r*r*hx;
fuli=ro*g*vpai;
end
v=36;
eps=0.0001;
eps1=0.01;
g=9.8;
hs=18;
ha=0.3;
hb=2;
l=[1,1,1,1,1];
for jj=1:(22.05/0.105)
l=[1,0.105];
end
for mm1=1200:10:3000
while (1)
Ha=fH(q,mm1,hs,v,g,ha);
Hb=fH(q,mm1,hs,v,g,hb);
hx=0.5*(ha+hb);
[Hx,phy1]=fH(q,mm1,hs,v,g,hx);
if Ha>hs||Hb<hs
break
end
if Hx>hs
hb=hx;
else
ha=hx;
end
if abs(Hx-hs)<eps&&abs( phy1(5)-85/180*pi)<eps1&&abs(phy1(215)-16/180*pi)<eps1
H=Hx;
mm2=mm1;
break
end
end
end
jd=phy1;
yy=0;
xx=0;
xx1=[];
yy1=[];
yfx=sin(phy1).*l;
xfx=cos(phy1).*l;
for i=length(yfx):-1:6
yy=yy+yfx(i);
yy1=[yy1,yy];
xx=xx+xfx(i);
xx1=[xx1,xx];
end
plot(xx1,yy1)
R=sum(cos(jd).*l)
function [Hk,phy1] =fH(q,mm1,hs,v,g,hx)
zhunzhongli1=[];
cd=[0.078 0.105 0.12 0.15 0.18];
zl=[3.2,7,12.5,19.5,28.12];
m=[1000 10 10 10 10 100];
for j=1:(22.05/0.105)
m1=zl(q)*cd(q);
m=[m,m1];
end
l=[1,1,1,1,1];
for jj=1:(22.05/0.105)
l=[l,0.105];
end
g=9.8;
for i=1:length(m)
if i==1
zhunzhongli=m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i<=5&&i>=2
v1=0.025^2*pi*l;
zhunzhongli=-1025*g*v1+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i==6
v2=0.15^2*pi*1;
zhunzhongli=-1025*g*v2+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
elseif i>=7
zl2=zl(q)*cd(q);
v3=zl2./7850;
zhunzhongli=-1025*g*v3+m(i)*g;
zhunzhongli1=[zhunzhongli1,zhunzhongli];
end
end
fx=[];
fy=[];
h2=[];
phy=zeros(1,215);
h1=[];
fuli=ffuli(g,hx);
fengli=ffengli(v,hx);
fx(1)=fengli;
fy(1)=fuli-zhunzhongli1(1);
phy(1)=atan(((2*fy(1))-zhunzhongli1(2))/fx(1)/2);
for j=2:215
if j==6
vz=mm1./7850;
fll=-1025*vz*g+mm1.*g;
fy(6)=fy(5)-zhunzhongli1(5)-fll;
fx(6)=fx(5);
phy(j)=atan(((2*fy(j-1))-zhunzhongli1(j))/(fx(j-1)*2));
else
fy(j)=fy(j-1)-zhunzhongli1(j);
fx(j)=fx(j-1);
phy(j)=atan(((2*fy(j-1))-zhunzhongli1(j))/(fx(j-1)*2));
end
if fy(j)<0
break
end
end
phy1=phy;
h1=sin(phy).*l;
Hk=sum(h1)+hx;
end
function [fengli] = ffengli( v,hx )
s=(2-hx)*2;
fengli=0.625*s*v.*v;
end
function [ fuli, ro ] = ffuli(g,hx )
ro=1025;
r=1;
vpai=pi*r*r*hx;
fuli=ro*g*vpai;
end