matlab程序一直出错,求大神帮看看 50
functiondata=ZHS(fc,fy,Es,ft,Ec,b,h,hf,bf,As,as,n)data=[];Ac=500000;Nc0=1198000;psc=0...
function data=ZHS(fc,fy,Es,ft,Ec,b,h,hf,bf,As,as,n)
data=[];
Ac=500000;
Nc0=1198000;
psc=0.0033;
for d=1:2001
Nc=(d-1)*0.0005*Nc0;
psi0=Nc/1636714286;
y1=0;
y2=h;
af1=ZLHS(fc,fy,Es,ft,Ec,psi0,y1,b,h,hf,bf,As,as,n);
af2=ZLHS(fc,fy,Es,ft,Ec,psi0,y2,b,h,hf,bf,As,as,n);
if af1*af2>0,break,end
max=1+round((log(y2-y1)-log(0.001))/log(2));
for z=1:max
y0=(y1+y2)/2;
axf0=ZLHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n);
if axf0==0
y1=y0;
y2=y0;
elseif af2*axf0>0
y2=y0;
af2=axf0;
else
y1=y0;
af1=axf0;
end
if y2-y1<0.0001,break,end
end
y0=(y1+y2)/2;
Nc(d)=(d-1)*0.0005*Nc0;
bm(d)=WJHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n);
data(d,1)=bm(d)/1000000;
data(d,2)=Nc(d)/1000;
data(d,3)=y0;
end
data=data(:,:);
plot(bm,Nc,'r');grid; xlabel('弯矩Mu(kN·m)');ylabel('轴力Nc(kN)') ;
title('N-M 关系图');hold on
function af=ZLHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n)
af=0;
for i=1:n
v=h/n;A1=h/n*b;A2=h/n*bf;
s=(i-0.5)*v-y0;
psi=psc/(h-y0)*s+psi0;
es=HNTBG(psi,fc,ft,Ec);
if (i-0.5)*v>=h-hf
af=af+es*A2;
elseif (i-0.5)*v<h-hf&&(i-0.5)*v>hf
af=af+es*A1;
else
af=af+es*A2;
end
end
ss'=pcs*(h-as-y0)/(h-y0)+psi;
es3'=GJBG(ss',fy;Es);
ss=psc*(y0-as)/(h-y0)-psi;
es3=GJBG(ss,fy,Es);
af=af+es3'*As'-es3*As;
function bm=WJHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n)
bm=0;
for i=1:n
v=h/n;A1=h/n*b;A2=h/n*bf;
s=(i-0.5)*v-y0;
psi=psc/(h-y0)*s+psi0;
cs=HNTBG(psi,fc,ft,Ec);
if (i-0.5)*v>=h-hf
bm=bm+cs*A2*s;
elseif (i-0.5)*v<h-hf&&(i-0.5)*v>hf
bm=bm+cs*A1*s;
else
bm=bm+cs*A2*s;
end
end
ss'=psc*(h-as-y0)/(h-y0)+psi;
es3'=GJBG(ss',fy,Es);
ss=psc*(y0-as)/(h-y0)-psi;
es3=WJHS(ss,fy,Es);
bm=bm+es3*As*(y0-as)+es3'*As'*(h-as-y0);
function es=HNTBG(cs,fc,ft,Ec)
if cs<=0.002&&cs>=0
es=fc*(1-(1-cs/0.002)*(1-cs/0.002));
elseif cs<=0.0033&&cs>0.002
es=fc;
elseif cs<0&&cs>-ft/Ec
es=Ec*cs;
else
es=0;
end
function es3=GJBG(ss,fy,Es)
if ss<=(fy/Es)
es3=Es*ss;
else
es3=fy;
end
是求一个工字形构件偏压的问题 展开
data=[];
Ac=500000;
Nc0=1198000;
psc=0.0033;
for d=1:2001
Nc=(d-1)*0.0005*Nc0;
psi0=Nc/1636714286;
y1=0;
y2=h;
af1=ZLHS(fc,fy,Es,ft,Ec,psi0,y1,b,h,hf,bf,As,as,n);
af2=ZLHS(fc,fy,Es,ft,Ec,psi0,y2,b,h,hf,bf,As,as,n);
if af1*af2>0,break,end
max=1+round((log(y2-y1)-log(0.001))/log(2));
for z=1:max
y0=(y1+y2)/2;
axf0=ZLHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n);
if axf0==0
y1=y0;
y2=y0;
elseif af2*axf0>0
y2=y0;
af2=axf0;
else
y1=y0;
af1=axf0;
end
if y2-y1<0.0001,break,end
end
y0=(y1+y2)/2;
Nc(d)=(d-1)*0.0005*Nc0;
bm(d)=WJHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n);
data(d,1)=bm(d)/1000000;
data(d,2)=Nc(d)/1000;
data(d,3)=y0;
end
data=data(:,:);
plot(bm,Nc,'r');grid; xlabel('弯矩Mu(kN·m)');ylabel('轴力Nc(kN)') ;
title('N-M 关系图');hold on
function af=ZLHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n)
af=0;
for i=1:n
v=h/n;A1=h/n*b;A2=h/n*bf;
s=(i-0.5)*v-y0;
psi=psc/(h-y0)*s+psi0;
es=HNTBG(psi,fc,ft,Ec);
if (i-0.5)*v>=h-hf
af=af+es*A2;
elseif (i-0.5)*v<h-hf&&(i-0.5)*v>hf
af=af+es*A1;
else
af=af+es*A2;
end
end
ss'=pcs*(h-as-y0)/(h-y0)+psi;
es3'=GJBG(ss',fy;Es);
ss=psc*(y0-as)/(h-y0)-psi;
es3=GJBG(ss,fy,Es);
af=af+es3'*As'-es3*As;
function bm=WJHS(fc,fy,Es,ft,Ec,psi0,y0,b,h,hf,bf,As,as,n)
bm=0;
for i=1:n
v=h/n;A1=h/n*b;A2=h/n*bf;
s=(i-0.5)*v-y0;
psi=psc/(h-y0)*s+psi0;
cs=HNTBG(psi,fc,ft,Ec);
if (i-0.5)*v>=h-hf
bm=bm+cs*A2*s;
elseif (i-0.5)*v<h-hf&&(i-0.5)*v>hf
bm=bm+cs*A1*s;
else
bm=bm+cs*A2*s;
end
end
ss'=psc*(h-as-y0)/(h-y0)+psi;
es3'=GJBG(ss',fy,Es);
ss=psc*(y0-as)/(h-y0)-psi;
es3=WJHS(ss,fy,Es);
bm=bm+es3*As*(y0-as)+es3'*As'*(h-as-y0);
function es=HNTBG(cs,fc,ft,Ec)
if cs<=0.002&&cs>=0
es=fc*(1-(1-cs/0.002)*(1-cs/0.002));
elseif cs<=0.0033&&cs>0.002
es=fc;
elseif cs<0&&cs>-ft/Ec
es=Ec*cs;
else
es=0;
end
function es3=GJBG(ss,fy,Es)
if ss<=(fy/Es)
es3=Es*ss;
else
es3=fy;
end
是求一个工字形构件偏压的问题 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询