× BeamColumnDesign.c BeamColumnDesign.h BeamDesign.c BeamDesign.h ColumnDesign.c ColumnDesign.h main.c Sections.txt Go Back Go Back to Programming Section Menu Go Back to Home Page
BeamColumnDesign.c
/**************************************************************************************************/
/*               File Name: BeamColumnDesign.c               Written by: Koral Eren               */
/**************************************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>

#include "BeamColumnDesign.h"

void BeamColumnDesign (void)
{
     /***********************FILE READER**************************/
     FILE *fp;
  double sections1D [2842];
  double value;
  int i = -1;

  if ((fp = fopen ("Sections.txt", "r")) == NULL)
  {
      printf("Can't find the Sections file called Sections");
      return;
  }


  while (!feof (fp) && fscanf (fp, "%lf", &value) && i++ < 2841)
    sections1D [i] = value;

  fclose (fp);

  int j;
  double sections [203][14];

  for (j=0;j<203;j++)
    for (i=0;i<14;i++)
        sections[j][i]=sections1D[i+(14*(j))];
/***********************FILE READER****************************/

    int flangeclass;
    int webclass;
    int shapeclass;
    double Mf, Cf, L, Lu, slendernessratiox, slendernessratioy;
    double Mr, Mmax, Ma, Mb, Mc, w2, Mu, G = 77000, PI = 3.141593;
    int braced;
    double Cr0, Mr0;
    double U1, w1, Ce;
    double crosssectionalcheck = 0, overallmemberstrength = 0, LTBstrength = 0, ADDcheck = 0;
    double Crx, Cry, Fe, Lambda, n = 1.34;
    double massselect = 10000;
    int sectionselect = 0, sectionselectholder = 0;

    printf("Enter Cf (kN - Max Compressive axial force the beam-column has to carry):");
    scanf("%lf",&Cf);

    printf("Enter Mf (kNm - Max factored moment applied on the beam-column):");
    scanf("%lf",&Mf);

    printf("Enter L (mm - Unsupported length of the beam-column to be designed):");
    scanf("%lf",&L);

    printf("Enter Lu (mm - Unsupported length of the columns around the beam-column):");
    scanf("%lf",&Lu);

     double input1, input2, input4, input5, K;
    int select, select2, select3, input3, input6 = 0;

    printf("\nThe following calculations are for sidesway prevented frames:\n");
    printf("If BOTH ends are PINNED and not connected to ground PRESS 1:\n");
    printf("If LEFT or LOWER end is pinned to the GROUND and RIGHT or UPPER END IS PINNED PRESS 2:\n");
    printf("If LEFT or LOWER end is pinned to the GROUND and RIGHT or UPPER END IS FIXED PRESS 3:\n");
    printf("If BOTH ends are FIXED and not connected to ground PRESS 4:\n");
    scanf("%d",&select);

    if (select == 1)
    {
        K = 1;
        printf("K = %lf\n\n", K);
    }
    else if (select == 2)
    {
        K = (3*100000*10+1.4*(100000+10)+0.64)/(3*100000*10+2*(100000+10)+1.28);
        printf("K = %lf\n\n", K);
    }
    else if (select == 3)
    {
        K = 0.80;
        printf("K = %lf\n\n", K);
    }
    else if (select == 4)
    {
        K = 0.65;
        printf("K = %lf\n\n", K);
    }

        printf("Enter w1:");
        scanf("%lf",&w1);

        printf("w2 for LATERALLY UNSUPPORTED LENGTH Mr (knM) CALCULATION:\n");

        printf("Enter maximum moment (Mmax) kNm - no negative-: ");
        scanf("%lf",&Mmax);
        printf("Enter moment at 1/4 of unbraced segment (Ma) kNm: ");
        scanf("%lf",&Ma);
        printf("Enter moment at 2/4 of unbraced segment (Mb) kNm: ");
        scanf("%lf",&Mb);
        printf("Enter moment at 3/4 of unbraced segment (Mc) kNm: ");
        scanf("%lf",&Mc);

        w2 = (4*Mmax)/sqrt(pow(Mmax,2)+4*pow(Ma,2)+7*pow(Mb,2)+4*pow(Mc,2));

        if (w2 <= 2.5)
            printf("\nw2: %lf\n\n", w2);
        else
            printf("\nWARNING W2 > 2.5\n\n");

        printf("Is the frame braced?\nPRESS 1 FOR YES\nPRESS 2 FOR NO: ");
        scanf("%d",&braced);

        system("pause");

         for (j=0;j<203;j++)
{
    sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 200/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (200/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (200/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= ((1100/sqrt(350))*(1-0.39*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1100/sqrt(350))*(1-0.39*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= ((1700/sqrt(350))*(1-0.61*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1700/sqrt(350))*(1-0.61*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

    printf("SLENDERNESS RATIO CHECK:\n");

    slendernessratioy = (K*L)/sqrt((sections [j][6]*pow(10,6))/sections [j][2]);
    printf("Iy: %lf x 10^6\nArea: %lf",sections [j][6], sections [j][2] );
    if (slendernessratioy < 200)
        printf("\nslenderness ratio y: %lf < 200 - OK\n", slendernessratioy);
    else
        printf("\nslenderness ratio y: %lf >= 200 - FAIL\n", slendernessratioy);

    slendernessratiox = (K*L)/sqrt((sections [j][3]*pow(10,6))/sections [j][2]);
    printf("Ix: %lf x 10^6\nArea: %lf",sections [j][3], sections [j][2] );
    if (slendernessratiox < 200)
        printf("\nslenderness ratio x: %lf < 200 - OK\n", slendernessratiox);
    else
        printf("\nslenderness ratio x: %lf >= 200 - FAIL\n", slendernessratiox);

    if (braced == 1)
    {
        printf("CROSS SECTIONAL STRENGTH CHECK:\n");

        Cr0 = 0.90*sections[j][2]*350*0.001;
        printf("Cr0 = %lf kN\n", Cr0);

        printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

        printf("U1 calculation:\n");

        Ce = pow(PI,2)*(200000)*(sections[j][3])*(1000000)*(0.001)/pow(L,2);

        U1 = w1/(1-Cf/Ce);

        if (U1 < 1)
            U1 = 1;

        printf ("U1 = %lf\n", U1);

        if ((shapeclass == 1 || shapeclass == 2) && (Cf/Cr0 + (0.85*U1*Mf)/Mr0) <= 1)
        {
            crosssectionalcheck = (Cf/Cr0 + (0.85*U1*Mf)/Mr0);
            printf("%lf <= 1 - Cross Sectional Check OK\n\n", crosssectionalcheck);
        }
        else if (shapeclass == 3 && (Cf/Cr0 + (U1*Mf)/Mr0) <= 1)
        {
            crosssectionalcheck = (Cf/Cr0 + (U1*Mf)/Mr0);
            printf("%lf <= 1 - Cross Sectional Check OK\n\n", crosssectionalcheck);
        }
        else
        {
            printf("Cross Sectional Check FAIL\n\n");
            crosssectionalcheck = 2;
        }

    }

    printf("OVERALL MEMBER STRENGTH CHECK:\n");

    printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

     printf("Crx calculation:\n");

    Fe = (((pow(PI,2))*200000)/pow(slendernessratiox,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Crx = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Crx (factored axial compressive resistance) = %lf kN\n\n", Crx);

    if (braced == 1)
        U1 = w1/(1-Cf/Ce);
    else
        U1 = 1;

    printf ("U1 = %lf\n", U1);

    if ((shapeclass == 1 || shapeclass == 2) && (Cf/Crx + (0.85*U1*Mf)/Mr0) <= 1)
        {
            overallmemberstrength = (Cf/Crx + (0.85*U1*Mf)/Mr0);
            printf("%lf <= 1 - Overall Member Strength Check OK\n\n", overallmemberstrength);
        }
        else if (shapeclass == 3 && (Cf/Crx + (U1*Mf)/Mr0) <= 1)
        {
            overallmemberstrength = (Cf/Crx + (U1*Mf)/Mr0);
            printf("%lf <= 1 - Overall Member Strength Check OK\n\n", overallmemberstrength);
        }
        else
        {
            printf("Overall Member Strength Check FAIL\n\n");
            overallmemberstrength = 2;
        }

    printf("LATERAL TORSIONAL BUCKLING CHECK:\n");

     printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

    printf("Cry calculation:\n");

    Fe = (((pow(PI,2))*200000)/pow(slendernessratioy,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Cry = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Cry (factored axial compressive resistance) = %lf kN\n\n", Cry);

    printf("Mr (knM) calculation:\n");

    Mu = 0.000001*(w2*PI/(L))*sqrt((200000*G*sections[j][6]*pow(10,6)*sections[j][7]*pow(10,3))+pow(((PI*200000)/(L)),2)*sections[j][6]*pow(10,6)*sections[j][8]*pow(10,9));
    printf("\nMu: %lf kNm\n", Mu);

    if(Mu > (0.67*Mr0/0.90))
    {
        Mr = 1.15*Mr0*(1-((0.28/0.90)*Mr0)/Mu);
        if (Mr > Mr0)
            Mr = Mr0;
    }
    else if (Mu <= (0.67*Mr0/0.90))
        Mr = 0.90*Mu;

    printf("\nMr: %lf kNm\n", Mr);

     if (braced == 1)
     {
        U1 = w1/(1-Cf/Ce);
        if (U1 < 1)
            U1 = 1;
     }
    else
        U1 = 1;

    printf ("U1 = %lf\n", U1);

    if ((shapeclass == 1 || shapeclass == 2) && (Cf/Cry + (0.85*U1*Mf)/Mr) <= 1)
        {
            LTBstrength = (Cf/Cry + (0.85*U1*Mf)/Mr);
            printf("%lf <= 1 - Lateral Torsional Buckling Check OK\n\n", LTBstrength);
        }
        else if (shapeclass == 3 && (Cf/Cry + (U1*Mf)/Mr) <= 1)
        {
            LTBstrength = (Cf/Cry + (U1*Mf)/Mr);
            printf("%lf <= 1 - Lateral Torsional Buckling Check OK\n\n", LTBstrength);
        }
        else
        {
            printf("Lateral Torsional Buckling Check FAIL\n\n");
            LTBstrength = 2;
        }
    if (braced == 1)
    {
        printf("ADDITIONAL CHECK:\n");

        if ((shapeclass == 1 || shapeclass == 2) && (Mf/Mr) <= 1)
        {
            ADDcheck = (Mf/Mr);
            printf("%lf <= 1 - Additional Check OK\n\n", ADDcheck);
        }
        else if (shapeclass == 3 && (Mf/Mr) <= 1)
        {
            ADDcheck = (Mf/Mr);
            printf("%lf <= 1 - Additional Check OK\n\n", ADDcheck);
        }
        else
        {
            printf("Additional Check FAIL\n\n");
            ADDcheck = 2;
        }
    }

    if (crosssectionalcheck<=1 /*&& sections[j][0]>400*/ && overallmemberstrength<=1 && LTBstrength<=1 && ADDcheck<=1 && shapeclass<4 && massselect>=sections[j][1])
    {
        sectionselect = j;
        massselect = sections[j][1];
    }

    printf("\n\nSection selected = W%lfx%lf\n\n", sections[sectionselect][0], sections[sectionselect][1]);

      if (j==202)
    {
        if (sectionselectholder == sectionselect)
        {
            printf("\n\nFinal Section chosen is: W%lfx%lf\n",sections[sectionselectholder][0], sections[sectionselectholder][1]);
            if (shapeclass == 4)
                printf("\n\nWarning CLASS 4 CHOSEN!\n\n");
            j = sectionselectholder;

            sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 200/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (200/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= ((1100/sqrt(350))*(1-0.39*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1100/sqrt(350))*(1-0.39*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= ((1700/sqrt(350))*(1-0.61*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1700/sqrt(350))*(1-0.61*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), ((1900/sqrt(350))*(1-0.65*Cf/(0.90*sections [j][2]*350*0.001))));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

    printf("SLENDERNESS RATIO CHECK:\n");

    slendernessratioy = (K*L)/sqrt((sections [j][6]*pow(10,6))/sections [j][2]);
    printf("Iy: %lf x 10^6\nArea: %lf",sections [j][6], sections [j][2] );
    if (slendernessratioy < 200)
        printf("\nslenderness ratio y: %lf < 200 - OK\n", slendernessratioy);
    else
        printf("\nslenderness ratio y: %lf >= 200 - FAIL\n", slendernessratioy);

    slendernessratiox = (K*L)/sqrt((sections [j][3]*pow(10,6))/sections [j][2]);
    printf("Ix: %lf x 10^6\nArea: %lf",sections [j][3], sections [j][2] );
    if (slendernessratiox < 200)
        printf("\nslenderness ratio x: %lf < 200 - OK\n", slendernessratiox);
    else
        printf("\nslenderness ratio x: %lf >= 200 - FAIL\n", slendernessratiox);

    if (braced == 1)
    {
        printf("CROSS SECTIONAL STRENGTH CHECK:\n");

        Cr0 = 0.90*sections[j][2]*350*0.001;
        printf("Cr0 = %lf kN\n", Cr0);

        printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

        printf("U1 calculation:\n");

        Ce = pow(PI,2)*(200000)*(sections[j][3])*(1000000)*(0.001)/pow(L,2);

        U1 = w1/(1-Cf/Ce);

        if (U1 < 1)
            U1 = 1;

        printf ("U1 = %lf\n", U1);

        if ((shapeclass == 1 || shapeclass == 2) && (Cf/Cr0 + (0.85*U1*Mf)/Mr0) <= 1)
        {
            crosssectionalcheck = (Cf/Cr0 + (0.85*U1*Mf)/Mr0);
            printf("%lf <= 1 - Cross Sectional Check OK\n\n", crosssectionalcheck);
        }
        else if (shapeclass == 3 && (Cf/Cr0 + (U1*Mf)/Mr0) <= 1)
        {
            crosssectionalcheck = (Cf/Cr0 + (U1*Mf)/Mr0);
            printf("%lf <= 1 - Cross Sectional Check OK\n\n", crosssectionalcheck);
        }
        else
        {
            printf("Cross Sectional Check FAIL\n\n");
            crosssectionalcheck = 2;
        }

    }

    printf("OVERALL MEMBER STRENGTH CHECK:\n");

    printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

     printf("Crx calculation:\n");

    Fe = (((pow(PI,2))*200000)/pow(slendernessratiox,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Crx = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Crx (factored axial compressive resistance) = %lf kN\n\n", Crx);

    if (braced == 1)
        U1 = w1/(1-Cf/Ce);
    else
        U1 = 1;

    printf ("U1 = %lf\n", U1);

    if ((shapeclass == 1 || shapeclass == 2) && (Cf/Crx + (0.85*U1*Mf)/Mr0) <= 1)
        {
            overallmemberstrength = (Cf/Crx + (0.85*U1*Mf)/Mr0);
            printf("%lf <= 1 - Overall Member Strength Check OK\n\n", overallmemberstrength);
        }
        else if (shapeclass == 3 && (Cf/Crx + (U1*Mf)/Mr0) <= 1)
        {
            overallmemberstrength = (Cf/Crx + (U1*Mf)/Mr0);
            printf("%lf <= 1 - Overall Member Strength Check OK\n\n", overallmemberstrength);
        }
        else
        {
            printf("Overall Member Strength Check FAIL\n\n");
            overallmemberstrength = 2;
        }

    printf("LATERAL TORSIONAL BUCKLING CHECK:\n");

     printf("Mr0 (knM) calculation:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

    printf("Cry calculation:\n");

    Fe = (((pow(PI,2))*200000)/pow(slendernessratioy,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Cry = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Cry (factored axial compressive resistance) = %lf kN\n\n", Cry);

    printf("Mr (knM) calculation:\n");

    Mu = 0.000001*(w2*PI/(L))*sqrt((200000*G*sections[j][6]*pow(10,6)*sections[j][7]*pow(10,3))+pow(((PI*200000)/(L)),2)*sections[j][6]*pow(10,6)*sections[j][8]*pow(10,9));
    printf("\nMu: %lf kNm\n", Mu);

    if(Mu > (0.67*Mr0/0.90))
    {
        Mr = 1.15*Mr0*(1-((0.28/0.90)*Mr0)/Mu);
        if (Mr > Mr0)
            Mr = Mr0;
    }
    else if (Mu <= (0.67*Mr0/0.90))
        Mr = 0.90*Mu;

    printf("\nMr: %lf kNm\n", Mr);

     if (braced == 1)
     {
        U1 = w1/(1-Cf/Ce);
        if (U1 < 1)
            U1 = 1;
     }
    else
        U1 = 1;

    printf ("U1 = %lf\n", U1);

    if ((shapeclass == 1 || shapeclass == 2) && (Cf/Cry + (0.85*U1*Mf)/Mr) <= 1)
        {
            LTBstrength = (Cf/Cry + (0.85*U1*Mf)/Mr);
            printf("%lf <= 1 - Lateral Torsional Buckling Check OK\n\n", LTBstrength);
        }
        else if (shapeclass == 3 && (Cf/Cry + (U1*Mf)/Mr) <= 1)
        {
            LTBstrength = (Cf/Cry + (U1*Mf)/Mr);
            printf("%lf <= 1 - Lateral Torsional Buckling Check OK\n\n", LTBstrength);
        }
        else
        {
            printf("Lateral Torsional Buckling Check FAIL\n\n");
            LTBstrength = 2;
        }
    if (braced == 1)
    {
        printf("ADDITIONAL CHECK:\n");

        if ((shapeclass == 1 || shapeclass == 2) && (Mf/Mr) <= 1)
        {
            ADDcheck = (Mf/Mr);
            printf("%lf <= 1 - Additional Check OK\n\n", ADDcheck);
        }
        else if (shapeclass == 3 && (Mf/Mr) <= 1)
        {
            ADDcheck = (Mf/Mr);
            printf("%lf <= 1 - Additional Check OK\n\n", ADDcheck);
        }
        else
        {
            printf("Additional Check FAIL\n\n");
            ADDcheck = 2;
        }
    }
            return;
        }
        printf("\nEnter column or beam sections:\n");
        printf("Enter upper column or beam section W ? x ?:\n");
        printf("?1:");
        scanf("%lf",&input1);
        printf("?2:");
        scanf("%lf",&input2);
        for (j=0;j<203;j++)
            if (sections[j][0]==input1 && sections[j][1]==input2)
            {
                printf("\nSection chosen: W%lfx%lf \n\n",sections[j][0], sections[j][1]);
                input3 = j;
                j = 0;
                break;
            }

        printf("Is one end not supported?\nPRESS 1 FOR YES\nPRESS 2 FOR NO: ");
        scanf("%d",&select2);
        printf("Are two ends not supported?\nPRESS 1 FOR YES\nPRESS 2 FOR NO: ");
        scanf("%d",&select3);

        printf("Enter lower column or beam section W ? x ?:\n");
        printf("?1:");
        scanf("%lf",&input4);
        printf("?2:");
        scanf("%lf",&input5);
        for (j=0;j<203;j++)
            if (sections[j][0]==input4 && sections[j][1]==input5)
            {
                printf("\nSection chosen: W%lfx%lf \n\n",sections[j][0], sections[j][1]);
                input6 = j;
                j = 0;
                break;
            }

            if (select == 1)
        {
            K = 1;
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2)
        {
            K = (3*100000*10+1.4*(100000+10)+0.64)/(3*100000*10+2*(100000+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 2)
        {
            K = (3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+10)+0.64)/(3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 2)
        {
            K = (3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu)))+0.64)/(3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu)))+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 1)
        {
            K = (3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+10)+0.64)/(3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 1)
        {
            K = (3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+0.64)/(3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
         else if (select == 4 && select3 == 1)
        {
            K = (3*(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+1.4*((((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+0.64)/(3*(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+2*((((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }

        sectionselectholder = sectionselect;

        system("pause");

    }

}

    return;
}
BeamColumnDesign.h
/**************************************************************************************************/
/*               File Name: BeamColumnDesign.h               Written by: Koral Eren               */
/**************************************************************************************************/
void BeamColumnDesign (void);
BeamDesign.c
/********************************************************************************************/
/*               File Name: BeamDesign.c               Written by: Koral Eren               */
/********************************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>

#include "BeamDesign.h"

void BeamDesign (void)
{
    /***********************FILE READER**************************/
     FILE *fp;
  double sections1D [2842];
  double value;
  int i = -1;

  if ((fp = fopen ("Sections.txt", "r")) == NULL)
  {
      printf("Can't find the Sections file called Sections");
      return;
  }


  while (!feof (fp) && fscanf (fp, "%lf", &value) && i++ < 2841)
    sections1D [i] = value;

  fclose (fp);

  int j;
  double sections [203][14];

  for (j=0;j<203;j++)
    for (i=0;i<14;i++)
        sections[j][i]=sections1D[i+(14*(j))];
/***********************FILE READER****************************/

    int flangeclass;
    int webclass;
    int shapeclass;
    double Mf;
    double L, Lu;
    double Vr;
    double Mr0;
    double Mr, Mmax, Ma, Mb, Mc, w2, Mu, G = 77000, PI = 3.141593;
    double massselect = 10000;
    int sectionselect = 0, sectionselectholder = 0;
    double Gu, Gl;

    printf("Enter Mf (kNm - Max factored moment applied on the beam):");
    scanf("%lf",&Mf);

    printf("Enter L (mm - Unsupported length of the beam to be designed):");
    scanf("%lf",&L);

    printf("Enter Lu (mm - Unsupported length of the columns around the beam):");
    scanf("%lf",&Lu);

    printf("\nPREELIMINARY (ASSUMPTION) K CALCULATION:\n");

    double input1, input2, K;
    int select, select2, select3, input3;

    printf("The following calculations are for sidesway prevented frames:\n");
    printf("If BOTH ends are PINNED | PRESS 1:\n");
    printf("If LEFT end is PINNED and RIGHT end IS FIXED | PRESS 2:\n");
    printf("If LEFT end is FIXED and RIGHT end IS PINNED | PRESS 3:\n");
    printf("If BOTH ends are FIXED | PRESS 4:\n");
    scanf("%d",&select);

    if (select == 1)
    {
        K = 1;
        printf("K = %lf\n\n", K);
    }
    else if (select == 2)
    {
        K = 0.80;
        printf("K = %lf\n\n", K);
    }
    else if (select == 3)
    {
        K = 0.80;
        printf("K = %lf\n\n", K);
    }
    else if (select == 4)
    {
        K = 0.65;
        printf("K = %lf\n\n", K);
    }

        printf("w2 for LATERALLY UNSUPPORTED LENGTH Mr (knM) CALCULATION:\n");

        printf("Enter maximum moment (Mmax) kNm - no negative-: ");
        scanf("%lf",&Mmax);
        printf("Enter moment at 1/4 of unbraced segment (Ma) kNm: ");
        scanf("%lf",&Ma);
        printf("Enter moment at 2/4 of unbraced segment (Mb) kNm: ");
        scanf("%lf",&Mb);
        printf("Enter moment at 3/4 of unbraced segment (Mc) kNm: ");
        scanf("%lf",&Mc);

        w2 = (4*Mmax)/sqrt(pow(Mmax,2)+4*pow(Ma,2)+7*pow(Mb,2)+4*pow(Mc,2));

        if (w2 <= 2.5)
            printf("\nw2: %lf\n\n", w2);
        else
            printf("\nWARNING W2 > 2.5\n\n");

        system("pause");


    for (j=0;j<203;j++)
{
    sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 340/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= 1100/sqrt(350))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1100/sqrt(350)));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= 1700/sqrt(350))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1700/sqrt(350)));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= 1900/sqrt(350))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

    printf("FACTORED SHEAR RESISTANCE (Vr) CHECK:\n");

    Vr = 0.90*0.66*0.001*350*sections[j][9]*sections[j][12];

    printf("Assuming unstiffened webs Vr = %lf kN\n", Vr);

    printf("0 UNSUPPORTED LENGTH Mr0 (knM) CALCULATION:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

    printf("LATERALLY UNSUPPORTED LENGTH Mr (knM) CALCULATION:\n");

    Mu = 0.000001*(w2*PI/(K*L))*sqrt((200000*G*sections[j][6]*pow(10,6)*sections[j][7]*pow(10,3))+pow(((PI*200000)/(K*L)),2)*sections[j][6]*pow(10,6)*sections[j][8]*pow(10,9));
    printf("\nMu: %lf kNm\n", Mu);


    if(Mu > (0.67*Mr0/0.90))
    {
        Mr = 1.15*Mr0*(1-((0.28/0.90)*Mr0)/Mu);
        if (Mr > Mr0)
            Mr = Mr0;
    }
    else if (Mu <= (0.67*Mr0/0.90))
        Mr = 0.90*Mu;

    printf("\nMr: %lf kNm\n", Mr);

    if (Mr>Mf /*&& sections[j][0]<400*/ && shapeclass<4 && massselect>=sections[j][1])
    {
        sectionselect = j;
        massselect = sections[j][1];
    }

    printf("\n\nSection selected = W%lfx%lf\n\n", sections[sectionselect][0], sections[sectionselect][1]);

    if (j==202)
    {
        if (sectionselectholder == sectionselect)
        {
            printf("\n\nFinal Section chosen is: W%lfx%lf\n",sections[sectionselectholder][0], sections[sectionselectholder][1]);
            if (shapeclass == 4)
                printf("\n\nWarning CLASS 4 CHOSEN!\n\n");

                j = sectionselectholder;

                sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 340/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= 1100/sqrt(350))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1100/sqrt(350)));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= 1700/sqrt(350))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1700/sqrt(350)));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= 1900/sqrt(350))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

    printf("FACTORED SHEAR RESISTANCE (Vr) CHECK:\n");

    Vr = 0.90*0.66*0.001*350*sections[j][9]*sections[j][12];

    printf("Assuming unstiffened webs Vr = %lf kN\n", Vr);

    printf("0 UNSUPPORTED LENGTH Mr0 (knM) CALCULATION:\n");

    if (shapeclass == 1 || shapeclass == 2)
    {
        Mr0 = 0.90*sections[j][5]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }
    else if (shapeclass == 3)
    {
        Mr0 = 0.90*sections[j][4]*350*0.000001*1000;
        printf ("Mr0 = %lf kNm\n", Mr0);
    }

    printf("LATERALLY UNSUPPORTED LENGTH Mr (knM) CALCULATION:\n");

    Mu = 0.000001*(w2*PI/(K*L))*sqrt((200000*G*sections[j][6]*pow(10,6)*sections[j][7]*pow(10,3))+pow(((PI*200000)/(K*L)),2)*sections[j][6]*pow(10,6)*sections[j][8]*pow(10,9));
    printf("\nMu: %lf kNm\n", Mu);


    if(Mu > (0.67*Mr0/0.90))
    {
        Mr = 1.15*Mr0*(1-((0.28/0.90)*Mr0)/Mu);
        if (Mr > Mr0)
            Mr = Mr0;
    }
    else if (Mu <= (0.67*Mr0/0.90))
        Mr = 0.90*Mu;

    printf("\nMr: %lf kNm\n", Mr);

            return;
        }
        printf("\n\nEnter column sections:\n\n");
        printf("Enter column section W ? x ?:\n");
        printf("?1:");
        scanf("%lf",&input1);
        printf("?2:");
        scanf("%lf",&input2);
        for (j=0;j<203;j++)
            if (sections[j][0]==input1 && sections[j][1]==input2)
            {
                printf("\nSection chosen: W%lfx%lf \n\n",sections[j][0], sections[j][1]);
                input3 = j;
                j = 0;
                break;
            }

        printf("Is LEFT or RIGHT end not supported?\nPRESS 1 FOR NO\nPRESS 2 FOR YES: ");
        scanf("%d",&select2);
        printf("Is LOWER or UPPER end not supported?\nPRESS 1 FOR NO\nPRESS 2 FOR YES: ");
        scanf("%d",&select3);


            if (select == 1)
        {
            K = 1;
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2 && select2 == 1 && select3 == 1)
        {
            Gu = (2*sections [sectionselect][6]*pow(10,6)/L)/(2*sections[input3][3]*pow(10,6)/Lu);
            Gl = 100000;
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2 && select2 == 2 && select3 == 1)
        {
            Gu = (sections [sectionselect][6]*pow(10,6)/L)/(2*sections [input3][3]*pow(10,6)/Lu);
            Gl = 100000;
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2 && select2 == 1 && select3 == 2)
        {
            Gu = (2*sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            Gl = 100000;
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2 && select2 == 2 && select3 == 2)
        {
            Gl = (sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            Gu = 100000;
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 1 && select3 == 1)
        {
            Gu = 100000;
            Gl = (2*sections [sectionselect][6]*pow(10,6)/L)/(2*sections[input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 2 && select3 == 1)
        {
            Gu = 100000;
            Gl = (sections [sectionselect][6]*pow(10,6)/L)/(2*sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 1 && select3 == 2)
        {
            Gu = 100000;
            Gl = (2*sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 2 && select3 == 2)
        {
            Gl = 100000;
            Gu = (sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 1 && select3 == 1)
        {
            Gu = (2*sections [sectionselect][6]*pow(10,6)/L)/(2*sections[input3][3]*pow(10,6)/Lu);
            Gl = (2*sections [sectionselect][6]*pow(10,6)/L)/(2*sections[input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 2 && select3 == 1)
        {
            Gu = (sections [sectionselect][6]*pow(10,6)/L)/(2*sections [input3][3]*pow(10,6)/Lu);
            Gl = (sections [sectionselect][6]*pow(10,6)/L)/(2*sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 1 && select3 == 2)
        {
            Gu = (2*sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            Gl = (2*sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 2 && select3 == 2)
        {
            Gl = (sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            Gu = (sections [sectionselect][6]*pow(10,6)/L)/(sections [input3][3]*pow(10,6)/Lu);
            K = (3*Gu*Gl+1.4*(Gu+Gl)+0.64)/(3*Gu*Gl+2*(Gu+Gl)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }

        sectionselectholder = sectionselect;

        system("pause");

    }
}


    return;
}
BeamDesign.h
/********************************************************************************************/
/*               File Name: BeamDesign.h               Written by: Koral Eren               */
/********************************************************************************************/
void BeamDesign (void);
ColumnDesign.c
/**********************************************************************************************/
/*               File Name: ColumnDesign.c               Written by: Koral Eren               */
/**********************************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>

#include "ColumnDesign.h"

void ColumnDesign (void)
{
  /***********************FILE READER**************************/
     FILE *fp;
  double sections1D [2842];
  double value;
  int i = -1;

  if ((fp = fopen ("Sections.txt", "r")) == NULL)
  {
      printf("Can't find the Sections file called Sections");
      return;
  }


  while (!feof (fp) && fscanf (fp, "%lf", &value) && i++ < 2841)
    sections1D [i] = value;

  fclose (fp);

  int j;
  double sections [203][14];

  for (j=0;j<203;j++)
    for (i=0;i<14;i++)
        sections[j][i]=sections1D[i+(14*(j))];
/***********************FILE READER****************************/

    int flangeclass;
    int webclass;
    int shapeclass;
    double Cf;
    double slendernessratio, L, Lu;
    double E = 200000;
    double PI = 3.141593;
    double Fe, Lambda, n = 1.34, Cr;
    double massselect = 10000;
    int sectionselect = 0, sectionselectholder = 0;

printf("Enter Cf (kN - Max Compressive axial force the column has to carry):");
scanf("%lf",&Cf);

printf("Enter L (mm - Length of the column to be designed):");
scanf("%lf",&L);

printf("Enter Lu (mm - Unsupported length of the beams around column):");
scanf("%lf",&Lu);

printf("\nPREELIMINARY (ASSUMPTION) K CALCULATION:\n");

    double input1, input2, input4, input5, K;
    int select, select2, input3, input6 = 0;

    printf("The following calculations are for sidesway prevented frames:\n");
    printf("If BOTH ends are PINNED and not connected to ground PRESS 1:\n");
    printf("If LOWER end is pinned to the GROUND and UPPER END IS PINNED PRESS 2:\n");
    printf("If LOWER end is pinned to the GROUND and UPPER END IS FIXED PRESS 3:\n");
    printf("If BOTH ends are FIXED and not connected to ground PRESS 4:\n");
    scanf("%d",&select);

    if (select == 1)
    {
        K = 1;
        printf("K = %lf\n\n", K);
    }
    else if (select == 2)
    {
        K = (3*100000*10+1.4*(100000+10)+0.64)/(3*100000*10+2*(100000+10)+1.28);
        printf("K = %lf\n\n", K);
    }
    else if (select == 3)
    {
        K = 0.80;
        printf("K = %lf\n\n", K);
    }
    else if (select == 4)
    {
        K = 0.65;
        printf("K = %lf\n\n", K);
    }


for (j=0;j<203;j++)
{
    sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 340/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= 1100/sqrt(350))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1100/sqrt(350)));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= 1700/sqrt(350))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1700/sqrt(350)));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= 1900/sqrt(350))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

     printf("SLENDERNESS RATIO CHECK:\n");

    slendernessratio = (K*L)/sqrt((sections [j][6]*pow(10,6))/sections [j][2]);
    printf("Iy: %lf x 10^6\nArea: %lf",sections [j][6], sections [j][2] );
    if (slendernessratio < 200)
        printf("\nslenderness ratio: %lf < 200 - OK\n", slendernessratio);
    else
        printf("\nslenderness ratio: %lf >= 200 - FAIL\n", slendernessratio);

     printf("AXIAL COMPRESSIVE RESISTANCE CALCULATION:\n");

    PI = 3.141593;

    Fe = (((pow(PI,2))*E)/pow(slendernessratio,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Cr = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Cr (factored axial compressive resistance) = %lf kN\n", Cr);

    if (Cr>Cf /*&& sections[j][0]<400*/ && slendernessratio<200 && shapeclass<4 && massselect>=sections[j][1])
    {
        sectionselect = j;
        massselect = sections[j][1];
    }

    printf("\n\nSection selected = W%lfx%lf\n\n", sections[sectionselect][0], sections[sectionselect][1]);


    if (j==202)
    {
        if (sectionselectholder == sectionselect)
        {
            printf("\n\nFinal Section chosen is: W%lfx%lf\n",sections[sectionselectholder][0], sections[sectionselectholder][1]);
            if (shapeclass == 4)
                printf("\n\nWarning CLASS 4 CHOSEN!\n\n");

                j = sectionselectholder;

             sections [j][10] = sections [j][10]/2;

    printf("CLASS CHECK:\n");

    if (sections [j][10]/sections [j][11] <= 145/sqrt(350))
    {
        printf("CLASS 1 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (145/sqrt(350)));
        flangeclass = 1;
    }
    else if (sections [j][10]/sections [j][11] <= 170/sqrt(350))
    {
        printf("CLASS 2 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (170/sqrt(350)));
        flangeclass = 2;
    }
    else if (sections [j][10]/sections [j][11] <= 340/sqrt(350))
    {
        printf("CLASS 3 Flange\n");
        printf("%lf<=%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 3;
    }
    else
    {
        printf("CLASS 4 Flange\n");
        printf("%lf>%lf\n",(sections [j][10]/sections [j][11]), (340/sqrt(350)));
        flangeclass = 4;
    }

    if (sections [j][13]/sections [j][12] <= 1100/sqrt(350))
    {
        printf("CLASS 1 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1100/sqrt(350)));
        webclass = 1;
    }
    else if (sections [j][13]/sections [j][12] <= 1700/sqrt(350))
    {
        printf("CLASS 2 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1700/sqrt(350)));
        webclass = 2;
    }
    else if (sections [j][13]/sections [j][12] <= 1900/sqrt(350))
    {
        printf("CLASS 3 Web\n");
        printf("%lf<=%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 3;
    }
    else
    {
        printf("CLASS 4 Web\n");
        printf("%lf>%lf\n",(sections [j][13]/sections [j][12]), (1900/sqrt(350)));
        webclass = 4;
    }

    if (webclass>flangeclass)
        shapeclass = webclass;
    else
        shapeclass = flangeclass;

    printf("shapeclass: %d\n", shapeclass);

    sections [j][10] = sections [j][10]*2;

     printf("SLENDERNESS RATIO CHECK:\n");

    slendernessratio = (K*L)/sqrt((sections [j][6]*pow(10,6))/sections [j][2]);
    printf("Iy: %lf x 10^6\nArea: %lf",sections [j][6], sections [j][2] );
    if (slendernessratio < 200)
        printf("\nslenderness ratio: %lf < 200 - OK\n", slendernessratio);
    else
        printf("\nslenderness ratio: %lf >= 200 - FAIL\n", slendernessratio);

     printf("AXIAL COMPRESSIVE RESISTANCE CALCULATION:\n");

    PI = 3.141593;

    Fe = (((pow(PI,2))*E)/pow(slendernessratio,2));
    printf("Fe = %lf MPa\n", Fe);

    Lambda = sqrt(350/Fe);

    Cr = 0.001*0.90*sections[j][2]*350/pow((1+pow(Lambda,(2*n))),(1/n));
    printf("Cr (factored axial compressive resistance) = %lf kN\n", Cr);

            return;
        }
        printf("\nEnter beam sections:\n");
        printf("Enter upper beam section W ? x ?:\n");
        printf("?1:");
        scanf("%lf",&input1);
        printf("?2:");
        scanf("%lf",&input2);
        for (j=0;j<203;j++)
            if (sections[j][0]==input1 && sections[j][1]==input2)
            {
                printf("\nSection chosen: W%lfx%lf \n\n",sections[j][0], sections[j][1]);
                input3 = j;
                j = 0;
                break;
            }

        printf("Is one end not supported?\nPRESS 1 FOR YES\nPRESS 2 FOR NO: ");
        scanf("%d",&select2);

        printf("Enter lower beam section W ? x ?:\n");
        printf("?1:");
        scanf("%lf",&input4);
        printf("?2:");
        scanf("%lf",&input5);
        for (j=0;j<203;j++)
            if (sections[j][0]==input4 && sections[j][1]==input5)
            {
                printf("\nSection chosen: W%lfx%lf \n\n",sections[j][0], sections[j][1]);
                input6 = j;
                j = 0;
                break;
            }

            if (select == 1)
        {
            K = 1;
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 2)
        {
            K = (3*100000*10+1.4*(100000+10)+0.64)/(3*100000*10+2*(100000+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 2)
        {
            K = (3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+10)+0.64)/(3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 2)
        {
            K = (3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu)))+0.64)/(3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((2*sections[input6][3]*pow(10,6))/Lu)))+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 3 && select2 == 1)
        {
            K = (3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+10)+0.64)/(3*10*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+10)+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }
        else if (select == 4 && select2 == 1)
        {
            K = (3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+1.4*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+0.64)/(3*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu))*(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+2*((((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input3][3]*pow(10,6))/Lu))+(((2*sections[sectionselect][6]*pow(10,6))/3500)/((sections[input6][3]*pow(10,6))/Lu)))+1.28);
            printf("K = %lf\n\n", K);
            j = 0;
        }

        sectionselectholder = sectionselect;

        system("pause");

    }
}
  return;
}
ColumnDesign.h
/**********************************************************************************************/
/*               File Name: ColumnDesign.h               Written by: Koral Eren               */
/**********************************************************************************************/
void ColumnDesign (void);
main.c
/**************************************************************************************/
/*               File Name: main.c               Written by: Koral Eren               */
/**************************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>

#include "BeamColumnDesign.h"
#include "BeamDesign.h"
#include "ColumnDesign.h"

int main ( void )
{
  int choice=0, i;
  while(choice!='4')
  {
    printf("\n      DESIGN SOFTWARE KORAL\n");
    for(i=0;i<33;i++)
        printf("*");
    printf("\nPRESS 1 FOR COLUMN DESIGN");
    printf("\nPRESS 2 FOR BEAM DESIGN");
    printf("\nPRESS 3 FOR BEAM-COLUMN DESIGN");
    printf("\nPRESS 4 TO EXIT");
    printf("\nEnter Your Choice: ");
    choice = getche();
    switch(choice)
    {
    case '1':
      printf("\nYOU SELECTED COLUMN DESIGN\n\n\n");
      ColumnDesign ();
      printf("\n\n\n");
      system("pause");
      system("cls");
      break;
    case '2':
      printf("\nYOU SELECTED BEAM DESIGN\n\n\n");
      BeamDesign ();
      printf("\n\n\n");
      system("pause");
      system("cls");
      break;
    case '3':
      printf("\nYOU SELECTED BEAM COLUMN DESIGN\n\n\n");
      BeamColumnDesign ();
      printf("\n\n\n");
      system("pause");
      system("cls");
      break;
    case '4':
      printf("\nYOU SELECTED EXIT\n\n\n");
      break;
    default:
      printf("\n\nINVALID SELECTION...Please try again\n");
    }
  }
  return EXIT_SUCCESS;
}
Sections.txt
690                         802		102000	10600	25700	30900	875	206000	119000	826	387	89.9	50	89.9
690                         548		69900	6730	17400	20400	543	70700	68200	772	372	63	35.1	63
690                         500		63800	6060	15900	18500	487	54600	60300	762	369	57.9	32	57.9
690                         457		58400	5470	14500	16800	439	42300	53600	752	367	53.1	29.5	53.1
690                         419		53400	4950	13300	15300	395	33000	47700	744	364	49	26.9	49
690                         384		49000	4490	12200	14000	357	25700	42600	736	362	45	24.9	45
690                         350		44700	4030	11100	12600	319	19500	37600	728	360	40.9	23.1	40.9
690                         323		41300	3710	10300	11700	294	15700	34400	722	359	38.1	21.1	38.1
690                         289		36800	3260	9140	10300	256	11200	29600	714	356	34	19	34
690                         265		33800	2920	8270	9330	231	8340	26400	706	358	30.2	18.4	30.2
690                         240		30700	2630	7490	8430	206	6270	23400	701	356	27.4	16.8	27.4
690                         217		27900	2360	6790	7610	185	4720	20800	695	355	24.8	15.4	24.8
690                         192		24400	1980	5640	6460	76.4	4620	8680	702	254	27.9	15.5	27.9
690                         170		21600	1700	4910	5620	66.2	3050	7410	693	256	23.6	14.5	23.6
690                         152		19400	1510	4380	5000	57.8	2200	6420	688	254	21.1	13.1	21.1
690                         140		17800	1360	3980	4550	51.7	1670	5720	684	254	18.9	12.4	18.9
690                         125		16000	1190	3500	4010	44.1	1180	4830	678	253	16.3	11.7	16.3
610                         551		70200	5570	15700	18600	484	83800	49900	711	347	69.1	38.6	69.1
610                         498		63500	4950	14200	16700	426	63200	43100	699	343	63	35.1	63
610                         455		57900	4440	12900	15100	381	48800	37900	689	340	57.9	32	57.9
610                         415		52900	4000	11800	13700	343	37700	33600	679	338	53.1	29.5	53.1
610                         372		47400	3530	10600	12200	302	27700	29100	669	335	48	26.4	48
610                         341		43400	3180	9630	11100	271	21300	25800	661	333	43.9	24.4	43.9
610                         307		39100	2840	8690	9930	240	15900	22500	653	330	39.9	22.1	39.9
610                         285		36300	2610	8060	9170	221	12800	20500	647	329	37.1	20.6	37.1
610                         262		33300	2360	7360	8350	198	9900	18300	641	327	34	19	34
610                         241		30800	2150	6780	7670	184	7700	16800	635	329	31	17.9	31
610                         217		27800	1910	6070	6850	163	5600	14700	628	328	27.7	16.5	27.7
610                         195		24900	1680	5400	6070	142	3970	12700	622	327	24.4	15.4	24.4
610                         174		22200	1470	4780	5360	124	2800	10900	616	325	21.6	14	21.6
610                         155		19700	1290	4220	4730	108	1950	9450	611	324	19	12.7	19
610                         153		19600	1250	4020	4600	50	2950	4470	623	229	24.9	14	24.9
610                         140		17900	1120	3630	4150	45.1	2180	3990	617	230	22.2	13.1	22.2
610                         125		15900	985	3220	3670	39.3	1540	3450	612	229	19.6	11.9	19.6
610                         113		14400	875	2880	3290	34.3	1120	2990	608	228	17.3	11.2	17.3
610                         101		13000	764	2530	2900	29.5	781	2550	603	228	14.9	10.5	14.9
610                         91		11500	657	2200	2520	24.8	531	2120	598	227	12.7	9.7	12.7
610                         84		10600	603	2020	2320	22.6	420	1920	596	226	11.7	9	11.7
610                         92		11800	651	2160	2530	14.4	738	1250	603	179	15	10.9	15
610                         82		10500	565	1880	2210	12.1	510	1040	599	178	12.8	10	12.8
530                         300		38200	2210	7550	8670	225	17000	16600	585	319	41.4	23.1	41.4
530                         272		34600	1970	6840	7810	202	12800	14700	577	318	37.6	21.1	37.6
530                         248		31400	1770	6220	7060	180	9770	13000	571	315	34.5	19	34.5
530                         219		27900	1510	5390	6110	157	6420	11000	560	318	29.2	18.3	29.2
530                         196		25000	1340	4840	5460	139	4700	9640	554	316	26.3	16.5	26.3
530                         182		23100	1240	4480	5040	127	3740	8820	551	315	24.4	15.2	24.4
530                         165		21100	1110	4060	4550	114	2830	7790	546	313	22.2	14	22.2
530                         150		19200	1010	3710	4150	103	2160	7030	543	312	20.3	12.7	20.3
530                         138		17600	861	3140	3610	38.7	2500	2670	549	214	23.6	14.7	23.6
530                         123		15700	761	2800	3210	33.8	1800	2310	544	212	21.2	13.1	21.2
530                         109		13900	667	2480	2830	29.5	1260	2000	539	211	18.8	11.6	18.8
530                         101		12900	617	2300	2620	26.9	1020	1820	537	210	17.4	10.9	17.4
530                         92		11800	552	2070	2360	23.8	762	1590	533	209	15.6	10.2	15.6
530                         82		10500	477	1810	2060	20.3	518	1340	528	209	13.3	9.5	13.3
530                         72		9120	400	1520	1750	16.2	334	1060	524	207	10.9	8.9	10.9
530                         85		10800	485	1810	2100	12.6	737	849	535	166	16.5	10.3	16.5
530                         74		9520	411	1550	1810	10.4	480	692	529	166	13.6	9.7	13.6
530                         66		8370	351	1340	1560	8.57	320	565	525	165	11.4	8.9	11.4
460                         464		59100	2900	10200	12400	331	73100	20500	567	305	69.6	38.6	69.6
460                         421		53700	2570	9250	11100	293	55700	17700	555	302	63.5	35.6	63.5
460                         384		48900	2290	8420	10000	261	42700	15500	545	299	58.4	32.5	58.4
460                         349		44400	2040	7640	9010	233	32800	13500	535	296	53.6	29.5	53.6
460                         315		40000	1800	6850	8020	204	24300	11600	525	293	48.5	26.9	48.5
460                         286		36400	1610	6230	7240	183	18600	10200	517	291	44.4	24.4	44.4
460                         260		33100	1440	5650	6530	163	14100	8950	509	289	40.4	22.6	40.4
460                         235		29900	1270	5080	5840	145	10500	7790	501	287	36.6	20.6	36.6
460                         213		27100	1140	4620	5270	129	7970	6890	495	285	33.5	18.5	33.5
460                         193		24600	1020	4190	4750	115	6030	6060	489	283	30.5	17	30.5
460                         177		22600	910	3780	4280	105	4410	5440	482	286	26.9	16.6	26.9
460                         158		20100	796	3350	3780	91.4	3120	4670	476	284	23.9	15	23.9
460                         144		18400	726	3080	3450	83.6	2440	4230	472	283	22.1	13.6	22.1
460                         128		16400	637	2730	3050	73.3	1720	3670	467	282	19.6	12.2	19.6
460                         113		14400	556	2400	2670	63.3	1180	3150	463	280	17.3	10.8	17.3
460                         106		13500	488	2080	2390	25.1	1460	1260	469	194	20.6	12.6	20.6
460                         97		12300	445	1910	2180	22.8	1130	1140	466	193	19	11.4	19
460                         89		11400	410	1770	2010	20.9	907	1040	463	192	17.7	10.5	17.7
460                         82		10400	370	1610	1830	18.6	691	918	460	191	16	9.9	16
460                         74		9450	333	1460	1650	16.6	517	813	457	190	14.5	9	14.5
460                         67		8560	295	1300	1470	14.5	372	708	454	190	12.7	8.5	12.7
460                         61		7640	254	1130	1290	12.2	256	587	450	189	10.8	8.1	10.8
460                         68		8730	297	1290	1490	9.41	509	463	459	154	15.4	9.1	15.4
460                         60		7590	255	1120	1280	7.96	335	388	455	153	13.3	8	13.3
460                         52		6630	212	943	1090	6.34	210	306	450	152	10.8	7.6	10.8
410                         149		19200	625	2900	3280	77.7	3420	3200	431	265	25	14.9	25
410                         132		17000	545	2560	2890	67.4	2410	2730	425	263	22.2	13.3	22.2
410                         114		14800	468	2230	2490	57.3	1610	2300	420	261	19.3	11.6	19.3
410                         100		12900	404	1950	2160	49.6	1090	1960	415	260	16.9	10	16.9
410                         85		10800	315	1510	1730	18	926	717	417	181	18.2	10.9	18.2
410                         74		9550	275	1330	1510	15.6	637	614	413	180	16	9.7	16
410                         67		8600	246	1200	1360	13.8	469	540	410	179	14.4	8.8	14.4
410                         60		7580	216	1060	1190	12	328	468	407	178	12.8	7.7	12.8
410                         54		6810	186	924	1050	10.1	226	388	403	177	10.9	7.5	10.9
410                         46		5890	156	773	885	5.14	192	197	403	140	11.2	7	11.2
410                         39		4990	127	634	730	4.04	111	154	399	140	8.8	6.4	8.8
360                         1086	139000	5960	20900	27200	1960	605000	96700	569	454	125	78	125
360                         990		126000	5190	18900	24300	1730	469000	82000	550	448	115	71.9	115
360                         900		115000	4500	17000	21600	1530	364000	69200	531	442	106	65.9	106
360                         818		104000	3920	15300	19300	1360	279000	58900	514	437	97	60.5	97
360                         744		94800	3420	13700	17200	1200	214000	50200	498	432	88.9	55.6	88.9
360                         677		86300	2990	12400	15300	1070	165000	43100	483	428	81.5	51.2	81.5
360                         634		80800	2740	11600	14200	983	138000	38700	474	424	77.1	47.6	77.1
360                         592		75500	2500	10800	13100	902	114000	34800	465	421	72.3	45	72.3
360                         551		70100	2260	9940	12100	825	92500	31000	455	418	67.6	42	67.6
360                         509		64900	2050	9170	11000	754	74000	27700	446	416	62.7	39.1	62.7
360                         463		59000	1800	8280	9880	670	56500	23900	435	412	57.4	35.8	57.4
360                         421		53700	1600	7510	8880	601	43400	20800	425	409	52.6	32.8	52.6
360                         382		48700	1410	6790	7970	536	32900	18200	416	406	48	29.8	48
360                         347		44200	1250	6140	7140	481	24800	15900	407	404	43.7	27.2	43.7
360                         314		39900	1100	5530	6370	426	18500	13800	399	401	39.6	24.9	39.6
360                         287		36600	997	5070	5810	388	14500	12300	393	399	36.6	22.6	36.6
360                         262		33500	894	4620	5260	350	11100	11000	387	398	33.3	21.1	33.3
360                         237		30100	788	4150	4690	310	8190	9500	380	395	30.2	18.9	30.2
360                         216		27600	712	3790	4260	283	6330	8520	375	394	27.7	17.3	27.7
360                         196		25000	636	3420	3840	229	5140	6830	372	374	26.2	16.4	26.2
360                         179		22800	575	3120	3480	207	3910	6120	368	373	23.9	15	23.9
360                         162		20600	516	2830	3140	186	2940	5430	364	371	21.8	13.3	21.8
360                         147		18800	463	2570	2840	167	2230	4840	360	370	19.8	12.3	19.8
360                         134		17100	415	2330	2560	151	1680	4310	356	369	18	11.2	18
360                         122		15500	365	2010	2270	61.5	2110	1790	363	257	21.7	13	21.7
360                         110		14000	331	1840	2060	55.7	1600	1610	360	256	19.9	11.4	19.9
360                         101		12900	301	1690	1880	50.6	1250	1450	357	255	18.3	10.5	18.3
360                         91		11600	267	1510	1680	44.8	914	1270	353	254	16.4	9.5	16.4
360                         79		10100	226	1280	1430	24.2	811	687	354	205	16.8	9.4	16.8
360                         72		9100	201	1150	1280	21.4	601	600	350	204	15.1	8.6	15.1
360                         64		8140	178	1030	1140	18.8	436	524	347	203	13.5	7.7	13.5
360                         57		7220	161	897	1010	11.1	334	331	358	172	13.1	7.9	13.1
360                         51		6450	141	796	894	9.68	238	285	355	171	11.6	7.2	11.6
360                         45		5730	122	691	779	8.18	160	239	352	171	9.8	6.9	9.8
360                         39		4980	102	580	662	3.75	151	110	353	128	10.7	6.5	10.7
360                         33		4170	82.7	474	542	2.91	85.9	84.3	349	127	8.5	5.8	8.5
310                         500		63800	1690	7910	9880	494	101000	15300	427	340	75.1	45.1	75.1
310                         454		57800	1480	7130	8820	436	77200	13100	415	336	68.7	41.3	68.7
310                         415		52900	1300	6450	7900	391	59500	11300	403	334	62.7	38.9	62.7
310                         375		47700	1130	5770	7000	344	44900	9570	391	330	57.2	35.4	57.2
310                         342		43700	1010	5260	6330	310	34900	8420	382	328	52.6	32.6	52.6
310                         313		39900	896	4790	5720	277	27000	7350	374	325	48.3	30	48.3
310                         283		36000	787	4310	5100	246	20400	6330	365	322	44.1	26.9	44.1
310                         253		32200	682	3830	4490	215	14800	5370	356	319	39.6	24.4	39.6
310                         226		28900	596	3420	3980	189	10800	4620	348	317	35.6	22.1	35.6
310                         202		25800	520	3050	3510	166	7740	3960	341	315	31.8	20.1	31.8
310                         179		22800	445	2680	3050	144	5380	3340	333	313	28.1	18	28.1
310                         158		20100	386	2360	2670	125	3780	2840	327	310	25.1	15.5	25.1
310                         143		18200	348	2150	2420	113	2870	2540	323	309	22.9	14	22.9
310                         129		16500	308	1940	2160	100	2130	2220	318	308	20.6	13.1	20.6
310                         118		15000	275	1750	1950	90.2	1600	1970	314	307	18.7	11.9	18.7
310                         107		13600	248	1590	1770	81.2	1220	1760	311	306	17	10.9	17
310                         97		12300	222	1440	1590	72.9	912	1560	308	305	15.4	9.9	15.4
310                         86		11000	199	1280	1420	44.5	877	961	310	254	16.3	9.1	16.3
310                         79		10100	177	1160	1280	39.9	657	847	306	254	14.6	8.8	14.6
310                         74		9430	164	1060	1180	23.4	718	505	310	205	16.3	9.4	16.3
310                         67		8450	144	942	1050	20.7	522	439	306	204	14.6	8.5	14.6
310                         60		7530	128	842	933	18.3	378	384	303	203	13.1	7.5	13.1
310                         52		6670	119	750	841	10.3	308	238	318	167	13.2	7.6	13.2
310                         45		5690	99.2	634	708	8.55	191	195	313	166	11.2	6.6	11.2
310                         39		4940	85.1	549	610	7.27	126	164	310	165	9.7	5.8	9.7
310                         31		3930	65.4	428	476	5.44	61.3	121	306	164	7.4	5	7.4
310                         33		4180	65	415	480	1.92	122	43.8	313	102	10.8	6.6	10.8
310                         28		3610	54.3	351	407	1.58	75.7	35.6	309	102	8.9	6	8.9
310                         24		3040	42.7	280	328	1.16	42.5	25.7	305	101	6.7	5.6	6.7
310                         21		2690	37	244	287	0.983	29.4	21.7	303	101	5.7	5.1	5.7
250                         167		21300	300	2080	2430	98.8	6310	1630	289	265	31.8	19.2	31.8
250                         149		19000	259	1840	2130	86.2	4510	1390	282	263	28.4	17.3	28.4
250                         131		16700	221	1610	1850	74.5	3120	1160	275	261	25.1	15.4	25.1
250                         115		14600	189	1410	1600	64.1	2130	976	269	259	22.1	13.5	22.1
250                         101		12900	164	1240	1400	55.5	1490	829	264	257	19.6	11.9	19.6
250                         89		11400	143	1100	1230	48.4	1040	713	260	256	17.3	10.7	17.3
250                         80		10200	126	982	1090	43.1	757	623	256	255	15.6	9.4	15.6
250                         73		9280	113	891	985	38.8	575	553	253	254	14.2	8.6	14.2
250                         67		8550	104	806	901	22.2	625	324	257	204	15.7	8.9	15.7
250                         58		7420	87.3	693	770	18.8	409	268	252	203	13.5	8	13.5
250                         49		6250	70.6	572	633	15.1	241	211	247	202	11	7.4	11
250                         45		5720	71.1	534	602	7.03	261	113	266	148	13	7.6	13
250                         39		4920	60.1	459	513	5.94	169	93.4	262	147	11.2	6.6	11.2
250                         33		4170	48.9	379	424	4.73	98.5	73.2	258	146	9.1	6.1	9.1
250                         24		3110	34.7	274	307	3.26	39.7	49.5	253	145	6.4	5	6.4
250                         28		3630	40	307	353	1.78	96.7	27.7	260	102	10	6.4	10
250                         25		3230	34.2	266	307	1.49	65.2	23	257	102	8.4	6.1	8.4
250                         22		2850	28.9	227	263	1.23	43.4	18.7	254	102	6.9	5.8	6.9
250                         18		2270	22.4	179	207	0.913	22.4	13.8	251	101	5.3	4.8	5.3
200                         100		12700	113	989	1150	36.6	2090	386	229	210	23.7	14.5	23.7
200                         86		11000	94.7	853	981	31.4	1390	318	222	209	20.6	13	20.6
200                         71		9100	76.6	709	803	25.4	817	250	216	206	17.4	10.2	17.4
200                         59		7560	61.1	582	653	20.4	463	196	210	205	14.2	9.1	14.2
200                         52		6650	52.7	512	569	17.8	323	167	206	204	12.6	7.9	12.6
200                         46		5860	45.4	448	495	15.3	220	141	203	203	11	7.2	11
200                         42		5310	40.9	399	445	9	222	84	205	166	11.8	7.2	11.8
200                         36		4570	34.4	342	379	7.64	145	69.6	201	165	10.2	6.2	10.2
200                         31		4000	31.4	299	335	4.1	119	40.9	210	134	10.2	6.4	10.2
200                         27		3390	25.8	249	279	3.3	71.3	32.5	207	133	8.4	5.8	8.4
200                         21		2700	19.8	195	217	2.51	35.6	24.3	203	133	6.4	5	6.4
200                         22		2860	20	194	222	1.42	56.6	13.9	206	102	8	6.2	8
200                         19		2480	16.6	163	187	1.15	36.2	11.1	203	102	6.5	5.8	6.5
200                         15		1900	12.7	127	145	0.869	17.6	8.24	200	100	5.2	4.3	5.2
150                         37		4750	22.3	275	311	7.07	197	40	162	154	11.6	8.1	11.6
150                         30		3810	17.2	219	245	5.56	103	30.3	157	153	9.3	6.6	9.3
150                         22		2860	12.1	160	177	3.87	43.4	20.4	152	152	6.6	5.8	6.6
150                         24		3060	13.4	168	192	1.83	93.1	10.2	160	102	10.3	6.6	10.3
150                         18		2290	9.17	120	136	1.26	37.4	6.7	153	102	7.1	5.8	7.1
150                         14		1730	6.87	91.6	103	0.918	17.1	4.79	150	100	5.5	4.3	5.5
150                         13		1610	6.13	82.8	93	0.818	13.6	4.19	148	100	4.9	4.3	4.9
130                         28		3590	11	168	191	3.81	131	13.8	131	128	10.9	6.9	10.9
130                         24		3020	8.84	139	157	3.11	79.1	10.8	127	127	9.1	6.1	9.1
100                         19		2480	4.77	89.9	103	1.61	63.6	3.79	106	103	8.8	7.1	8.8