Anda di halaman 1dari 3

# clc;

close all;
clear all;
fid=fopen('beam.txt','w');
fprintf(fid,'program 1. Moment of resistance of beam \n');
fprintf(fid,'
---------------------------- \n');
fck=input('\nEnter the grade of concrete fck(N/mm^2)
');
fy=input('\nEnter the grade of steel fy(N/mm^2)
');
fyd=fy/1.15;
Es=2*10^5;
k=menu('Select type of beam','T beam','L beam',' Rectangular beam');
if k==1
fprintf(fid,'T beam \n');
bw=input('\nEnter the width of web bw(mm)
');
Df=input('\nEnter the depth of flange Df(mm)
');
D=input('\nEnter the depth of section D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=1;
fprintf(fid,'\n Width of web bw(mm))%10.2f\n',bw);
fprintf(fid,'\n Depth of flange Df(mm) %10.2f\n',Df);
fprintf(fid,'\n Depth of section D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
elseif k==2
fprintf(fid,'L beam \n');
bw=input('\nEnter the width of web bw(mm)
');
Df=input('\nEnter the depth of flange Df(mm)
');
D=input('\nEnter the depth of section D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=.5;
fprintf(fid,'\n Width of web bw(mm))%10.2f\n',bw);
fprintf(fid,'\n Depth of flange Df(mm) %10.2f\n',Df);
fprintf(fid,'\n Depth of section D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
else
fprintf(fid,'Rectangular section \n');
b=input('\nEnter the width of beam b(mm)
');
D=input('\nEnter the depth of beam D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=0;
bw=b;
Df=D;
fprintf(fid,'\n Width of beam b(mm))%10.2f\n',b);
fprintf(fid,'\n Depth of beam D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
end
s=menu('Select type of section','singly reinforced section','Doubly reinforced
section');
if s==1
fprintf(fid,'singly reinforced section \n');
nt=input('\nEnter the number of bars in tension
');
dt=input('\nEnter the diameter of bars in tension dt(mm)
');
fprintf(fid,'\n Number of bars in tension %10.2f\n',nt);
fprintf(fid,'\n Diameter of bars in tension dt(mm) %10.2f\n',dt);
Asc=0;
Dl=0;
else

## fprintf(fid,'Doubly reinforced section \n');

nt=input('\nEnter the number of bars in tension
');
nc=input('\nEnter the number of bars in compression
');
dt=input('\nEnter the diameter of bars in tension dt(mm)
');
dc=input('\nEnter the diameter of bars in compression dc(mm)
');
Asc=nc*(.785)*dc^2;
cc=input('\nEnter the cover at top cc(mm) ');
Dl=cc+(dc/2);
fprintf(fid,'\n Number of bars in tension %10.2f\n',nt);
fprintf(fid,'\n Number of bars in compression %10.2f\n',nc);
fprintf(fid,'\n Diameter of bars in tension dt(mm) %10.2f\n',dt);
fprintf(fid,'\n Diameter of bars in compression %10.2f\n',dc);
fprintf(fid,'\n Area of steel in compression(mm^2) %10.2f\n',Asc);
end
Ast=nt*(.785)*dt^2;
fprintf(fid,'\n Area of steel in tension(mm^2) %10.2f\n',Ast);
ct=input('\nEnter the cover at bottom ct(mm)
');
Lo=menu('Select the type of beam','Simply Supported','Continuous beam');
if Lo==1
fprintf(fid,'Simply Supported \n');
Lo=L;
else
fprintf(fid,'Continuous beam \n');
Lo=.7*L;
end
bf=k*(Lo/6+(6*Df))+bw;
d=D-((dt/2)+ct);
fsc=fyd;
xumax=(.0035/(.0055+(fyd/Es)))*d;
xu=((fyd*Ast)-(fsc*Asc))/(.36*fck*bf);
fprintf(fid,'\n xu(mm)=%10.2f\n',xu);
fprintf(fid,'\n xumax(mm)=%10.2f\n',xumax);
if k==0
if xu<=xumax
Mu=(.36*fck*b*xu*(d-(.42*xu)))+(fsc*Asc*(d-Dl));
fprintf(fid,'\nMoment of resistance of beam Mu(kNm)%10.2f\n',Mu/(10^6));
else
fprintf(fid,'over reinforced section \n');
Mu=(.36*fck*b*xumax*(d-(.42*xumax)))+(fsc*Asc*(d-Dl));
fprintf(fid,'\n Moment of resistance of beam Mu(kNm)=%10.2f',Mu/(10^6));
end
else
if xu<Df
Mu=(.36*fck*bf*xu*(d-(.42*xu)));
fprintf(fid,'\n Moment of resistance of beam Mu(kNm)=%10.2f',Mu/(10^6))
;
else if xu<(7*Df/3)
xu=((fyd*Ast)-(.2899*fck*(bf-bw)*Df))/((.36*fck*bw)+(0.0669*fck*(bf-bw
)));
yf=(.15*xu)+(.65*Df);
Mu=(.36*fck*bw*xu*(d-.42*xu))+(.446*fck*(bf-bw)*yf*(d-(yf/2)));
fprintf(fid,'\n xu(mm)=%10.2f\n',xu);
fprintf(fid,'\n Moment of resistance of beam Mu(kNm)=%10.2f',Mu/(10^6)
);
else
xu=((fyd*Ast)-(.446*fck*(bf-bw)*Df))/(.36*fck*bw);
Mu=(.36*fck*bw*xu*(d-.42*xu))+(.446*fck*(bf-bw)*Df*(d-(Df/2)));
fprintf(fid,'\n xu(mm)=%10.2f\n',xu);

6));
end
end

end
fclose(fid);