import math


def eq141d10(l, sx, a, sum_st, iy, fy, e):
    """Compression in extreme fibers of box type flexural members
    
    AREMA 2018 Section 1.4.1 Table 15-1-11 Row 10
    
    Compression in the extreme fibers of box type welded or bolted flexural
    members symmetrical about the principal axis midway between the webs
    
    
    (l/r)e = math.sqrt(1.105*math.pi/sxx*sqrt(sum(s/t))/
             a*math.sqrt(i_yy/(1+mu)))
    
    fa_bc = 0.55*fy - 0.55*math.pow(fy,2)/(6.3*math.pow(math.pi,2)*e)*
            math.pow((l/r)e,2)
            
            
    Args:
        l (float): distance between points of lateral support for the
                   compression flange, unbraced length [inches]
                  
        sx (float): section modulus of the box type member about its
                    major axis [inches^3]
                    
        a (float): total area enclosed within the center lines of the box
                   type member webs and flanges [inches^2]
                   
        sum_st (float): sum of the ratio width-to-thickness of each flange and 
                        ratio of the depth to thickness of each web (neglect
                        any portion of the flange which projects beyond the 
                        box section)
                        
        iy (float): second moment of area of the  box type member about its
                    minor axis, [inches^4]
            
    Returns:
        fa_bc (float): allowable compression stress in extreme fibers of
                       box type flexure members
    
    Notes:
        1. Units in lbs and inches.
        2. Poisson's ratio, mu, is taken as 0.3.
    """
    
    ref_text = "AREMA 2018 Section 1.4.1 Table 15-1-11 Row 10 \n\n"
    
    user_input = (f'l = {l:.2f}, Sx = {sx:.2f}, a = {a:.2f}, ' + 
                 f'sum_st = {sum_st:.2f}, Iy = {iy:.2f}, Fy = {fy:.1f}, ' +
                 f'E = {e:.1f} \n\n')
    
    mu = 0.3

    lre = math.sqrt((1.105*math.pi/sx*math.sqrt(sum_st))/
                    (a*math.sqrt(iy/(1+mu))))
    
    fa_bc = (0.55*fy-0.55*math.pow(fy,2)/
             (6.3*math.pow(math.pi,2)*e)*math.pow(lre,2))
    
    text1 = (f'(l/r)e = math.sqrt((1.105*math.pi/sx*math.sqrt(sum_st))/' +
            f'(a*math.sqrt(iy/(1+mu)))) \n' +
            f'(l/r)e = math.sqrt((1.105*math.pi/{sx:.2f}*math.sqrt({sum_st:.2f}))/' +
            f'({a:.2f}*math.sqrt({iy:.2f}/(1+{mu:.2f})))) \n' +
            f'(l/r)e = {lre:.2f} \n')
            
    text2 = (f'fa_bc = (0.55*fy-0.55*math.pow(fy,2)/' +
            f'(6.3*math.pow(math.pi,2)*e)*math.pow(lre,2)) \n' +
            f'fa_bc = (0.55*{fy:.1f}-0.55*math.pow({fy:.1f},2)/' +
            f'(6.3*math.pow(math.pi,2)*{e:.1f})*math.pow({lre:.2f},2)) \n' +
            f'fa_bc = {fa_bc:.1f}')
            
    text = ref_text + user_input + text1 + text2
            
    return fa_bc, text