%This function is to calculate the plastic stage %What we know %Ft=Fc %M=z*(Fc or Ft) %epcp/eps = y/ d-a-b %a=elastic distance %b=plastic distance function [epc, x]=Plast2 global bf fc fs Es dflange; global d As; % 0.57*fc*bf*(0.5*a+b)-As*Es*eps=0 % (eps+epcp)*a+epcp*b-epcp*d=0 % 0.57*fc*bf*(0.5*a*(d-b-a/3)+b*(d-0.5*b))-M=0 %a=x(1), b=x(2) eps=x(3) fun=@pfun; s=[10,10,0.005]; options=optimset('Display','off'); y=fsolve(fun,s,options); a=y(1); b=y(2); eps=y(3); Fc=0.57*fc*bf*(0.5*a+b)/1000; Ft=As*Es*eps/1000; Mans=0.57*fc*bf*(0.5*a*(d-b-a/3)+b*(d-0.5*b))/1000000; %check whether steel yields epsy=0.87*fs/Es; if eps>epsy %disp 'steel yields' else %disp 'steel is ok' end %check whether concrete crushes epc=eps*(a+b)/(d-a-b); if epc>0.0035 %disp 'concrete cracks' else %disp 'concrete is ok' end x=a+b; if (x>dflange) disp ('X is not in flange'); end end