function [c ,ceq] = beam13920Constraints(x)

fck = 20;
%fck=25;
fy = 415; %Characteristics strength of steel %fy500-5000-392500; fy450-353250
%fy=500; %Characteristics strength of concrete %fck20-4500, fck25-5000;
%fy=550;
l=3000;
ll=40;
Mu_lim=0.138*fck*x(1)*x(2)^2; %Fy415
%Mu_lim=0.133*fck*x(1)*x(2)^2; %fy500

dl=x(1)*x(2)*25*(10^-6);
factored_load=1.5*(dl+ll);
Mu= factored_load*l^2/8;
shear= factored_load*l/2;
dc=50;
r=x(2)/x(1); %depth to width ratio
xu_lim=0.48*x(2);
fsc=0.87*fy;

%Ast2
Asc=(Mu-Mu_lim)/(fsc*(x(2)-dc)); %compression reinf should not be less than this equation. ( condition taken from book by krishna raju pp229)

%area of steel for tension side Ast=Ast1+Asc
Ast1=(0.36*fck*x(1)*xu_lim)/(0.87*fy);
Ast2=(Asc*fsc)/(0.87*fy);
Ast=Ast1+Ast2;

c= [%(0.138*fck*x(1)*x(2)^2)-Mu; ...
%0.36*fck*x(1)*xu_lim-0.87*fy*(0.7853*x(3)^2*x(4)); %constraint for Ast1 to resist Mulim, (page no-109, bhavikatti volume-1)
%0.36*fck*x(1)*xu_lim*(x(2)-(0.42*xu_lim))/(Mu)-1; ...%(Mu>Mulim), constraint for moment.

Mu_lim/Mu-5; %constraint for moment.

Ast-(.7853*x(3)^2*x(4)); %constraint for tension reinforcement

Asc-(.7853*x(5)^2*x(6)); %constraint for compression reinforcement.

(.85*x(1)*x(2)/fy)-(.7853*x(3)^2*x(4)); ... %constraint for minimum area of tension reinf.

(.7853*x(3)^2*x(4))-0.04*x(1)*(x(2)+dc); ... %constraint for max area of tension reinf.

(.7853*x(5)^2*x(6))-0.04*x(1)*(x(2)+dc); ... %constraint for max area of compression reinf.

(8.314*((.7853*x(3)^2*x(4)/(x(1)*x(2)))^0.5)-(shear/x(1)*x(2))) %constraint for shear

1.5-r; %depth to width ratio should be more than 1.5.
r-3; %depth to width ratio should be less than 3.

(l/x(2))-20 %constraint for deflection

%IS13920 guidelines as below for ductile detailing
0.3-(x(1)/x(2)); %13920 guidelines for width/depth ratio

x(2)-(l/4); %13920 depth should not be more than 1/4th of clear span

8-x(7); %dia of shear reinf not be less than 8mm
100-x(8); %spacing at end span should not be less than 100mm.
x(8)-(x(2)/4); %spacing at end span should not be more than d/4
x(9)-(x(2)/2) %spacing at mid span should not exceed d/2

%x(8)-(8*x(5)) %the spacing of hoops shall not exceed 8times the dia of smallest longitudianl bar.

];

ceq=[ ];