function [c ,ceq] = beamConstraints(x)

%fck=20;   %M20
fck=25; %M25             %Characteristics strength of concrete %fck20-4500, fck25-5000;
%fy= 415;
%fy = 500;            %Characteristics strength of steel    %fy500-392500; fy415-353250
fy=550;  
l=11000;
ll=60;
%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);  %dead load
factored_load=1.5*(dl+ll);  %1.5*(dead load+live load)
Mu= factored_load*l^2/8;    %w*l^2/8
shear= factored_load*l/2;   %w*l/2
dc=50;                     %effective cover
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 of krishna raju pp 229)

 %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)-3; ...%(Mu>Mulim), constraint for moment.
   
    Mu_lim/Mu-3;    %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.
   
    
  x(8)-0.75*x(2);      %constraint for spacing of shear reinf
   
   x(8)-300;            %constraint for spacing of shear reinf
  
   (l/x(2))-20          %constraint for deflection 
   
   ];
           
ceq=[ ];