Advertisement
lodha1503

Untitled

Jul 8th, 2023
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react'
  2.  
  3. const TwoWaySlab = (props) => {
  4.     var flag=0;
  5.     const choose_positive_min=(value1,value2)=>
  6.     {
  7.       if (value1 >= 0 && value2 >= 0)
  8.       {
  9.         return Math.min(value1, value2);
  10.       }
  11.    
  12.       else if (value1 >= 0)
  13.       {
  14.         return value1;
  15.       }
  16.  
  17.       else if (value2 >= 0)
  18.       {
  19.         return value2;
  20.       }
  21.  
  22.       return -1;
  23.     };
  24.  
  25.     const find_lowest_nearest_multiple_of_10=(num)=>
  26.     {
  27.      
  28.       var nearest_multiple;
  29.       nearest_multiple = Math.floor(num/10);
  30.       nearest_multiple=nearest_multiple*10;
  31.      
  32.       return nearest_multiple;
  33.     };
  34.  
  35.     const Long_Span=props.breadth;
  36.     const Short_Span=props.length;
  37.     const Live_Load=3.5;
  38.     const Dead_Load=0.25;
  39.     const Concrete_grade = 20,Steel_Strength=415;
  40.  
  41.     const Depth=Short_Span;
  42.     const Effective_depth = Math.round(Depth*1000);
  43.     const Total_depth = Effective_depth + 20+4;
  44.  
  45.  
  46.     const Self_weight = 25*(1)*(Total_depth/1000)  ;
  47.     const Floor_Finish=1;
  48.  
  49.     const Total_Load = Live_Load + Dead_Load + Self_weight + Floor_Finish;
  50.     const Factored_Load = 1.5*Total_Load;
  51.  
  52.     const ratio = Math.float(Long_Span) / Math.float(Short_Span);
  53.     const final_ratio = Math.round(ratio, 2);
  54.  
  55.  
  56.  
  57.     var short_negative_momentcoefficient;
  58.     var short_positive_momentcoefficient;
  59.     var long_negative_momentcoefficient;
  60.     var long_positive_momentcoefficient;
  61.  
  62.  
  63.     var Negative_shortspan_Moment = short_negative_momentcoefficient*Factored_Load*(Math.pow(Short_Span,2)) ;  
  64.  
  65.     var Positive_shortspan_Moment = short_positive_momentcoefficient*Factored_Load*(Math.pow(Short_Span,2));
  66.  
  67.     var Negative_longspan_Moment = long_negative_momentcoefficient*Factored_Load*(Math.pow(Short_Span,2));
  68.  
  69.     var Positive_longspan_Moment = long_positive_momentcoefficient*Factored_Load*(Math.pow(Short_Span,2));
  70.  
  71.     var Effective_depth_req = (Math.sqrt((Negative_shortspan_Moment*1000000)/(0.138*Concrete_grade*1000)));
  72.  
  73.  
  74.  
  75.  
  76.  
  77.     var Ast_min,Maximum_spacing,a,b,c,root1,root2,discriminant,Area_required,dia,area_of_bar,no_of_bar,number,spacing,Spacing,Area_requiredx1,Area_providedx,Area_requiredx2;
  78.  
  79.     if(Effective_depth_req>Effective_depth)
  80.     {
  81.         Ast_min = (0.0012)*(1000*Total_depth);
  82.         Maximum_spacing = Math.min(3*Effective_depth,300);
  83.  
  84.         a = (Math.pow((Steel_Strength),2)*0.87)/(Concrete_grade*1000)
  85.         b = -(Steel_Strength*0.87*Effective_depth)
  86.         c = Negative_shortspan_Moment*1000000;
  87.  
  88.         discriminant = (Math.pow(b,2)) - (4*a*c);
  89.  
  90.         if (discriminant<0)
  91.         {
  92.           root1=-b/(2*a);
  93.           root2=-b/(2*a);
  94.         }
  95.  
  96.         else
  97.         {
  98.           root1 = (-b + Math.sqrt(discriminant)) / (2*a);
  99.           root2 = (-b - Math.sqrt(discriminant)) / (2*a);
  100.         }
  101.  
  102.         Area_requiredx1=choose_positive_min(root1,root2);
  103.  
  104.         if(Area_requiredx1>=0)
  105.         {
  106.            
  107.             dia = 10;                                                        
  108.             area_of_bar = (3.14*(Math.pow(dia,2)))/4;
  109.             no_of_bar = Area_requiredx1/area_of_bar + 1;
  110.             number = Math.round(no_of_bar);
  111.             spacing = 1000/number;
  112.             Spacing = find_lowest_nearest_multiple_of_10(spacing);
  113.  
  114.             if (Maximum_spacing>=Spacing)
  115.             {
  116.                 Area_providedx = (no_of_bar - 1)*(Math.floor( spacing/ 100) * 100);
  117.  
  118.                 a = (Math.pow((Steel_Strength),2)*0.87)/(Concrete_grade*1000);
  119.                 b = -(Steel_Strength*0.87*Effective_depth);
  120.                 c = Positive_shortspan_Moment*1000000;
  121.  
  122.                 discriminant = (Math.pow(b,2)) - (4*a*c);
  123.  
  124.                 if (discriminant<0)
  125.                 {
  126.                     root1=-b/(2*a);
  127.                     root2=-b/(2*a);
  128.                 }
  129.  
  130.                 else
  131.                 {
  132.                     root1 = (-b + Math.sqrt(discriminant)) / (2*a);
  133.                     root2 = (-b - Math.sqrt(discriminant)) / (2*a);
  134.                 }
  135.  
  136.                 Area_requiredx2=choose_positive_min(root1,root2);
  137.  
  138.                 if (Area_requiredx2>=0)
  139.                 {
  140.                     dia=10;
  141.                     area_of_bar = (3.14*(Math.pow(dia,2)))/4;
  142.                     no_of_bar = Area_requiredx2/area_of_bar + 1;
  143.                     number = Math.round(no_of_bar);
  144.                     spacing = 1000/number;
  145.                     Spacing = find_lowest_nearest_multiple_of_10(spacing);
  146.  
  147.                     if(Maximum_spacing>=Spacing)
  148.                     {
  149.  
  150.                     }
  151.                     else
  152.                     {
  153.                         alert("Maximum Spacing < Spacing for Area_reqx2");
  154.                     }
  155.                 }
  156.                 else
  157.                 {
  158.                     alert("Required Areax2 is negative");
  159.  
  160.                 }
  161.  
  162.             }
  163.             else
  164.             {
  165.                 alert("Maximum Spacing < Spacing for Area_reqx1")
  166.             }
  167.  
  168.  
  169.         }
  170.         else
  171.         {
  172.           alert("Required Areax1 is negative");
  173.         }
  174.     }
  175.  
  176.     else
  177.     {
  178.         alert("The effective depth selected is not sufficient to resist the design ultimate moment")
  179.     }
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.   return (
  193.     <div>
  194.      
  195.     </div>
  196.   )
  197. }
  198.  
  199. export default TwoWaySlab
  200.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement