Esempio n. 1
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()



    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('Pythagorean Theorem Calculator')

    DescriptionHead("Takes the two side lengths of a right triangle and calculates the length of the hypotenuse")

    Assumption("Right triangle")
    Assumption("Measured in inches")

    a = DeclareVariable('A', 333, 'in', 'Length of side A')
    b = DeclareVariable('B', 444, 'in', 'Length of side B')


    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input)>0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###


    c = CalcVariable('C', SQRT(POW(a,2) + POW(b,2)), 'in', result_check=True)

    c2 = CalcVariable('C_2', 2*c, 'in', result_check=True)

    # c = CalcVariable('C', SQRT(POW(a,2) + POW(a,2)), 'in', result_check=True)
    #
    # c2 = CalcVariable('C_2', 4*c, 'in', result_check=True)





    calculation_sum = {'head':HeadCollection.head_instances, 'assum': AssumCollection.assum_instances, 'setup':SetupCollection.setup_instances, 'calc':CalcCollection.calc_instances, 'foot':FootCollection.foot_instances}
    return calculation_sum
Esempio n. 2
0
    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            if new_value := updated_input.get(input_variable.name):
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')
    twelve_inches = Variable('12 \ \mathrm{in}', 12, 'in')

    BodyHeader('Tension Design', head_level=1)

    db = CalcVariable('d_b', Da / 8, 'in', 'Post-installed bar diameter')
    aa = CalcVariable('A_a',
                      PI * (db / 2)**2, 'in^2', 'Post-installed bar area')
    atot = CalcVariable('A_{stot}', aa * Na, 'in^2',
                        'Total steel area of post-installed bars')

    dbe = CalcVariable('d_{be}', Dae / 8, 'in', 'Existing bar diameter')
    aae = CalcVariable('A_{ae}',
                       PI * (dbe / 2)**2, 'in^2', 'Existing bar area')
    atote = CalcVariable('A_{stote}', aae * Na, 'in^2',
                         'Total steel area of existing bars')

    Lspe = CalcVariable(
        'L_{s,pe}', Le - ce, 'in',
        'Provided lap splice length between post-installed and existing bars')
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()

    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('Aluminum Stair Design')

    DescriptionHead(
        "Aluminum stairs designed in accordance with the Aluminum Design Manual."
    )

    ## SEE WOODBRIDGE CT. DESIGN DRAWINGS FOR GEOMETRY ASSUMPTIONS OF STAIR

    Assumption(
        "Aluminum Design Manual (ADM) 2015 version controls member design")
    Assumption("All aluminum sections share the same mechanical properties")
    Assumption("Temper requirements of ADM Table B.4.2 are met")
    Assumption("Cross sections are all unwelded")
    Assumption("Requirements of OSHA 1910.25 and ANSI 1264.1 are met")

    LL = DeclareVariable('LL', 40, 'psf',
                         'Live load on stairs (ASCE 7-16 Table 4.3-1)')
    LC = DeclareVariable(
        'LL_c', 300, 'lbs',
        'Concentrated load on stair elements (ASCE 7-16 Table 4.3-1)')
    DL = DeclareVariable('DL', 10, 'psf', 'Dead load of grating and misc.')
    Wtr = DeclareVariable('W_{tr}', 2.5, 'ft', 'Stair tread width')

    Wtp = DeclareVariable('W_{tp}', 6, 'ft',
                          'Width of top platform (perpendicular to stringer)')
    Ltp = DeclareVariable('L_{tp}', 5.5, 'ft',
                          'Length of top platform (parallel to stringer)')

    Ftu = DeclareVariable('F_{tu}',
                          38,
                          'ksi',
                          'Tensile ultimate strength',
                          code_ref='ADM Table A.3.3')
    Fty = DeclareVariable('F_{ty}',
                          35,
                          'ksi',
                          'Tensile yield strength',
                          code_ref='ADM Table A.3.3')
    Fcy = DeclareVariable('F_{cy}',
                          35,
                          'ksi',
                          'Compressive yield strength',
                          code_ref='ADM Table A.3.1')
    kt = DeclareVariable('k_t',
                         1,
                         '',
                         'Tension coefficient',
                         code_ref='ADM Table A.3.3')
    E = DeclareVariable('E',
                        10100,
                        'ksi',
                        'Modulus of Elasticity',
                        code_ref='ADM Table A.3.1')
    G = DeclareVariable('G',
                        3800,
                        'ksi',
                        'Shear modulus of elasticity',
                        code_ref='ADM Table A.3.1')

    Pby = DeclareVariable('\phi_{by}',
                          0.9,
                          '',
                          'Flexural resistance factor for yielding',
                          code_ref='ADM F.1')
    Pbr = DeclareVariable('\phi_{br}',
                          0.75,
                          '',
                          'Flexural resistance factor for rupture',
                          code_ref='ADM F.1')
    Pc = DeclareVariable('\phi_c',
                         0.9,
                         '',
                         'Resistance factor for compression',
                         code_ref='ADM E.1')
    dlim = DeclareVariable('X_{lim}', 360, '', 'Member deflection limit (L/X)')

    sizesc = DeclareVariable('Section_{sc}',
                             'C 8 X 4.25',
                             '',
                             'Stair stringer channel section size',
                             input_type='select',
                             input_options=alum_channel_sizes)
    Ksc = DeclareVariable('k_{sc}', 1, '',
                          'Stair stringer effective length factor')
    Lsc = DeclareVariable('L_{usc}', 12.75, 'ft',
                          'Unsupported length of stair stringer')
    Lbsc = DeclareVariable('L_{bsc}', 12.75, 'ft',
                           'Unbraced length of stair stringer')
    asc = DeclareVariable(r'\alpha _{sc}', 45, 'deg',
                          'Angle of stringer from horizon')

    sizepc = DeclareVariable('Section_{pc}',
                             'C 8 X 4.25',
                             '',
                             'Platform channel section size',
                             input_type='select',
                             input_options=alum_channel_sizes)
    sizepr = DeclareVariable('Section_{pr}',
                             'RT 8 x 3 x 1/4',
                             '',
                             'Platform rectangular tube section size',
                             input_type='select',
                             input_options=alum_rectangular_sizes)

    LLHR = DeclareVariable('LL_{hr}', 200, 'lbs',
                           'Maximum load on handrail post')
    HHR = DeclareVariable('h_{hr}', 42, 'in', 'Height of handrail')

    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')

    BodyHeader(
        'Buckling Constants (ADM Table B.4.2)', head_level=1
    )  ######################################################################################
    kap = CalcVariable('\kappa', 1.0, 'ksi')

    BodyHeader('Member buckling (Intercept, Slope, and Intersection):')
    Bc = CalcVariable('B_c', Fcy * BRACKETS(1 + (Fcy / (2250 * kap))**(1 / 2)),
                      'ksi')
    Dc = CalcVariable('D_c', Bc / 10 * (Bc / E)**(1 / 2), 'ksi')
    Cc = CalcVariable('C_c', 0.41 * Bc / Dc)

    BodyHeader(
        'Uniform compression in flat elements (Intercept, Slope, and Intersection):'
    )
    Bp = CalcVariable('B_p', Fcy * BRACKETS(1 + (Fcy / (1500 * kap))**(1 / 3)),
                      'ksi')
    Dp = CalcVariable('D_p', Bp / 10 * (Bp / E)**(1 / 2), 'ksi')
    Cp = CalcVariable('C_p', 0.41 * Bp / Dp)

    BodyHeader('Shear in flat elements (Intercept, Slope, and Intersection):')
    Fsy = CalcVariable('F_{sy}', 0.6 * Fty, 'ksi', code_ref="ADM Table A.3.1")
    Fsu = CalcVariable('F_{su}', 0.6 * Ftu, 'ksi', code_ref="ADM Table A.3.1")
    Bs = CalcVariable('B_s', Fsy * BRACKETS(1 + (Fsy / (800 * kap))**(1 / 3)),
                      'ksi')
    Ds = CalcVariable('D_s', Bs / 10 * (Bs / E)**(1 / 2), 'ksi')
    Cs = CalcVariable('C_s', 0.41 * Bs / Ds)

    BodyHeader('Stair Stringer Design', head_level=1)
    BodyHeader('Section properties')
    sectionsc = AlumShapesChannel.objects(Size=sizesc.value).first()
    twsc = CalcVariable('t_{wsc}', sectionsc.tw, 'in')
    tfsc = CalcVariable('t_{fsc}', sectionsc.tf, 'in')
    bsc = CalcVariable('b_{sc}', sectionsc.b, 'in')
    dsc = CalcVariable('d_{sc}', sectionsc.d, 'in')
    Rsc = CalcVariable('R_{sc}', sectionsc.R1, 'in')
    wswsc = CalcVariable('SW_{sc}', sectionsc.W, 'lbs/ft')
    Asc = CalcVariable('A_{sc}', sectionsc.A, 'in^2')
    Ssc = CalcVariable('S_{xsc}', sectionsc.Sx, 'in^3')
    Zsc = CalcVariable('Z_{xsc}', sectionsc.b * sectionsc.d**2 / 4 -
                       (sectionsc.b - sectionsc.tw) *
                       (sectionsc.d - 2 * sectionsc.tf)**2 / 4,
                       'in^3')  # Z for channel shape
    Ixsc = CalcVariable('I_{xsc}', sectionsc.Ix, 'in^4')
    rxsc = CalcVariable('r_{xsc}', sectionsc.rx, 'in')
    Iysc = CalcVariable('I_{ysc}', sectionsc.Iy, 'in^4')
    rysc = CalcVariable('r_{ysc}', sectionsc.ry, 'in')
    xsc = CalcVariable('x_{sc}', sectionsc.x, 'in')
    exsc = CalcVariable(
        'e_{xsc}', 3 * tfsc * (bsc - twsc / 2)**2 /
        (BRACKETS(dsc - tfsc) * twsc + 6 * BRACKETS(bsc - twsc / 2) * tfsc),
        'in', 'Shear center measured from web centerline'
    )  # for channel shape from CERM
    x0sc = CalcVariable('x_{0sc}', exsc + xsc - twsc / 2, 'in')
    y0sc = CalcVariable('y_{0sc}', 0, 'in')
    Jsc = CalcVariable('J_{sc}', Ixsc + Iysc, 'in^4')
    Cwsc = CalcVariable(
        'C_{wsc}', (1 / 6) * (dsc - tfsc)**2 *
        (bsc - twsc / 2)**2 * tfsc * BRACKETS(bsc - twsc / 2 - 3 * exsc) +
        exsc**2 * Ixsc, 'in^6')  # for channel shape per AISC Design Guide 9

    BodyHeader(
        'Stair Stringer Load Demands', head_level=2
    )  ######################################################################################
    asc_R = CalcVariable(r'\alpha _{sc.rad}', asc * PI / 180, 'radians')
    Fosha = CalcVariable(
        r'\beta_{osha}', 5, '',
        'Design for 5 times the service loads for OSHA compliance')
    wdsc = CalcVariable('w_{dsc}', DL * Wtr / 2 + wswsc, 'lsb/ft',
                        'Distributed dead load on stringer')
    wsc = CalcVariable('w_{sc}', LL * Wtr / 2 + wdsc, 'lbs/ft',
                       'Distributed dead and live load on stringer')

    Mdsc = CalcVariable('M_{dsc}', Fosha * wsc * Lsc**2 * COS(asc_R) / 8,
                        'lbs-ft', 'Factored moment due to uniform live load')
    Mcsc = CalcVariable(
        'M_{csc}',
        Fosha * BRACKETS(wdsc * Lsc**2 * COS(asc_R) / 8 + LC * Lsc / 4),
        'lbs-ft', 'Factored moment due to concentrated live load')
    Musc = CalcVariable('M_{usc}', MAX(Mdsc, Mcsc), 'lbs-ft',
                        'Factored design moment on stringer')

    Pdsc = CalcVariable('P_{dsc}', Fosha * wsc * Lsc * COS(asc_R), 'lbs',
                        'Factored axial load due to uniform live load')
    Pcsc = CalcVariable(
        'P_{csc}', Fosha * BRACKETS(wdsc * Lsc * COS(asc_R) * SIN(asc_R) + LC),
        'lbs', 'Factored axial load due to concentrated live load'
    )  #Fosha*BRACKETS(wdsc*Lsc*COS(asc) + LC)
    Pusc = CalcVariable('P_{usc}', MAX(Pdsc, Pcsc), 'lbs',
                        'Factored design axial load on stringer')

    Rusc = CalcVariable(
        'R_{usc}',
        wsc * COS(asc_R) * Lsc / 2, 'lbs',
        'End reaction due to stringer dead and uniform live load')
    Rcsc = CalcVariable(
        'R_{csc}',
        wdsc * COS(asc_R) * Lsc / 2 + LC, 'lbs',
        'End reaction due to stringer dead and concentrated live load (at end)'
    )
    Resc = CalcVariable('R_{esc}', MAX(Rusc, Rcsc), 'lbs',
                        'Unfactored stringer end reaction')

    Vusc = CalcVariable('V_{usc}', Fosha * Resc, 'lbs',
                        'Factored maximum shear demand')
    Tusc = CalcVariable('T_{usc}', LLHR * HHR, 'lbs-in',
                        'Torsion demand due to handrail loading')

    BodyHeader(
        'Stair Stringer Deflections', head_level=2
    )  ######################################################################################
    dallow = CalcVariable('\delta_{allow}', Lsc * ft_to_in / dlim, 'in')
    delastic = CalcVariable(
        '\delta_{elastic}',
        5 * wsc / k_to_lb * Lsc**4 * ft_to_in**3 / (384 * E * Ixsc), 'in')
    CheckVariable(delastic, '<=', dallow)

    BodyHeader(
        'Stair Stringer Compression Design (ADM Chapter E)', head_level=2
    )  ######################################################################################

    BodyHeader('Member Buckling (ADM E.2)')
    y1c = CalcVariable('\lambda_{1c}', (Bc - Fcy) / Dc, '')
    ycf = CalcVariable('\lambda_{cf}',
                       Ksc * Lbsc * ft_to_in / rysc,
                       '',
                       'Member slenderness ratio for flexural buckling',
                       code_ref='ADM E.2.1')
    r0sc = CalcVariable('r_{0sc}',
                        SQRT(x0sc**2 + y0sc**2 + (Ixsc + Iysc) / Asc),
                        'in',
                        code_ref='ADM E.2-7')
    Hsc = CalcVariable('H_{sc}',
                       1 - (x0sc**2 + y0sc**2) / r0sc**2,
                       '',
                       code_ref='ADM E.2-8')
    Fexsc = CalcVariable('F_{exsc}',
                         PI**2 * E / (Ksc * Lbsc * ft_to_in / rxsc)**2,
                         'ksi',
                         code_ref='ADM E.2-9')
    Fezsc = CalcVariable('F_{ezsc}',
                         ONE / (Asc * r0sc**2) *
                         BRACKETS(G * Jsc + PI**2 * E * Cwsc /
                                  (Ksc * Lbsc * ft_to_in)**2),
                         'ksi',
                         code_ref='ADM E.2-11')
    Fesc = CalcVariable(
        'F_{esc}', (Fexsc + Fezsc) / (2 * Hsc) *
        BRACKETS(1 - SQRT(1 - 4 * Fexsc * Fezsc * Hsc / (Fexsc + Fezsc)**2)),
        'ksi',
        'Elastic buckling stress for torsional buckling where x is the axis of symmetry',
        code_ref='ADM E.2-5')
    yct = CalcVariable('\lambda_{ct}',
                       PI * SQRT(E / Fesc),
                       '',
                       'Member slenderness ratio for torsional buckling',
                       code_ref='ADM E.2-3')

    yc = CalcVariable('\lambda_{c}',
                      MAX(ycf, yct),
                      '',
                      'Greatest compression member slenderness',
                      code_ref='ADM E.2')

    if yc.result() <= y1c.result():
        CheckVariablesText(yc, '<=', y1c)
        BodyText('Member yielding controls')
        Fcsc = CalcVariable('F_{csc}', Fcy, 'ksi', code_ref='ADM E.2')
    elif yc.result() < Cc.result():
        CheckVariablesText(y1c, '<', yc, '<', Cc)
        BodyText('Inelastic buckling controls')
        Fcsc = CalcVariable('F_{csc}',
                            BRACKETS(Bc - Dc * yc) *
                            BRACKETS(0.85 + 0.15 * (Cc - yc) / (Cc - y1c)),
                            'ksi',
                            code_ref='ADM E.2')
    else:
        CheckVariablesText(yc, '>=', Cc)
        BodyText('Elastic buckling controls')
        Fcsc = CalcVariable('F_{csc}',
                            0.85 * PI**2 * E / yc**2,
                            'ksi',
                            code_ref='ADM E.2')
    PPncm = CalcVariable('\phi P_{ncm}',
                         Pc * Fcsc * Asc * k_to_lb,
                         'lbs',
                         'Member buckling strength',
                         code_ref='ADM E.2-1')

    BodyHeader('Local Buckling (ADM E.3)')
    k1c = CalcVariable('k_{1c}', 0.35, '',
                       code_ref='ADM Table B.4.3')  # assume temper T6
    k2c = CalcVariable('k_{2c}', 2.27, '', code_ref='ADM Table B.4.3')
    y1e = CalcVariable('\lambda_{1e}', (Bp - Fcy) / Dp, '')
    y2e = CalcVariable('\lambda_{2e}', k1c * Bp / Dp, '')
    Fee = CalcVariable('F_{ee}',
                       PI**2 * E / (5 * BRACKETS(bsc - twsc - Rsc) / tfsc)**2,
                       'ksi',
                       code_ref='ADM Table B.5.1')
    yeq = CalcVariable('\lambda_{eq}',
                       PI * SQRT(E / Fee),
                       '',
                       code_ref='B.5-11')

    if yeq.result() <= y1e.result():
        CheckVariablesText(yeq, '<=', y1e)
        BodyText('Member yielding controls')
        Fcesc = CalcVariable('F_{cesc}', Fcy, 'ksi', code_ref='ADM B.5.4.6')
    elif yeq.result() < y2e.result():
        CheckVariablesText(y1e, '<=', yeq, '<', y2e)
        BodyText('Inelastic buckling controls')
        Fcesc = CalcVariable('F_{cesc}',
                             Bp - Dp * yeq,
                             'ksi',
                             code_ref='ADM B.5.4.6')
    else:
        CheckVariablesText(yeq, '>=', y2e)
        BodyText('Elastic buckling controls')
        Fcesc = CalcVariable('F_{cesc}',
                             k2c * SQRT(Bp * E) / yeq,
                             'ksi',
                             code_ref='ADM B.5.4.6')
    PPnce = CalcVariable('\phi P_{nce}',
                         Pc * Fcesc * Asc * k_to_lb,
                         'lbs',
                         'Member local buckling strength',
                         code_ref='ADM E.3-2')

    BodyHeader('Controlling Strength')
    PPnsc = CalcVariable('\phi P_{nsc}', MIN(PPncm, PPnce), 'lbs',
                         'Member compressive strength')
    c1 = CheckVariable(Pusc,
                       '<=',
                       PPnsc,
                       truestate="OK",
                       falsestate="ERROR",
                       result_check=True)

    BodyHeader(
        'Stair Stringer Flexural Design (ADM Chapter F)', head_level=2
    )  ######################################################################################

    BodyHeader('Yielding and Rupture (ADM F.2)')
    Mnp = CalcVariable('M_{np}',
                       MIN(Zsc * Fcy, 1.5 * Ssc * Fty, 1.5 * Ssc * Fcy) *
                       (k_to_lb / ft_to_in),
                       'lbs-ft',
                       'Yield limit state nominal moment capacity',
                       code_ref='ADM F.2')
    PMnp = CalcVariable('\phi M_{np}', Pby * Mnp, 'lbs-ft')
    PMnu = CalcVariable('\phi M_{nu}',
                        Pbr * Zsc * Ftu / kt * (k_to_lb / ft_to_in),
                        'lbs-ft',
                        'Rupture limit state moment capacity',
                        code_ref='ADM F.2-1')

    BodyHeader('Local Buckling (ADM F.3.2)')
    k1b = CalcVariable('k_1b', 0.5, '', code_ref='ADM Table B.4.3')
    k2b = CalcVariable('k_2b', 2.04, '', code_ref='ADM Table B.4.3')
    if yeq.result() <= y1e.result():
        CheckVariablesText(yeq, '<=', y1e)
        BodyText('Member yielding controls')
        Fbsc = CalcVariable('F_{bsc}',
                            Mnp / Ssc * (ft_to_in / k_to_lb),
                            'ksi',
                            code_ref='ADM B.5.5.5')
    elif yeq.result() < Cp.result():
        CheckVariablesText(y1e, '<', yeq, '<', Cp)
        BodyText('Inelastic buckling controls')
        Fbsc = CalcVariable(
            'F_{bsc}',
            Mnp / Ssc * (ft_to_in / k_to_lb) -
            BRACKETS(Mnp / Ssc * (ft_to_in / k_to_lb) - PI**2 * E / Cp**2) *
            (yeq - y1e) / (Cp - y1e),
            'ksi',
            code_ref='ADM B.5.5.5')
    else:
        CheckVariablesText(yeq, '>=', Cp)
        BodyText('Post-buckling controls')
        Fbsc = CalcVariable('F_{bsc}',
                            k2b * SQRT(Bp * E) / yeq,
                            'ksi',
                            code_ref='ADM B.5.5.5')
    PMnlb = CalcVariable('\phi M_{nlb}',
                         Pby * Fbsc * Ssc * (k_to_lb / ft_to_in),
                         'lbs-ft',
                         'Local buckling limit state moment capacity',
                         code_ref='ADM F.3-2')

    BodyHeader('Lateral-Torsional Buckling (ADM F.4)')
    Cb = CalcVariable('C_b', 1.0, '', code_ref='ADM F.4.1(a)')
    ryesc = CalcVariable('r_{yesc}',
                         SQRT(
                             SQRT(Iysc) / Ssc * SQRT(Cwsc + 0.038 * Jsc *
                                                     (Lbsc * ft_to_in)**2)),
                         'in',
                         code_ref='ADM F.4-4')
    ybsc = CalcVariable('\lambda_{bsc}',
                        Lbsc * ft_to_in / (ryesc * SQRT(Cb)),
                        '',
                        code_ref='ADM F.4-3')

    if ybsc.result() < Cc.result():
        CheckVariablesText(ybsc, '<', Cc)
        BodyText('Inelastic lateral torsional buckling controls')
        PMnmb = CalcVariable(
            '\phi M_{nmb}',
            Pby *
            (Mnp * BRACKETS(1 - ybsc / Cc) + PI**2 * E * ybsc * Ssc / Cc**3 *
             (k_to_lb / ft_to_in)),
            'lbs-ft',
            'Lateral torsional buckling moment capacity',
            code_ref='ADM F.4')
    else:
        CheckVariablesText(ybsc, '>=', Cc)
        BodyText('Elastic lateral torsional buckling controls')
        PMnmb = CalcVariable('\phi M_{nmb}',
                             Pby * PI**2 * E * Ssc / ybsc**2 * k_to_lb /
                             ft_to_in,
                             'lbs-ft',
                             'Lateral torsional buckling moment capacity',
                             code_ref='ADM F.4')

    BodyHeader('Controlling Strength')
    PMnsc = CalcVariable('\phi M_{nsc}', MIN(PMnp, PMnu, PMnlb, PMnmb),
                         'lbs-ft', 'Member moment strength')
    CheckVariable(Musc,
                  '<=',
                  PMnsc,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader(
        'Stair Stringer Shear and Torsion Design (ADM Chapter H.2)',
        head_level=2
    )  ######################################################################################
    BodyText(
        "Member shear stresses due to torsion are calculated in accordance with AISC Design Guide 9 and Roark's Formulas for Stress and Strain, 7th ed."
    )

    BodyHeader("Torsional Properties")
    KT = CalcVariable('K_T',
                      2 * (bsc * tfsc**3) / 3 +
                      BRACKETS(dsc - 2 * tfsc) * twsc**3 / 3,
                      'in^4',
                      'Torsional Constant',
                      code_ref='DG9 3.4')
    BT = CalcVariable(r'\beta_{T}',
                      SQRT(KT * G / (Cwsc * E)),
                      'in^{-1}',
                      code_ref="Roark's Table 10.3")

    BodyHeader("Elastic Deformations due to Torsion (Roark's Table 10.3.1g)")
    Opmax = CalcVariable(
        r"\theta'_{max}", Tusc / (2 * Cwsc * E * k_to_lb * BT**2) *
        BRACKETS(1 - ONE / (COSH((BT * Lsc * ft_to_in) / 4))), 'in^{-1}')
    # Oppmax = CalcVariable(r"\theta''_{max)}", Tusc/(2*Cwsc*E*k_to_lb*BT)*TANH((BT*Lsc*ft_to_in)/2), 'in^{-2}')
    Opppmax = CalcVariable(r"\theta'''_{max}", Tusc / (2 * Cwsc * E * k_to_lb),
                           'in^{-3}')
    BodyHeader("Torsional Shear Stresses (Roark's Table 10.2.1)")
    tT = CalcVariable('t_T', MAX(twsc, tfsc), 'in')
    bT = CalcVariable('b_T', bsc - twsc / 2, 'in')
    hT = CalcVariable('h_T', dsc - tfsc, 'in')
    Ttmax = CalcVariable(r"\tau_{Tmax}", tT * G * Opmax, 'ksi')
    Twmax = CalcVariable(r"\tau_{Wmax}", (hT * bT**2) / 4 *
                         ((hT + 3 * bT) / (hT + 6 * bT))**2 * E * Opppmax,
                         'ksi')
    BodyText(
        'The torsional and warping stresses reach maximum values at different points along the beam, however, the total maximum shear stress is conservatively calculated as the sum of the two.'
    )
    Ttw = CalcVariable(R"\tau_{TW}", Ttmax + Twmax, 'ksi')

    Avsc = CalcVariable('A_{vsc}', dsc * twsc, 'in^2', code_ref='ADM G.2-3')
    Ttsc = CalcVariable(r"\tau_{usc}", Vusc / Avsc / k_to_lb + Ttw, 'ksi',
                        'Total shear stress demand on member')

    BodyHeader('Web Shear Capacity (ADM G.2)')
    PVnu = CalcVariable('\phi V_{nu}',
                        Pbr * Fsu / kt,
                        'ksi',
                        'Rupture limit state shear capacity',
                        code_ref='ADM G.2-1')

    yv = CalcVariable('b/t', (dsc - 2 * tfsc) / twsc, '')
    y1v = CalcVariable('\lambda_{1v}', (Bs - Fsy) / (1.25 * Ds), '')
    y2v = CalcVariable('\lambda_{2v}', Cs / 1.25, '')

    if yv.result() <= y1v.result():
        CheckVariablesText(yv, '<=', y1v)
        BodyText('Shear yielding controls')
        Vny = CalcVariable('V_{ny}', Fsy, 'ksi')
    elif yv.result() < y2v.result():
        CheckVariablesText(y1v, '<', yv, '<', y2v)
        BodyText('Inelastic buckling controls')
        Vny = CalcVariable('V_{ny}', Bs - 1.25 * Ds * yv, 'ksi')
    else:
        CheckVariablesText(yv, '>=', y2v)
        BodyText('Elastic buckling controls')
        Vny = CalcVariable('V_{ny}', (PI**2 * E) / (1.25 * yv)**2, 'ksi')
    PVny = CalcVariable('\phi V_{ny}', Pby * Vny, 'ksi',
                        'Yield or buckling limit state shear capacity')

    BodyHeader('Controlling Shear Strength')
    PVsc = CalcVariable('\phi V_{sc}', MIN(PVnu, PVny), 'ksi',
                        'Member shear strength')
    CheckVariable(Ttsc,
                  '<=',
                  PVsc,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader(
        'Stair Stringer Combined Loading Design', head_level=2
    )  ######################################################################################
    # dcrp = CalcVariable('DCR_P', Pusc/PPnsc, '', 'Demand-capacity-ratio for axial load design')
    # dcrm = CalcVariable('DCR_M', Musc/PMnsc, '', 'Demand-capacity-ratio for flexural design')
    dcrcom = CalcVariable(
        'DCR_{PM}',
        Pusc / PPnsc + Musc / PMnsc,
        '',
        'Combined axial and flexural demand-capacity-ratio for member design',
        code_ref='H.1-1')
    CheckVariable(dcrcom,
                  '<=',
                  1,
                  truestate="OK",
                  falsestate="ERROR",
                  description="",
                  code_ref="",
                  result_check=True)
    dcrall = CalcVariable(
        'DCR_{ALL}',
        Pusc / PPnsc + (Musc / PMnsc)**2 + (Ttsc / PVsc)**2,
        '',
        'Combined axial, flexural, and shear/torsion demand-capacity-ratio for member design',
        code_ref='H.3-1')
    CheckVariable(dcrall,
                  '<=',
                  1,
                  truestate="OK",
                  falsestate="ERROR",
                  description="",
                  code_ref="",
                  result_check=True)

    # Platform rectangular member design       ###########################################################################################################

    BodyHeader(
        'Platform rectangular main beam design (perpendicular to stringer)',
        head_level=1)  # length = L_TP
    BodyHeader('Section properties')
    sectionpr = AlumShapesRectangular.objects(Name=sizepr.value).first()
    wswpr = CalcVariable('SW_{pr}', sectionpr.W, 'lb/ft')
    bpr = CalcVariable('b_{pr}', sectionpr.b, 'in')
    tpr = CalcVariable('t_{pr}', sectionpr.t, 'in')
    Spr = CalcVariable('S_{xpr}', sectionpr.Sx, 'in^3')
    Zpr = CalcVariable('Z_{xpr}', sectionpr.Zx, 'in^3')
    Ixpr = CalcVariable('I_{xpr}', sectionpr.Ix, 'in^4')
    rxpr = CalcVariable('r_{xpr}', sectionpr.rx, 'in')
    Iypr = CalcVariable('I_{ypr}', sectionpr.Iy, 'in^4')
    rypr = CalcVariable('r_{ypr}', sectionpr.ry, 'in')
    Jpr = CalcVariable('J_{pr}', sectionpr.J, 'in^4')

    BodyHeader(
        'Platform Main Beam Load Demands', head_level=2
    )  ######################################################################################
    Lpr = CalcVariable('L_{pr}', Wtp, 'ft', 'Length of main beam (max)')
    apr = CalcVariable('a_{pr}', (Lpr - Wtr) / 2, 'ft',
                       'Average distance from stringer load to end of beam')
    wpr = CalcVariable('w_{dpr}',
                       BRACKETS(DL + LL) * Ltp / 2 + wswpr, 'lsb/ft',
                       'Distributed load on main beam')
    # Resc
    BodyText(
        'Conservatively assume stair stringer reactions are centered on the main beam. Distance between reactions will be equal to the stair tread width.'
    )
    Mupr = CalcVariable('M_{upr}',
                        Fosha * BRACKETS(wpr * Lpr**2 / 8 + Resc * apr),
                        'lbs-ft', 'Factored moment on main beam')

    Repr = CalcVariable('R_{epr}', wpr * Lpr / 2 + Resc, 'lbs',
                        'Unfactored main beam end reaction')

    BodyHeader(
        'Platform Main Beam Deflections', head_level=2
    )  ######################################################################################
    dallow = CalcVariable('\delta_{allow}', Lpr * ft_to_in / dlim, 'in')
    delastic = CalcVariable(
        '\delta_{elastic}', 5 * wpr / k_to_lb * Lpr**4 * ft_to_in**3 /
        (384 * E * Ixpr) + Resc / k_to_lb / (24 * E * Ixpr) *
        BRACKETS(3 * Lpr**2 * apr - 4 * apr**3) * ft_to_in**2, 'in')
    CheckVariable(delastic, '<=', dallow)

    BodyHeader(
        'Platform Main Beam Flexural Design (ADM Chapter F)', head_level=2
    )  ######################################################################################

    BodyHeader('Yielding and Rupture (ADM F.2)')
    Mnp = CalcVariable('M_{np}',
                       MIN(Zpr * Fcy, 1.5 * Spr * Fty, 1.5 * Spr * Fcy) *
                       (k_to_lb / ft_to_in),
                       'lbs-ft',
                       'Yield limit state nominal moment capacity',
                       code_ref='ADM F.2')
    PMnp = CalcVariable('\phi M_{np}', Pby * Mnp, 'lbs-ft')
    PMnu = CalcVariable('\phi M_{nu}',
                        Pbr * Zpr * Ftu / kt * (k_to_lb / ft_to_in),
                        'lbs-ft',
                        'Rupture limit state moment capacity',
                        code_ref='ADM F.2-1')

    BodyHeader('Local Buckling (ADM F.3.2)')
    Feer = CalcVariable('F_{eer}',
                        PI**2 * E / (1.6 * BRACKETS(bpr - 2 * tpr) / tpr)**2,
                        'ksi',
                        code_ref='ADM Table B.5.1')
    yeqr = CalcVariable('\lambda_{eqr}',
                        PI * SQRT(E / Feer),
                        '',
                        code_ref='B.5-15')

    if yeqr.result() <= y1e.result():
        CheckVariablesText(yeqr, '<=', y1e)
        BodyText('Member yielding controls')
        Fbpr = CalcVariable('F_{bpr}',
                            Mnp / Spr * (ft_to_in / k_to_lb),
                            'ksi',
                            code_ref='ADM B.5.5.5')
    elif yeqr.result() < Cp.result():
        CheckVariablesText(y1e, '<', yeqr, '<', Cp)
        BodyText('Inelastic buckling controls')
        Fbpr = CalcVariable(
            'F_{bpr}',
            Mnp / Spr * (ft_to_in / k_to_lb) -
            BRACKETS(Mnp / Spr * (ft_to_in / k_to_lb) - PI**2 * E / Cp**2) *
            (yeqr - y1e) / (Cp - y1e),
            'ksi',
            code_ref='ADM B.5.5.5')
    else:
        CheckVariablesText(yeqr, '>=', Cp)
        BodyText('Post-buckling controls')
        Fbpr = CalcVariable('F_{bpr}',
                            k2b * SQRT(Bp * E) / yeqr,
                            'ksi',
                            code_ref='ADM B.5.5.5')
    PMnlb = CalcVariable('\phi M_{nlb}',
                         Pby * Fbpr * Spr * (k_to_lb / ft_to_in),
                         'lbs-ft',
                         'Local buckling limit state moment capacity',
                         code_ref='ADM F.3-2')

    BodyHeader('Lateral-Torsional Buckling (ADM F.4)')
    Cb = CalcVariable('C_b', 1.0, '', code_ref='ADM F.4.1(a)')
    ybpr = CalcVariable('\lambda_{bpr}',
                        2.3 * SQRT(Lpr * Spr / (Cb * SQRT(Iypr * Jpr))),
                        '',
                        code_ref='ADM F.4-6')

    if ybpr.result() < Cc.result():
        CheckVariablesText(ybpr, '<', Cc)
        BodyText('Inelastic lateral torsional buckling controls')
        PMnmb = CalcVariable(
            '\phi M_{nmb}',
            Pby *
            (Mnp * BRACKETS(1 - ybpr / Cc) + PI**2 * E * ybpr * Spr / Cc**3 *
             (k_to_lb / ft_to_in)),
            'lbs-ft',
            'Lateral torsional buckling moment capacity',
            code_ref='ADM F.4')
    else:
        CheckVariablesText(ybpr, '>=', Cc)
        BodyText('Elastic lateral torsional buckling controls')
        PMnmb = CalcVariable('\phi M_{nmb}',
                             Pby * PI**2 * E * Spr / ybpr**2 * k_to_lb /
                             ft_to_in,
                             'lbs-ft',
                             'Lateral torsional buckling moment capacity',
                             code_ref='ADM F.4')

    BodyHeader('Controlling Strength')
    PMnpr = CalcVariable('\phi M_{npr}', MIN(PMnp, PMnu, PMnlb, PMnmb),
                         'lbs-ft', 'Member moment strength')
    CheckVariable(Mupr,
                  '<=',
                  PMnpr,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    # Platform channel member design       ###########################################################################################################

    BodyHeader('Platform Channel Beam Design', head_level=1)
    BodyHeader('Section properties')
    sectionpc = AlumShapesChannel.objects(Size=sizepc.value).first()
    twpc = CalcVariable('t_{wpc}', sectionpc.tw, 'in')
    tfpc = CalcVariable('t_{fpc}', sectionpc.tf, 'in')
    bpc = CalcVariable('b_{pc}', sectionpc.b, 'in')
    dpc = CalcVariable('d_{pc}', sectionpc.d, 'in')
    Rpc = CalcVariable('R_{pc}', sectionpc.R1, 'in')
    wswpc = CalcVariable('SW_{pc}', sectionpc.W, 'lbs/ft')
    Apc = CalcVariable('A_{pc}', sectionpc.A, 'in^2')
    Spc = CalcVariable('S_{xpc}', sectionpc.Sx, 'in^3')
    Zpc = CalcVariable('Z_{xpc}', sectionpc.b * sectionpc.d**2 / 4 -
                       (sectionpc.b - sectionpc.tw) *
                       (sectionpc.d - 2 * sectionpc.tf)**2 / 4,
                       'in^3')  # Z for channel shape
    Ixpc = CalcVariable('I_{xpc}', sectionpc.Ix, 'in^4')
    rxpc = CalcVariable('r_{xpc}', sectionpc.rx, 'in')
    Iypc = CalcVariable('I_{ypc}', sectionpc.Iy, 'in^4')
    rypc = CalcVariable('r_{ypc}', sectionpc.ry, 'in')
    xpc = CalcVariable('x_{pc}', sectionpc.x, 'in')
    expc = CalcVariable(
        'e_{xpc}', 3 * tfpc * (bpc - twpc / 2)**2 /
        (BRACKETS(dpc - tfpc) * twpc + 6 * BRACKETS(bpc - twpc / 2) * tfpc),
        'in', 'Shear center measured from web centerline'
    )  # for channel shape from CERM
    x0pc = CalcVariable('x_{0pc}', expc + xpc - twpc / 2, 'in')
    y0pc = CalcVariable('y_{0pc}', 0, 'in')
    Jpc = CalcVariable('J_{pc}', Ixpc + Iypc, 'in^4')
    Cwpc = CalcVariable(
        'C_{wpc}', (1 / 6) * (dpc - tfpc)**2 *
        (bpc - twpc / 2)**2 * tfpc * BRACKETS(bpc - twpc / 2 - 3 * expc) +
        expc**2 * Ixpc, 'in^6')  # for channel shape per AISC Design Guide 9

    BodyHeader(
        'Platform Channel Beam Load Demands', head_level=2
    )  ######################################################################################
    Lpc = CalcVariable('L_{pc}', Ltp, 'ft',
                       'Length of platform channel beam (max)')
    wdpc = CalcVariable('w_{dpc}', DL * Wtp / 2 + wswpc, 'lbs/ft',
                        'Distributed dead load on platform channel beam')
    wpc = CalcVariable(
        'w_{pc}', LL * Wtp / 2 + wdpc, 'lbs/ft',
        'Distributed dead and live load on platform channel beam')

    Mdpc = CalcVariable('M_{dpc}', Fosha * wpc * Lpc**2 / 8, 'lbs-ft',
                        'Factored moment due to uniform live load')
    Mcpc = CalcVariable('M_{cpc}',
                        Fosha * BRACKETS(wdpc * Lpc**2 / 8 + LC * Lpc / 4),
                        'lbs-ft',
                        'Factored moment due to concentrated live load')
    Mupc = CalcVariable('M_{upc}', MAX(Mdpc, Mcpc), 'lbs-ft',
                        'Factored design moment on platform channel beam')

    Rupc = CalcVariable(
        'R_{upc}', wpc * Lpc / 2, 'lbs',
        'End reaction due to platform channel beam dead and uniform live load')
    Rcpc = CalcVariable(
        'R_{cpc}', wdpc * Lpc / 2 + LC, 'lbs',
        'End reaction due to platform channel beam dead and concentrated live load (at end)'
    )
    Repc = CalcVariable('R_{epc}', MAX(Rupc, Rcpc), 'lbs',
                        'Unfactored platform channel beam end reaction')

    BodyHeader(
        'Platform Channel Beam Deflections', head_level=2
    )  ######################################################################################
    dallow = CalcVariable('\delta_{allow}', Lpc * ft_to_in / dlim, 'in')
    delastic = CalcVariable(
        '\delta_{elastic}',
        5 * wpc / k_to_lb * Lpc**4 * ft_to_in**3 / (384 * E * Ixpc), 'in')
    CheckVariable(delastic, '<=', dallow)

    BodyHeader(
        'Platform Channel Beam Flexural Design (ADM Chapter F)', head_level=2
    )  ######################################################################################

    BodyHeader('Yielding and Rupture (ADM F.2)')
    Mnp = CalcVariable('M_{np}',
                       MIN(Zpc * Fcy, 1.5 * Spc * Fty, 1.5 * Spc * Fcy) *
                       (k_to_lb / ft_to_in),
                       'lbs-ft',
                       'Yield limit state nominal moment capacity',
                       code_ref='ADM F.2')
    PMnp = CalcVariable('\phi M_{np}', Pby * Mnp, 'lbs-ft')
    PMnu = CalcVariable('\phi M_{nu}',
                        Pbr * Zpc * Ftu / kt * (k_to_lb / ft_to_in),
                        'lbs-ft',
                        'Rupture limit state moment capacity',
                        code_ref='ADM F.2-1')

    BodyHeader('Local Buckling (ADM F.3.2)')

    Feec = CalcVariable('F_{eec}',
                        PI**2 * E / (5 * BRACKETS(bpc - twpc - Rpc) / tfpc)**2,
                        'ksi',
                        code_ref='ADM Table B.5.1')
    yeqc = CalcVariable('\lambda_{eqc}',
                        PI * SQRT(E / Feec),
                        '',
                        code_ref='B.5-11')

    if yeqc.result() <= y1e.result():
        CheckVariablesText(yeqc, '<=', y1e)
        BodyText('Member yielding controls')
        Fbpc = CalcVariable('F_{bpc}',
                            Mnp / Spc * (ft_to_in / k_to_lb),
                            'ksi',
                            code_ref='ADM B.5.5.5')
    elif yeqc.result() < Cp.result():
        CheckVariablesText(y1e, '<', yeqc, '<', Cp)
        BodyText('Inelastic buckling controls')
        Fbpc = CalcVariable(
            'F_{bpc}',
            Mnp / Spc * (ft_to_in / k_to_lb) -
            BRACKETS(Mnp / Spc * (ft_to_in / k_to_lb) - PI**2 * E / Cp**2) *
            (yeqc - y1e) / (Cp - y1e),
            'ksi',
            code_ref='ADM B.5.5.5')
    else:
        CheckVariablesText(yeqc, '>=', Cp)
        BodyText('Post-buckling controls')
        Fbpc = CalcVariable('F_{bpc}',
                            k2b * SQRT(Bp * E) / yeqc,
                            'ksi',
                            code_ref='ADM B.5.5.5')
    PMnlb = CalcVariable('\phi M_{nlb}',
                         Pby * Fbpc * Spc * (k_to_lb / ft_to_in),
                         'lbs-ft',
                         'Local buckling limit state moment capacity',
                         code_ref='ADM F.3-2')

    BodyHeader('Lateral-Torsional Buckling (ADM F.4)')
    Cb = CalcVariable('C_b', 1.0, '', code_ref='ADM F.4.1(a)')
    ryepc = CalcVariable('r_{yepc}',
                         SQRT(
                             SQRT(Iypc) / Spc * SQRT(Cwpc + 0.038 * Jpc *
                                                     (Lpc * ft_to_in)**2)),
                         'in',
                         code_ref='ADM F.4-4')
    ybpc = CalcVariable('\lambda_{bpc}',
                        Lpc * ft_to_in / (ryepc * SQRT(Cb)),
                        '',
                        code_ref='ADM F.4-3')

    if ybpc.result() < Cc.result():
        CheckVariablesText(ybpc, '<', Cc)
        BodyText('Inelastic lateral torsional buckling controls')
        PMnmb = CalcVariable(
            '\phi M_{nmb}',
            Pby *
            (Mnp * BRACKETS(1 - ybpc / Cc) + PI**2 * E * ybpc * Spc / Cc**3 *
             (k_to_lb / ft_to_in)),
            'lbs-ft',
            'Lateral torsional buckling moment capacity',
            code_ref='ADM F.4')
    else:
        CheckVariablesText(ybpc, '>=', Cc)
        BodyText('Elastic lateral torsional buckling controls')
        PMnmb = CalcVariable('\phi M_{nmb}',
                             Pby * PI**2 * E * Spc / ybpc**2 * k_to_lb /
                             ft_to_in,
                             'lbs-ft',
                             'Lateral torsional buckling moment capacity',
                             code_ref='ADM F.4')

    BodyHeader('Controlling Strength')
    PMnpc = CalcVariable('\phi M_{npc}', MIN(PMnp, PMnu, PMnlb, PMnmb),
                         'lbs-ft', 'Member moment strength')
    CheckVariable(Mupc,
                  '<=',
                  PMnpc,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader('Mid-Level Platform Design and Platform Tributary Weights',
               head_level=2)

    BodyText(
        'Member sizes on the mid-height platform are identical to those of the top platform. As the spans and loaded area are less than the top platform, the members can be assumed to pass all design checks.'
    )

    Wdtp = CalcVariable(
        'W_{d,p}',
        Wtp * Ltp * DL + 2 * wswpr * Ltp + 2 * wswpc * Wtp +
        4 * wdsc * Lsc / 2,
        'lbs',
        'Total tributary dead load associated with each platform (conservative)',
        result_check=True)
    Wltp = CalcVariable(
        'W_{l,p}',
        Wtp * Ltp * LL + 2 * LL * Wtr * Lsc / 2,
        'lbs',
        'Total tributary live load associated with each platform (conservative)',
        result_check=True)
    # Wdmp = CalcVariable('W_{d,mp}', Wtp*Ltp*DL + 2*wswpr*Ltp + 2*wswpc*Wtp* 4*wdsc*Lsc/2, 'lbs', 'Total tributary dead load associated with the mid platform (conservative)')
    # Wlmp = CalcVariable('W_{l,mp}', Wtp*Ltp*LL + 2*LL*Wtr*Lsc/2, 'lbs', 'Total tributary live load associated with the mid platform (conservative)')

    calculation_sum = {
        'head': HeadCollection.head_instances,
        'assum': AssumCollection.assum_instances,
        'setup': SetupCollection.setup_instances,
        'calc': CalcCollection.calc_instances,
        'foot': FootCollection.foot_instances
    }
    return calculation_sum
Esempio n. 4
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()



    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('Simply Supported Beam Design')

    DescriptionHead("With beam loading demands, span, section size, and deflection requirements design a simply supported beam using the AISC Manual")

    ##

    Assumption("AISC 14th Edition controls design")
    Assumption("Beam is subject to only Dead and Live loads")
    Assumption("ASCE 7-16 gravity load combinations control design")
    # Assumption("Beam is fully braced along it's length")
    Assumption("Beam section is compact for flexure")
    Assumption("Uniform loads are constant along the entire length")
    Assumption("Beam web is unstiffened")

    wud = DeclareVariable('W_{ud}', 1.8, 'kips/ft', 'Uniform Dead Load' )
    wul = DeclareVariable('W_{ul}', 1.5, 'kips/ft', 'Uniform Live Load' )
    Lb = DeclareVariable('L', 20, 'ft', 'Beam span')
    Lbu = DeclareVariable('L_b', 20, 'ft', 'Beam unbraced length')
    section = DeclareVariable('Section', 'W18X35', '', 'Beam section size', input_type='select', input_options=wf_section_sizes )
    dliml = DeclareVariable('X_{lim,l}', 360, '', 'Member deflection limit under live loads (L/X)')
    dlim = DeclareVariable('X_{lim}', 240, '', 'Member deflection limit under all loads (L/X)')

    Fy = DeclareVariable('F_{y}', 50, 'ksi', 'Steel yield strength')
    Fu = DeclareVariable('F_{u}', 65, 'ksi', 'Steel ultimate strength')
    E = DeclareVariable('E', 29000, 'ksi', 'Modulus of Elasticity')

    Cb = DeclareVariable('C_b', 1.0, '', 'Lateral-torsional buckling modification factor', code_ref='AISC F1(3)')



    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input)>0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')


    BodyHeader('Beam Section Properties', head_level=1)
    sectionb = AISCSectionsWF.objects(AISC_name=section.value).first()
    b = CalcVariable('b', sectionb.bf, 'in')
    d = CalcVariable('d', sectionb.d, 'in')
    tf = CalcVariable('t_f', sectionb.tf, 'in')
    tw = CalcVariable('t_w', sectionb.tw, 'in')
    Ix = CalcVariable('I_x', sectionb.Ix, 'in^4')
    Sx = CalcVariable('S_x', sectionb.Sx, 'in^3')
    Zx = CalcVariable('Z_x', sectionb.Zx, 'in^3')
    ry = CalcVariable('r_{y}', sectionb.ry, 'in')
    rts = CalcVariable('r_{ts}', sectionb.rts, 'in')
    J = CalcVariable('J', sectionb.J, 'in^4')
    ho = CalcVariable('h_o', sectionb.ho, 'in')
    bfl2tf = CalcVariable('b_f/2t_f', sectionb.bfl2tf, '')
    hltw = CalcVariable('h/t_w', sectionb.hltw, '')


    BodyHeader('Member Deflection', head_level=1)
    BodyHeader('Live load deflection', head_level=2)
    dallowl = CalcVariable('\delta_{allow,l}', Lb*ft_to_in/dliml, 'in')
    delasticl = CalcVariable('\delta_{elastic,l}', 5*wul*Lb**4*ft_to_in**3/(384*E*Ix), 'in')
    CheckVariable( delasticl, '<=', dallowl)

    BodyHeader('Combined load deflection', head_level=2)
    dallow = CalcVariable('\delta_{allow}', Lb*ft_to_in/dlim, 'in')
    delastic = CalcVariable('\delta_{elasticl}', 5*BRACKETS(wul+wud)*Lb**4*ft_to_in**3/(384*E*Ix), 'in')
    CheckVariable( delastic, '<=', dallow)


    BodyHeader('Ultimate Load Demands', head_level=1)
    BodyHeader('ASCE Load Combinations', head_level=2)
    Wu1 = CalcVariable('W_{u1}', 1.4*wud, 'kips/ft', code_ref='ASCE 2.3.1(1)')
    Wu2 = CalcVariable('W_{u2}', 1.2*wud+1.6*wul, 'kips/ft', code_ref='ASCE 2.3.1(2)')
    Wu = CalcVariable('W_u', MAX(Wu1, Wu2), 'kips/ft','Controlling load combination')

    BodyHeader('Beam Section Demands', head_level=2)
    Vu = CalcVariable('V_u', Wu*Lb/2, 'kips', 'Beam shear demand')
    Mu = CalcVariable('M_u', Wu*Lb**2/8, 'kip-ft', 'Beam moment demand')


    BodyHeader('Beam Shear Capacity', head_level=1)
    yv = CalcVariable('\lambda_{v}', 2.24*SQRT(E/Fy), '', 'I-shaped member web slenderness factor', code_ref='AISC G2.1(a)')
    if hltw.result() <= yv.result():
        CheckVariablesText(hltw, '<=', yv)
        Pv = CalcVariable('\phi_{v}', 1.0, '', 'Shear resistance factor', code_ref='AISC G2.1(a)')
        Cv = CalcVariable('C_v', 1.0, '', 'Web shear factor', code_ref='AISC Eq. G2-2')

    else:
        CheckVariablesText(hltw, '>', yv)
        Pv = CalcVariable('\phi_{v}', 0.9, '', 'Shear resistance factor', code_ref='AISC G1')
        if hltw.result() > 260:
            hltlim = CalcVariable('h/t_{wlim}', 260, '')
            c1 = CheckVariable( hltw, '<', hltlim, code_ref='AISC G2.1(b)(i)')
            Cv = CalcVariable('C_v', 0.0, '', 'Web shear factor')
        else:
            kv = CalcVariable('k_v', 5, '', code_ref='AISC G2.1(i)')

            yv1 = CalcVariable('\lambda_{v1}', 1.10*SQRT(kv*E/Fy), '', 'Alternative member web compactness factor', code_ref='AISC G2.1(b)(i)')
            yv2 = CalcVariable('\lambda_{v2}', 1.37*SQRT(kv*E/Fy), '', 'Alternative member web slenderness factor', code_ref='AISC G2.1(b)(iii)')

            if hltw.result() <= yv1.result():
                CheckVariablesText(hltw, '<=', yv1)
                Cv = CalcVariable('C_v', 1.0, '', 'Web shear factor', code_ref='AISC Eq. G2-3')
            elif hltw.result() > yv2.result():
                CheckVariablesText(hltw, '>', yv2)
                Cv = CalcVariable('C_v', 1.51*kv*E/(hltw**2*Fy), '', 'Web shear factor', code_ref='AISC Eq. G2-5')
            else:
                CheckVariablesText(yv1, '<', hltw, '<=', yv2)
                Cv = CalcVariable('C_v', 1.10*SQRT(kv*E/Fy)/hltw, '', 'Web shear factor', code_ref='AISC Eq. G2-4')

    Aw = CalcVariable('A_w', d*tw, 'in^2', 'Area of web considered for shear resistance')
    PVn = CalcVariable('\phi V_n', Pv*0.6*Fy*Aw*Cv, 'kips', 'Design shear strength of the section', code_ref='AISC Eq. G2-1')
    CheckVariable(Vu, '<=', PVn)


    BodyHeader('Beam Flexural Capacity', head_level=1)
    Pb = CalcVariable('\phi_{b}', 0.9, '', 'Flexural resistance factor', code_ref='AISC F1(1)')

    BodyHeader('Section Compactness', head_level=2)
    ypf = CalcVariable('\lambda_{pf}', 0.38*SQRT(E/Fy), '', code_ref='AISC Table B4.1b(10)')
    CheckVariable(bfl2tf, '<=', ypf, truestate="CompactFlange", falsestate="ERROR:NotCompactFlange", result_check=False)

    ypw = CalcVariable('\lambda_{pw}', 3.76*SQRT(E/Fy), '', code_ref='AISC Table B4.1b(15)')
    CheckVariable(hltw, '<=', ypw, truestate="CompactWeb", falsestate="ERROR:NotCompactWeb", result_check=False)

    BodyHeader('Plastic Moment Strength', head_level=2)
    Mp = CalcVariable('M_{p}', Fy*Zx/ft_to_in, 'kip-ft', 'Nominal plastic moment strength', code_ref='AISC Eq. F2-1')

    BodyHeader('Yielding Strength', head_level=2)
    Mny = CalcVariable('M_{ny}', Mp, 'kip-ft', code_ref='AISC Eq. F2-1')

    BodyHeader('Lateral-Torsional Buckling', head_level=2)
    Lp = CalcVariable('L_{p}', 1.76*ry*SQRT(E/Fy)/ft_to_in, 'ft', code_ref='AISC Eq. F2-5')
    cc = CalcVariable('c', 1.0, '', code_ref='AISC Eq. F2-8a')
    Lr = CalcVariable('L_{r}', 1.95*rts/ft_to_in*E/(0.7*Fy)*SQRT(J*cc/(Sx*ho) + SQRT((J*cc/(Sx*ho))**2 + 6.76*(0.7*Fy/E)**2)), 'ft', code_ref='AISC Eq. F2-6')

    if Lbu.result() <= Lp.result():
        CheckVariablesText(Lbu, "<=", Lp)
        Mnl = CalcVariable('M_{nltb}', Mp, 'kip-ft', 'The limit state of lateral-torsional buckling does not apply', code_ref='AISC F2.2(a)')
    elif Lbu.result() > Lr.result():
        CheckVariablesText(Lbu, ">", Lr)
        Fcr = CalcVariable('F_{cr}', Cb*PI**2*E/(Lbu*ft_to_in/rts)**2 + SQRT(1 + 0.078*J*cc/(Sx*ho)*(Lbu*ft_to_in/rts)**2), 'ksi', code_ref='AISC Eq. F2-4')
        Mncr = CalcVariable('M_{ncr}', Fcr*Sx/ft_to_in, 'kip-ft', code_ref='AISC F2.2(c)')
        Mnl = CalcVariable('M_{nltb}', MIN(Mncr, Mp), 'kip-ft', code_ref='AISC Eq. F2-3')
    else:
        CheckVariablesText(Lp, '<', Lbu, "<=", Lr)
        Mncr = CalcVariable('M_{ncr}', Cb*BRACKETS(Mp - BRACKETS(Mp-0.7*Fy*Sx/ft_to_in)*(Lbu-Lp)/(Lr-Lp)) , 'kip-ft', code_ref='AISC F2.2(b)')
        Mnl = CalcVariable('M_{nltb}', MIN(Mncr, Mp), 'kip-ft', code_ref='AISC Eq. F2-2')

    BodyHeader('Controlling Strength', head_level=2)
    PMn = CalcVariable('\phi M_n', Pb * MIN(Mny, Mnl), 'kip-ft', 'Design flexural strength of the section')
    CheckVariable(Mu, '<=', PMn)


    calculation_sum = {'head':HeadCollection.head_instances, 'assum': AssumCollection.assum_instances, 'setup':SetupCollection.setup_instances, 'calc':CalcCollection.calc_instances, 'foot':FootCollection.foot_instances}
    return calculation_sum
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()

    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('ASCE 7-16 Seismic Base Shear Calculation')

    DescriptionHead(
        "With structure weight, height, and seismic setting, calculate the seismic design base shear for the main lateral force resisting system."
    )

    ##

    Assumption("Structure is a building or building-like")
    Assumption("The revisions included in section 15.5 do not apply")
    Assumption(
        "Equivalent lateral force procedure is permitted in accordance with Table 12.6-1"
    )

    W = DeclareVariable('W_d', 100, 'kips',
                        'Effective seismic weight per section 12.7.2')
    hn = DeclareVariable('h_n', 16, 'ft',
                         'Structural height defined in section 11.2')
    R = DeclareVariable('R', 3, '', 'Response modification factor')
    Ie = DeclareVariable('I_e', 1, '', 'Importance factor per section 11.5.1')
    Sds = DeclareVariable(
        'S_{DS}', 0.85, 'g',
        'Design spectral response acceleration parameter in the short period range'
    )
    Sd1 = DeclareVariable(
        'S_{D1}', 0.45, 'g',
        'Design spectral response acceleration parameter at a period of one second'
    )
    S1 = DeclareVariable(
        'S_1', 0.55, 'g',
        'Mapped maximum considered earthquake spectral response acceleration parameter'
    )
    TL = DeclareVariable('T_L', 12, 's', 'Long-period transition period')
    Ct = DeclareVariable(
        'C_t', 0.02, '',
        'Coefficient to find approximate fundamental period per Table 12.8-2')
    xt = DeclareVariable(
        'x', 0.75, '',
        'Coefficient to reduce height in approximate fundamental period calculation per Table 12.8-2'
    )

    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###
    Ta = CalcVariable('T_a',
                      Ct * hn**xt,
                      's',
                      'Approximate fundamental period',
                      code_ref='ASCE 12.8-7')

    Csi = CalcVariable('C_{si}', Sds / (R / Ie), '', code_ref='ASCE 12.8-2')

    if Ta.result() <= TL.result():
        Csmax = CalcVariable('C_{smax}',
                             Sd1 / (Ta * R / Ie),
                             '',
                             code_ref='ASCE 12.8-3')
    else:
        Csmax = CalcVariable('C_{smax}',
                             Sd1 * TL / (Ta**2 * R / Ie),
                             '',
                             code_ref='ASCE 12.8-3')

    Csmin1 = CalcVariable('C_{smin1}',
                          0.044 * Sds * Ie,
                          '',
                          code_ref='ASCE 12.8-5')
    Csmin2 = CalcVariable('C_{smin2}', 0.01, '', code_ref='ASCE 12.8-5')

    if S1.result() >= 0.6:
        Csmin3 = CalcVariable('C_{smin3}',
                              0.5 * S1 / (R / Ie),
                              '',
                              code_ref='ASCE 12.8-6')
    else:
        Csmin3 = CalcVariable(
            'C_{smin3}', 0, '',
            'Since S1 is less than 0.6g, ASCE equation 12.8-6 does not apply')

    Cs = CalcVariable('C_{s}',
                      MIN(Csmax, MAX(Csi, Csmin1, Csmin2, Csmin3)),
                      '',
                      'Seismic response coefficient',
                      code_ref='ASCE 12.8.1.1')

    V = CalcVariable('V',
                     Cs * W,
                     'kips',
                     'Seismic base shear',
                     code_ref='ASCE 12.8-1',
                     result_check=True)
    Vv = CalcVariable('V_v',
                      0.2 * V,
                      'kips',
                      'Seismic vertical component',
                      code_ref='ASCE 12.4.2.2',
                      result_check=True)

    calculation_sum = {
        'head': HeadCollection.head_instances,
        'assum': AssumCollection.assum_instances,
        'setup': SetupCollection.setup_instances,
        'calc': CalcCollection.calc_instances,
        'foot': FootCollection.foot_instances
    }
    return calculation_sum
Esempio n. 6
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()



    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('ASCE 7-10 Seismic Design')

    DescriptionHead("Seismic horizontal and vertical acceleration determination in accordance with ASCE 7-10")

    Assumption("2010 version of ASCE 7")
    Assumption("IBC and CBC do not control")

    R = DeclareVariable('R', 3.25, 'in', "Response modification factor for anchored flexible base tank", code_ref='Table 15.4-2, ASCE 7-10')
    I_e = DeclareVariable('I_e', 1.5, '', 'IBC importance factor for earthquake loading (essential facility)', code_ref='Table 1.5-2, ASCE 7-10')
    site_class = DeclareVariable('SiteClass', 'D', '', 'Site site class of soil conditions at project', input_type="select", input_options=site_class_options)
    Ss = DeclareVariable('S_s', 1.888, 'g', 'Spectral response acceleration parameter at short periods')
    S1 = DeclareVariable('S_1', 0.621, 'g', 'Spectral response acceleration parameter at 1s period')
    # section_name = DeclareVariable('Section', 'HSS12X3X5/16', '', 'AISC section size')



    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input)>0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    fa_obj =  FaASCE710.objects(SiteClass=site_class.value).first()
    if Ss.value <= 0.25:
        fa_calc = fa_obj.ss25
    else:
        fa_calc = fa_obj.ss125
        # fa_calc = 1.1

    Fa = CalcVariable('F_a', fa_calc, '','Short period site coefficient', code_ref='Table 11.4-1, ASCE 7-10')
    Fv = CalcVariable('F_v', 1.5, '', 'Long period site coefficient', code_ref='Table 11.4-2, ASCE 7-10')

    s_ms = CalcVariable('S_{MS}', Fa*Ss, 'g', 'MCE spectral response acceleration factor at short periods', code_ref="Eq.11.4-1, ASCE 7-10")
    s_ds = CalcVariable('S_{DS}', (2/3)*s_ms, 'g', 'Design spectral response acceleration factor at short periods', code_ref='Eq.11.4-3, ASCE 7-10')

    s_m1 = CalcVariable('S_{M1}', Fa*S1, 'g', 'MCE spectral response acceleration factor at a 1 second period', code_ref="Eq.11.4-2, ASCE 7-10")
    s_d1 = CalcVariable('S_{D1}', (2/3)*s_m1, 'g', 'Design spectral response acceleration factor at a 1 second period', code_ref='Eq.11.4-4, ASCE 7-10')

    BodyHeader('Effective Seismic horizontal acceleration:')
    BodyText('(strength)')
    c_s = CalcVariable('C_s', s_ds/(DIV(R,I_e)), 'g', result_check=True)
    BodyText('(allowable)')
    c_sa = CalcVariable('C_{sa}', c_s/1.4, 'g')

    BodyHeader('Effective Seismic vertical acceleration:')
    BodyText('(strength)')
    c_v = CalcVariable('C_v', 0.2*s_ds, 'g', result_check=True)
    BodyText('(allowable)')
    c_va = CalcVariable('C_{va}', c_v/1.4, 'g')
    #
    # section = AISCSectionsRectangular.objects(AISC_name=section_name.value).first()
    # nomB = CalcVariable('b_{nom}', section.B, 'in', 'Nominal section width', result_check=True)
    # actualB = CalcVariable('b_{des}', section.b, 'in', 'Actual (design) section width', result_check=True)
    #
    # testervar = CalcVariable('Long_{sub}', SQRT(Fa + Fv**Fa - POW((0.001*c_s*c_sa/c_va),3))+s_ms*19+R/I_e*Ss*99916, 'g')
    #
    # anothervar = CalcVariable('V_{env}', POW((s_m1+s_d1)/s_ms,4)-POW(s_ds, 4),'g')
    #
    # compare = CheckVariable(s_m1, '>', s_ms, result_check=True)

    calculation_sum = {'head':HeadCollection.head_instances, 'assum': AssumCollection.assum_instances, 'setup':SetupCollection.setup_instances, 'calc':CalcCollection.calc_instances, 'foot':FootCollection.foot_instances}
    return calculation_sum
Esempio n. 7
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()

    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('Stair Column and Brace Design to ADM 2015')

    DescriptionHead(
        "Aluminum stair platform column and lateral brace design with weight, seismic base shear, and geometry. "
    )

    ##

    Assumption(
        "Seismic loads and load combinations are in accordance with ASCE 7-16")
    Assumption("Requirements of OSHA 1910.25 and ANSI 1264.1 are met")
    Assumption(
        "Aluminum members are designed in accordance with the Aluminum Design Manual (ADM) 2015 edition"
    )
    Assumption(
        "Stainless steel bolts are designed in accordance with AISC Design Guide 27 2013 edition"
    )
    Assumption(
        "Four columns are equally loaded below a generally square platform")
    Assumption(
        "Columns are aluminum I beams and brace members are single angles")
    Assumption(
        "Bracing is shaped as a Warren truss with each member equally spaced through the full column height"
    )
    Assumption("Column design is governed by compression")
    Assumption("Angle braces are designed to support full lateral load")
    Assumption(
        "Brace is bolted with a single bolt on the longer leg (if unequal)")
    # Assumption("Bolts are ASTM F593 304 SS and Nuts are ASTM F594 304 SS")
    Assumption("Members are unwelded")
    Assumption(
        "Torsional section properties are calculated in accordance with the AISC Design Guide 9"
    )

    Wd = DeclareVariable('W_d', 10, 'kips', 'Tributary dead load of platform')
    Wl = DeclareVariable('W_l', 3, 'kips', 'Tributary live load of platform')
    Vs = DeclareVariable('V_s', 4, 'kips',
                         'Design seismic base shear for platform')
    Vv = DeclareVariable('V_v', 1, 'kips',
                         'Design seismic vertical load for platform')

    wp = DeclareVariable('w_{pn}', 4, 'ft', 'Spacing of columns (min)')
    wpx = DeclareVariable('w_{px}', 6, 'ft', 'Spacing of columns (max)')
    hp = DeclareVariable('h_p', 10, 'ft',
                         'Height of platform column from base')
    Lbc = DeclareVariable('L_{bc}', 10, 'ft', 'Column unbraced length')
    Kc = DeclareVariable('k_{c}', 1, '', 'Column effective length factor')

    sizec = DeclareVariable('Section_{c}',
                            'I 8 x 7.02',
                            '',
                            'Column section size',
                            input_type='select',
                            input_options=alum_wf_sizes)
    sizeb = DeclareVariable('Section_{b}',
                            'L 2 1/2 x 2 1/2 x 3/8',
                            '',
                            'Brace section size',
                            input_type='select',
                            input_options=alum_angle_sizes)
    Numb = DeclareVariable('N_b', 4, '',
                           'Number of equal-length brace memebers')
    Dbb = DeclareVariable('D_{bb}', 5 / 8, 'in',
                          'Bolt diameter at brace connection')
    Dbh = DeclareVariable('D_{bh}', 13 / 16, 'in',
                          'Bolt hole diameter at brace connection')
    de = DeclareVariable(
        'd_e', 3, 'in',
        'Minimum distance from bolt center to end of connected member')

    Ftu = DeclareVariable('F_{tu}',
                          38,
                          'ksi',
                          'Aluminum tensile ultimate strength',
                          code_ref='ADM Table A.3.3')
    Fty = DeclareVariable('F_{ty}',
                          35,
                          'ksi',
                          'Aluminum tensile yield strength',
                          code_ref='ADM Table A.3.3')
    Fcy = DeclareVariable('F_{cy}',
                          35,
                          'ksi',
                          'Aluminum compressive yield strength',
                          code_ref='ADM Table A.3.1')
    Fbu = DeclareVariable('F_{bu}',
                          65,
                          'ksi',
                          'Bolt tensile ultimate strength',
                          code_ref='DG27 Table 2-4')
    kt = DeclareVariable('k_t',
                         1,
                         '',
                         'Tension coefficient',
                         code_ref='ADM Table A.3.3')
    E = DeclareVariable('E',
                        10100,
                        'ksi',
                        'Modulus of Elasticity',
                        code_ref='ADM Table A.3.1')
    G = DeclareVariable('G',
                        3800,
                        'ksi',
                        'Shear modulus of elasticity',
                        code_ref='ADM Table A.3.1')

    Pc = DeclareVariable('\phi_c',
                         0.9,
                         '',
                         'Resistance factor for compression',
                         code_ref='ADM E.1')
    Pty = DeclareVariable('\phi_{ty}',
                          0.9,
                          '',
                          'Resistance factor for tensile yielding',
                          code_ref='ADM D.1')
    Ptr = DeclareVariable('\phi_{tr}',
                          0.75,
                          '',
                          'Resistance factor for tensile rupture',
                          code_ref='ADM D.1')
    Pbs = DeclareVariable('\phi_{bs}',
                          0.75,
                          '',
                          'Resistance factor for block shear',
                          code_ref='ADM J.7.3')
    Pb = DeclareVariable('\phi_b',
                         0.75,
                         '',
                         'Resistance factor for bolt strength',
                         code_ref='DG27 9.3.4')

    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')

    BodyHeader(
        'Buckling Constants (ADM Table B.4.2)', head_level=1
    )  ######################################################################################
    kap = CalcVariable('\kappa', 1.0, 'ksi')

    BodyHeader('Member buckling (Intercept, Slope, and Intersection):')
    Bc = CalcVariable('B_c', Fcy * BRACKETS(1 + (Fcy / (2250 * kap))**(1 / 2)),
                      'ksi')
    Dc = CalcVariable('D_c', Bc / 10 * (Bc / E)**(1 / 2), 'ksi')
    Cc = CalcVariable('C_c', 0.41 * Bc / Dc)

    BodyHeader(
        'Uniform compression in flat elements (Intercept, Slope, and Intersection):'
    )
    Bp = CalcVariable('B_p', Fcy * BRACKETS(1 + (Fcy / (1500 * kap))**(1 / 3)),
                      'ksi')
    Dp = CalcVariable('D_p', Bp / 10 * (Bp / E)**(1 / 2), 'ksi')
    Cp = CalcVariable('C_p', 0.41 * Bp / Dp)

    BodyHeader('Load demands on members', head_level=1)
    Fosha = CalcVariable(
        r'\beta_{osha}', 5, '',
        'Design for 5 times the service loads for OSHA compliance')
    Bu = CalcVariable(
        'B_{u}', Vs / 2 * SQRT(wp**2 + (hp / Numb)**2) / wp * k_to_lb, 'lbs',
        'Maximum compressive and tensile demand in brace element due to seismic forces'
    )

    Pu1 = CalcVariable('P_{u1}',
                       1.4 * Wd / 4 * k_to_lb,
                       'lbs',
                       'Compression demand on each column due to dead load',
                       code_ref='ASCE 2.3.1(1)')
    Pu2 = CalcVariable(
        'P_{u2}',
        BRACKETS(Wd / 4 + Fosha * Wl / 4) * k_to_lb,
        'lbs',
        'Compression demand on each column due to dead and live load',
        code_ref='OSHA 19.25(b)(6)')
    Pu6 = CalcVariable(
        'P_{u6}',
        BRACKETS(1.2 * Wd / 4 + Wl / 4 + Vv / 4 + Vs / 2 *
                 (hp / wp)) * k_to_lb,
        'lbs',
        'Maximum compression demand on a column due to dead, live, and seismic load',
        code_ref='ASCE 2.3.6(6)')

    Pu = CalcVariable('P_{u}', MAX(Pu1, Pu2, Pu6), 'lbs',
                      'Design compression demand on column elements')

    BodyHeader('Column Member Design', head_level=1)
    BodyHeader('Section properties')
    sectionc = AlumShapesWF.objects(Size=sizec.value).first()
    Ac = CalcVariable('A_{c}', sectionc.A, 'in^2')
    bc = CalcVariable('b_{fc}', sectionc.bf, 'in')
    tfc = CalcVariable('t_{fc}', sectionc.tf, 'in')
    twc = CalcVariable('t_{wc}', sectionc.tw, 'in')
    Rc = CalcVariable('R_{c}', sectionc.R1, 'in')
    Ixc = CalcVariable('I_{xc}', sectionc.Ix, 'in^4')
    Iyc = CalcVariable('I_{yc}', sectionc.Iy, 'in^4')
    ryc = CalcVariable('r_{yc}', sectionc.ry, 'in')
    Cwc = CalcVariable('C_{wc}', sectionc.Cw, 'in^6')
    Jc = CalcVariable('J_{c}', sectionc.J, 'in^4')

    BodyHeader(
        'Column Compression Design (ADM Chapter E)', head_level=2
    )  ######################################################################################

    BodyHeader('Member Buckling (ADM E.2)')
    y1c = CalcVariable('\lambda_{1c}', (Bc - Fcy) / Dc, '')
    ycf = CalcVariable('\lambda_{cf}',
                       Kc * Lbc * ft_to_in / ryc,
                       '',
                       'Member slenderness ratio for flexural buckling',
                       code_ref='ADM E.2.1')
    Fec = CalcVariable('F_{ec}',
                       BRACKETS(PI**2 * E * Cwc /
                                (Kc * Lbc * ft_to_in)**2 + G * Jc) /
                       (Ixc + Iyc),
                       'ksi',
                       'Elastic buckling stress for torsional buckling',
                       code_ref='ADM E.2-4')
    yct = CalcVariable('\lambda_{ct}',
                       PI * SQRT(E / Fec),
                       '',
                       'Member slenderness ratio for torsional buckling',
                       code_ref='ADM E.2-3')

    yc = CalcVariable('\lambda_{c}',
                      MAX(ycf, yct),
                      '',
                      'Greatest compression member slenderness',
                      code_ref='ADM E.2')

    if yc.result() <= y1c.result():
        CheckVariablesText(yc, '<=', y1c)
        BodyText('Member yielding controls')
        Fcc = CalcVariable('F_{cc}', Fcy, 'ksi', code_ref='ADM E.2')
    elif yc.result() < Cc.result():
        CheckVariablesText(y1c, '<', yc, '<', Cc)
        BodyText('Inelastic buckling controls')
        Fcc = CalcVariable('F_{cc}',
                           BRACKETS(Bc - Dc * yc) *
                           BRACKETS(0.85 + 0.15 * (Cc - yc) / (Cc - y1c)),
                           'ksi',
                           code_ref='ADM E.2')
    else:
        CheckVariablesText(yc, '>=', Cc)
        BodyText('Elastic buckling controls')
        Fcc = CalcVariable('F_{cc}',
                           0.85 * PI**2 * E / yc**2,
                           'ksi',
                           code_ref='ADM E.2')
    PPncm = CalcVariable('\phi P_{ncm}',
                         Pc * Fcc * Ac * k_to_lb,
                         'lbs',
                         'Member buckling strength',
                         code_ref='ADM E.2-1')

    BodyHeader('Local Buckling (ADM E.3)')
    k1c = CalcVariable('k_{1c}', 0.35, '',
                       code_ref='ADM Table B.4.3')  # assume temper T6
    k2c = CalcVariable('k_{2c}', 2.27, '', code_ref='ADM Table B.4.3')
    y1e = CalcVariable('\lambda_{1e}', (Bp - Fcy) / Dp, '')
    y2e = CalcVariable('\lambda_{2e}', k1c * Bp / Dp, '')
    Fee = CalcVariable('F_{ee}',
                       PI**2 * E /
                       (5 * BRACKETS((bc - twc) / 2 - Rc) / tfc)**2,
                       'ksi',
                       code_ref='ADM Table B.5.1')
    yeq = CalcVariable('\lambda_{eq}',
                       PI * SQRT(E / Fee),
                       '',
                       code_ref='ADM B.5-11')

    if yeq.result() <= y1e.result():
        CheckVariablesText(yeq, '<=', y1e)
        BodyText('Member yielding controls')
        Fcec = CalcVariable('F_{cec}', Fcy, 'ksi', code_ref='ADM B.5.4.6')
    elif yeq.result() < y2e.result():
        CheckVariablesText(y1e, '<=', yeq, '<', y2e)
        BodyText('Inelastic buckling controls')
        Fcec = CalcVariable('F_{cec}',
                            Bp - Dp * yeq,
                            'ksi',
                            code_ref='ADM B.5.4.6')
    else:
        CheckVariablesText(yeq, '>=', y2e)
        BodyText('Elastic buckling controls')
        Fcec = CalcVariable('F_{cec}',
                            k2c * SQRT(Bp * E) / yeq,
                            'ksi',
                            code_ref='ADM B.5.4.6')
    PPnce = CalcVariable('\phi P_{nce}',
                         Pc * Fcec * Ac * k_to_lb,
                         'lbs',
                         'Member local buckling strength',
                         code_ref='ADM E.3-2')

    PPnc = CalcVariable('\phi P_{nc}', MIN(PPncm, PPnce), 'lbs',
                        'Member compressive strength')
    CheckVariable(Pu,
                  '<=',
                  PPnc,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader('Brace Member Design', head_level=1)
    BodyHeader('Section properties')
    sectionb = AlumShapesL.objects(Size=sizeb.value).first()
    Ab = CalcVariable('A_{b}', sectionb.A, 'in^2')
    tb = CalcVariable('t_{b}', sectionb.t, 'in')
    bb = CalcVariable('b_{b}', sectionb.b, 'in')
    db = CalcVariable('d_{b}', sectionb.d, 'in')
    Ibx = CalcVariable('I_{bx}', sectionb.Ix, 'in^4')
    rbx = CalcVariable('r_{bx}', sectionb.rx, 'in')
    xob = CalcVariable('x_{ob}', sectionb.x, 'in')
    Iby = CalcVariable('I_{by}', sectionb.Iy, 'in^4')
    rby = CalcVariable('r_{by}', sectionb.ry, 'in')
    yob = CalcVariable('y_{ob}', sectionb.y, 'in')
    Ibz = CalcVariable('I_{bz}', sectionb.Iz, 'in^4')
    rbz = CalcVariable('r_{bz}', sectionb.rz, 'in')
    Rb = CalcVariable('R_b', sectionb.R1, 'in')
    rbmin = CalcVariable('r_{bmin}', MIN(rbx, rby, rbz), 'in')

    BodyHeader(
        'Brace Tensile Design (ADM Chapter D)', head_level=2
    )  ######################################################################################
    PPbty = CalcVariable('\phi P_{bty}',
                         Pty * Fty * Ab * k_to_lb,
                         'lbs',
                         'Tensile yielding capacity of gross member',
                         code_ref='ADM D.2-1')
    Abn = CalcVariable('A_{bn}', Ab - Dbh * tb, 'in^2',
                       'Net area of brace at connection')
    Abe = CalcVariable('A_{be}',
                       Abn * 1,
                       'in^2',
                       'Effective net area of brace at connection',
                       code_ref='ADM D.3-1')
    PPbtr = CalcVariable('\phi P_{btr}',
                         Ptr * Ftu * Abe / kt * k_to_lb,
                         'lbs',
                         'Tensile rupture capacity of member net section',
                         code_ref='ADM D.2-1')
    PPbt = CalcVariable('\phi P_{bt}', MIN(PPbty, PPbtr), 'lbs',
                        'Member tensile strength')
    CheckVariable(Bu,
                  '<=',
                  PPbt,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader(
        'Brace Compression Design (ADM Chapter E)', head_level=2
    )  ######################################################################################

    BodyHeader('Member Buckling (ADM E.2)')
    Lbb = CalcVariable('L_{bb}', SQRT(wpx**2 + (hp / Numb)**2), 'ft',
                       'Length of brace member')
    Kb = CalcVariable('K_b', 1.0, '', 'Brace member effective length factor')
    ybf = CalcVariable('\lambda_{cf}',
                       Kb * Lbb * ft_to_in / rbmin,
                       '',
                       'Member slenderness ratio for flexural buckling',
                       code_ref='ADM E.2.1')

    if db.result() != bb.result():
        BodyText(
            'Torsional buckling design will apply the singly symmetric method of ADM Section E.2.2(b) with the conservative modification of treating the section as an equal leg angle of the smaller leg.'
        )

    bbmin = CalcVariable('b_{bmin}', MIN(bb, db), 'in')
    Ibmin = CalcVariable('I_{bmin}', MIN(Ibx, Iby), 'in^4')
    xobmin = CalcVariable('x_{bmin}', MIN(xob, yob), 'in')

    rob2 = CalcVariable(
        'r_{ob}^2',
        2 * xobmin**2 + 2 * Ibmin / (tb * BRACKETS(2 * bbmin - tb)),
        'in^2',
        'Polar radius of gyration about the shear center (squared)',
        code_ref='ADM E.2-7')
    Hb = CalcVariable('H_b',
                      1 - (2 * xobmin**2) / rob2,
                      '',
                      code_ref='ADM E.2-8')
    Ibxy = CalcVariable(
        'I_{bxy}', tb**2 / 4 * BRACKETS(2 * bbmin**2 - tb**2) -
        xobmin**2 * tb * BRACKETS(2 * bbmin - tb), 'in^4',
        'Product of inertia')
    Iyp = CalcVariable('I_{byp}', Ibmin + ABS(Ibxy), 'in^4',
                       'Principal moment of inertia (axis of symmetry)')
    ryp = CalcVariable('r_{byp}', SQRT(Iyp / Ab), 'in')
    Jb = CalcVariable('J_b',
                      2 * bbmin * tb**3 / 3,
                      'in^4',
                      code_ref='DG9 Eq. 3.4')
    Cwb = CalcVariable('C_{wb}',
                       2 * tb**3 / 36 * (bbmin - tb / 2)**3,
                       'in^6',
                       code_ref='DG9 Eq. 3.34')

    Feyp = CalcVariable('F_{eyp}',
                        PI**2 * E / (Kb * Lbb * ft_to_in / ryp)**2,
                        'ksi',
                        'Elastic buckling strength about axis of symmetry',
                        code_ref='ADM E.2-10')
    Fez = CalcVariable('F_{ez}',
                       ONE / (Ab * rob2) * BRACKETS(G * Jb + PI**2 * E * Cwb /
                                                    (Kb * Lbb * ft_to_in)**2),
                       'ksi',
                       code_ref='ADM E.2-11')

    Feb = CalcVariable('F_{eb}', (Feyp + Fez) / (2 * Hb) *
                       BRACKETS(1 - SQRT(1 - 4 * Feyp * Fez * Hb /
                                         (Feyp + Fez)**2)),
                       'ksi',
                       'Elastic buckling stress for torsional buckling',
                       code_ref='ADM E.2-5')
    ybt = CalcVariable('\lambda_{bt}',
                       PI * SQRT(E / Feb),
                       '',
                       'Member slenderness ratio for torsional buckling',
                       code_ref='ADM E.2-3')

    ycb = CalcVariable('\lambda_{cb}',
                       MAX(ybf, ybt),
                       '',
                       'Greatest compression member slenderness',
                       code_ref='ADM E.2')

    if ycb.result() <= y1c.result():
        CheckVariablesText(ycb, '<=', y1c)
        BodyText('Member yielding controls')
        Fcb = CalcVariable('F_{cb}', Fcy, 'ksi', code_ref='ADM E.2')
    elif ycb.result() < Cc.result():
        CheckVariablesText(y1c, '<', ycb, '<', Cc)
        BodyText('Inelastic buckling controls')
        Fcb = CalcVariable('F_{cb}',
                           BRACKETS(Bc - Dc * ycb) *
                           BRACKETS(0.85 + 0.15 * (Cc - ycb) / (Cc - y1c)),
                           'ksi',
                           code_ref='ADM E.2')
    else:
        CheckVariablesText(ycb, '>=', Cc)
        BodyText('Elastic buckling controls')
        Fcb = CalcVariable('F_{cb}',
                           0.85 * PI**2 * E / ycb**2,
                           'ksi',
                           code_ref='ADM E.2')
    PPnbm = CalcVariable('\phi P_{nbm}',
                         Pc * Fcb * Ab * k_to_lb,
                         'lbs',
                         'Member buckling strength',
                         code_ref='ADM E.2-1')

    BodyHeader('Local Buckling (ADM E.3)')
    bbmax = CalcVariable('b_{bmax}', MAX(bb, db), 'in')
    Feeb = CalcVariable('F_{eeb}',
                        PI**2 * E / (5 * BRACKETS(bbmax - tb - Rb) / tb)**2,
                        'ksi',
                        code_ref='ADM Table B.5.1')
    yeqb = CalcVariable('\lambda_{eqb}',
                        PI * SQRT(E / Feeb),
                        '',
                        code_ref='ADM B.5-11')

    if yeqb.result() <= y1e.result():
        CheckVariablesText(yeqb, '<=', y1e)
        BodyText('Member yielding controls')
        Fceb = CalcVariable('F_{ceb}', Fcy, 'ksi', code_ref='ADM B.5.4.6')
    elif yeqb.result() < y2e.result():
        CheckVariablesText(y1e, '<=', yeqb, '<', y2e)
        BodyText('Inelastic buckling controls')
        Fceb = CalcVariable('F_{ceb}',
                            Bp - Dp * yeqb,
                            'ksi',
                            code_ref='ADM B.5.4.6')
    else:
        CheckVariablesText(yeqb, '>=', y2e)
        BodyText('Elastic buckling controls')
        Fceb = CalcVariable('F_{ceb}',
                            k2c * SQRT(Bp * E) / yeqb,
                            'ksi',
                            code_ref='ADM B.5.4.6')
    PPnbe = CalcVariable('\phi P_{nbe}',
                         Pc * Fceb * Ab * k_to_lb,
                         'lbs',
                         'Member local buckling strength',
                         code_ref='ADM E.3-2')

    PPnb = CalcVariable('\phi P_{nb}', MIN(PPnbm, PPnbe), 'lbs',
                        'Member compressive strength')
    CheckVariable(Bu,
                  '<=',
                  PPnb,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader(
        'Brace Connection Design (ADM Chapter J)', head_level=2
    )  ######################################################################################

    BodyHeader('Bearing Strength (ADM Section J.3.6)')
    Rn1 = CalcVariable('R_{n1}', de * tb * Ftu * k_to_lb, 'lbs', '')
    Rn2 = CalcVariable('R_{n2}', 2 * Dbb * tb * Ftu * k_to_lb, 'lbs', '')
    PRnb = CalcVariable('\phi R_{nb}',
                        Pb * MIN(Rn1, Rn2),
                        'lbs',
                        'Bolt bearing strength',
                        code_ref='ADM J.3-4')
    CheckVariable(Bu,
                  '<=',
                  PRnb,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader('Block Shear Strength (ADM Section J.7.3)')
    Agt = CalcVariable('A_{gt}', bbmin / 2 * tb, 'in^2',
                       'Gross tensile area of brace connection')
    Agv = CalcVariable('A_{gv}', de * tb, 'in^2',
                       'Gross shear area of brace connection')
    Ant = CalcVariable('A_{nt}', Agt - Dbh * tb / 2, 'in^2')
    Anv = CalcVariable('A_{nv}', Agv - Dbh * tb / 2, 'in^2')
    Fsy = CalcVariable('F_{sy}', 0.6 * Fty, 'ksi', code_ref='ADM Table A.3.1')
    Fsu = CalcVariable('F_{su}', 0.6 * Ftu, 'ksi', code_ref='ADM Table A.3.1')

    Anv6 = CalcVariable('0.6 \ A_{nv}', 0.6 * Anv, 'in^2')

    if Ant.result() >= 0.6 * Anv.result():
        CheckVariablesText(Ant, '>=', Anv6)
        Rns = CalcVariable('R_{ns}',
                           Fsy * Agv + Ftu * Ant / kt,
                           'kips',
                           code_ref='ADM J.7-1')
    else:
        CheckVariablesText(Ant, '<', Anv6)
        Rns = CalcVariable('R_{ns}',
                           Fsu * Anv / kt + Fty * Agt,
                           'kips',
                           code_ref='ADM J.7-2')
    PRns = CalcVariable('\phi R_{ns}', Pbs * Rns * k_to_lb, 'lbs',
                        'Block shear strength')
    CheckVariable(Bu,
                  '<=',
                  PRns,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader(
        'Bolt Strength Design (DG27 Chapter 9)', head_level=2
    )  ######################################################################################
    Fnv = CalcVariable(
        'F_{nv}', 0.45 * Fbu, 'ksi',
        'Bolt nominal shear strength assuming threads are not excluded from the shear plane'
    )
    PRn = CalcVariable('\phi R_n',
                       Pb * Fnv * PI * (Dbb / 2)**2 * k_to_lb, 'lbs',
                       'Bolt shear strength')
    CheckVariable(Bu,
                  '<=',
                  PRn,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    BodyHeader('Seismic Overturning Stability Check', head_level=1)
    OM = CalcVariable('OM', Vs * hp, 'kip-ft',
                      'Overturning moment due to seismic loading')
    RM = CalcVariable('RM', 0.9 * Wd * wp / 2, 'kip-ft',
                      'Restoring moment due to reduced dead load')
    CheckVariable(OM,
                  '<=',
                  RM,
                  truestate="OK",
                  falsestate="ERROR",
                  result_check=True)

    calculation_sum = {
        'head': HeadCollection.head_instances,
        'assum': AssumCollection.assum_instances,
        'setup': SetupCollection.setup_instances,
        'calc': CalcCollection.calc_instances,
        'foot': FootCollection.foot_instances
    }
    return calculation_sum
Esempio n. 8
0
    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            if new_value := updated_input.get(input_variable.name):
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')

    BodyHeader('Tension Design (ACI 318-14 17.4)', head_level=1)

    db = CalcVariable('d_b', Da / 8, 'in', 'Anchor bar diameter')
    aa = CalcVariable('A_a', PI * (db / 2)**2, 'in^2', 'Area of steel anchor')
    atot = CalcVariable('A_{stot}', aa * Na, 'in^2',
                        'Total steel area of anchors')

    BodyHeader('Steel Anchor', head_level=2)
    futa = CalcVariable('f_{uta}',
                        MIN(1.9 * Fsy, 90000),
                        'psi',
                        code_ref='ACI 318-14 17.4.1.2, ESR-3814')
    Nsa = CalcVariable('N_{sa}', atot * futa, 'lbs',
                       'Nominal strength of anchor in tension')
    Phis = CalcVariable(
        r'\phi_{steel}',
        0.65,
        description='Strength reduction factor for steel tension',
Esempio n. 9
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()

    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('ASCE 7-16 Seismic Design')

    DescriptionHead(
        "Seismic design horizontal and vertical acceleration determination in accordance with ASCE 7-16"
    )

    Assumption("ASCE 7-16 controls seismic design")
    Assumption(
        "The exceptions of section 11.4.8 are met for site class D, E or F")
    Assumption("Tank meets the criteria for exceptions in section 15.4.1")
    Assumption(
        "The tank period (T) is less than the long-period transition period (TL)"
    )

    R = DeclareVariable(
        'R',
        3.25,
        'in',
        "Response modification factor for anchored flexible base tank",
        code_ref='Table 15.4-2, ASCE 7-10')
    I_e = DeclareVariable(
        'I_e',
        1.5,
        '',
        'IBC importance factor for earthquake loading (essential facility)',
        code_ref='Table 1.5-2, ASCE 7-10')
    T_L = DeclareVariable('T_L', 12, 's', 'Long-period transition period')
    site_class = DeclareVariable(
        'SiteClass',
        'D',
        '',
        'Site site class of soil conditions at project',
        input_type="select",
        input_options=site_class_options)
    Ss = DeclareVariable(
        'S_s', 1.0, 'g',
        'Spectral response acceleration parameter at short periods')
    S1 = DeclareVariable(
        'S_1', 0.5, 'g',
        'Spectral response acceleration parameter at 1s period')

    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

# Interpolate Fa and Fv from ASCE tables
    fa_obj = FaASCE716.objects(SiteClass=site_class.value).first()
    if Ss.value <= 0.25:
        fa_calc = fa_obj.ss25
    elif Ss.value < 0.50:
        fa_calc = fa_obj.ss25 + (Ss.value - 0.25) * (
            fa_obj.ss50 - fa_obj.ss25) / (0.50 - 0.25)
    elif Ss.value < 0.75:
        fa_calc = fa_obj.ss50 + (Ss.value - 0.50) * (
            fa_obj.ss75 - fa_obj.ss50) / (0.75 - 0.50)
    elif Ss.value < 1.0:
        fa_calc = fa_obj.ss75 + (Ss.value - 0.75) * (
            fa_obj.ss100 - fa_obj.ss75) / (1.0 - 0.75)
    elif Ss.value < 1.25:
        fa_calc = fa_obj.ss100 + (Ss.value - 1.0) * (
            fa_obj.ss125 - fa_obj.ss100) / (1.25 - 1.0)
    else:
        fa_calc = fa_obj.ss125

    fv_obj = FvASCE716.objects(SiteClass=site_class.value).first()
    if S1.value <= 0.1:
        fv_calc = fv_obj.s11
    elif S1.value < 0.2:
        fv_calc = fv_obj.s11 + (S1.value - 0.1) * (fv_obj.s12 -
                                                   fv_obj.s11) / (0.2 - 0.1)
    elif S1.value < 0.3:
        fv_calc = fv_obj.s12 + (S1.value - 0.2) * (fv_obj.s13 -
                                                   fv_obj.s12) / (0.3 - 0.2)
    elif S1.value < 0.4:
        fv_calc = fv_obj.s13 + (S1.value - 0.3) * (fv_obj.s14 -
                                                   fv_obj.s13) / (0.4 - 0.3)
    elif S1.value < 0.5:
        fv_calc = fv_obj.s14 + (S1.value - 0.4) * (fv_obj.s15 -
                                                   fv_obj.s14) / (0.5 - 0.4)
    elif S1.value < 0.6:
        fv_calc = fv_obj.s15 + (S1.value - 0.5) * (fv_obj.s16 -
                                                   fv_obj.s15) / (0.6 - 0.5)
    else:
        fv_calc = fv_obj.s16

    Fa = CalcVariable('F_a',
                      fa_calc,
                      '',
                      'Short period site coefficient',
                      code_ref='Table 11.4-1, ASCE 7-16')
    Fv = CalcVariable('F_v',
                      fv_calc,
                      '',
                      'Long period site coefficient',
                      code_ref='Table 11.4-2, ASCE 7-16')

    s_ms = CalcVariable('S_{MS}',
                        Fa * Ss,
                        'g',
                        '',
                        code_ref="Eq.11.4-1, ASCE 7-16")
    s_ds = CalcVariable(
        'S_{DS}', (2 / 3) * s_ms,
        'g',
        'Design spectral response acceleration factor at short periods',
        result_check=True,
        code_ref='Eq.11.4-3, ASCE 7-16')

    s_m1 = CalcVariable('S_{M1}',
                        Fv * S1,
                        'g',
                        '',
                        code_ref="Eq.11.4-2, ASCE 7-16")
    s_d1 = CalcVariable(
        'S_{D1}', (2 / 3) * s_m1,
        'g',
        'Design spectral response acceleration factor at a 1 second period',
        result_check=True,
        code_ref='Eq.11.4-4, ASCE 7-16')

    BodyHeader('Effective Seismic horizontal acceleration (Section 12.8.1.1):')
    c_smin0 = Variable('0.01 g', 0.01, unit="g")
    c_smin1 = CalcVariable('C_{s,min1}',
                           MAX(0.044 * s_ds * I_e, c_smin0),
                           'g',
                           code_ref='Eq. 15.4-3')
    if S1.value >= 0.6:
        c_smin2 = CalcVariable('C_{s,min2}',
                               0.5 * S1 / (R / I_e),
                               'g',
                               'Since S1 > 0.6g:',
                               code_ref='Eq. 15.4-4')
    else:
        c_smin2 = CalcVariable('C_{s,min2}', 0, 'g', 'Since S1 < 0.6g:')
    c_scalc = CalcVariable('C_{s,calc}', s_ds / (DIV(R, I_e)), 'g')
    c_s = CalcVariable('C_s',
                       MAX(c_smin1, c_smin2, c_scalc),
                       'g',
                       code_ref='strength')
    c_sa = CalcVariable('C_{sa}',
                        c_s / 1.4,
                        'g',
                        code_ref='allowable',
                        result_check=True)

    BodyHeader('Effective seismic vertical acceleration (Section 12.4.2.2):')
    c_v = CalcVariable('C_v', 0.2 * s_ds, 'g', code_ref='strength')
    c_va = CalcVariable('C_{va}',
                        c_v / 1.4,
                        'g',
                        code_ref='allowable',
                        result_check=True)

    calculation_sum = {
        'head': HeadCollection.head_instances,
        'assum': AssumCollection.assum_instances,
        'setup': SetupCollection.setup_instances,
        'calc': CalcCollection.calc_instances,
        'foot': FootCollection.foot_instances
    }
    return calculation_sum
Esempio n. 10
0
def create_calculation(updated_input={}):
    HeadCollection.head_instances.clear()
    AssumCollection.assum_instances.clear()
    SetupCollection.setup_instances.clear()
    CalcCollection.calc_instances.clear()
    FootCollection.foot_instances.clear()

    ###   DEFINE TITLE, DESCRIPTION, ASSUMPTIONS, AND INPUTS   ###

    CalculationTitle('AISC Steel Handrail Flexure')

    DescriptionHead("Flexural design for carbon steel handrail.")

    Assumption("Carbon steel pipe section")
    Assumption(
        "AISC steel construction manual 14th edition, specification section F.8"
    )
    Assumption("OSHA 1910.23 loading")
    Assumption("Compact section is selected")
    Assumption("End span controls design")

    wh = DeclareVariable('w_h', 50, 'lbs/ft',
                         'Uniform horizontal load in ASCE 7-10 Section 4.5.1')
    Le = DeclareVariable('L_e', 3.8, 'ft',
                         'Maximum post spacing for end posts')
    ku = DeclareVariable(
        'k_u', 8, '',
        'Bending moment constant for uniform load on single span')
    OD = DeclareVariable('D_{outer}', 1.9, 'in',
                         'Outer diameter of handrail pipe section')
    tdes = DeclareVariable('t_{design}', 0.186, 'in',
                           'Design thickness of handrail pipe section')
    Fy = DeclareVariable('F_y', 35000, 'psi',
                         'Minimum yield strength of A53 Grade B steel')
    Em = DeclareVariable('E', 29000000, 'psi',
                         'Modulus of elasticity for carbon steel')
    Zx = DeclareVariable('Z_x', 0.421, 'in^3', 'Plastic section modulus')
    Om = DeclareVariable(
        '\Omega', 1.67, '',
        'Flexure safety factor in AISC specification section F.1')

    ###   DO NOT DEFINE INPUTS BELOW HERE OR EDIT THE FOLLOWING SECTION   ###

    if len(updated_input) > 0:
        for input_variable in DeclareVariable.instances:
            new_value = updated_input.get(input_variable.name)
            if new_value:
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    Dt = CalcVariable('D/t', OD / tdes, '')
    srmax = CalcVariable('S_{max}', 0.45 * Em / Fy, '',
                         'Maximum allowable slenderness ratio')
    srcom = CalcVariable('S_{compact}', 0.07 * Em / Fy, '',
                         'Slenderness ratio for compact sections')

    comcheck = CalcVariable(Dt.name + "<", srcom, '',
                            'Check for section compactness')

    Mp = CalcVariable('M_p', Fy * Zx, 'lb-in', 'Plastic moment capacity')
    Ma = CalcVariable('M_a',
                      Mp / Om,
                      'lb-in',
                      'Allowable bending moment',
                      result_check=True)

    Ms = CalcVariable('M_s',
                      wh * 12 * POW(Le, 2) / ku,
                      'lb-in',
                      'Service level moment demand',
                      result_check=True)

    if float(Ms) <= float(Ma):
        BodyHeader('Demand is less than capacity, design is OK')
    else:
        BodyHeader('Demand is greater than capacity, design fails')

    calculation_sum = {
        'head': HeadCollection.head_instances,
        'assum': AssumCollection.assum_instances,
        'setup': SetupCollection.setup_instances,
        'calc': CalcCollection.calc_instances,
        'foot': FootCollection.foot_instances
    }
    return calculation_sum
Esempio n. 11
0
            if new_value := updated_input.get(input_variable.name):
                input_variable._set_value(new_value)

    ###   DEFINE CALCULATION, BODY HEADER, AND BODY TEXT   ###

    k_to_lb = Variable('1000 \ \mathrm{lbs/kip}', 1000, 'lbs/kip')
    ft_to_in = Variable('12 \ \mathrm{in/ft}', 12, 'in/ft')

    # handle error more gracefully
    if len(bars_table.value) <= 1 or len(bars_table.value[0]) <= 4:
        bars_table.value = default_bars_table

    BodyHeader(
        'Flexural Capacity', head_level=1
    )  ######################################################################################
    ey = CalcVariable('\varepsilon _y', fy / Es, '',
                      'Yield strain of reinforcement steel')
    ec_var = CalcVariable('\varepsilon _c', 0.003, '',
                          'Crushing strain of concrete')
    B1 = CalcVariable(
        '\beta _1',
        0.85,
        '',
        'Equivalent rectangular compressive stress block depth ratio',
        code_ref='Table 22.2.2.4.3'
    )  ## UPDATE $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

    bars_val = bars_table.value  # columns to be: [bar_id, As, db, x, y ]

    c_assume = 0.001
    c_change = 2
    c_last_change = 0