<jupyter_start><jupyter_text>![Hollow Square Graphic](./Hollow_Square.JPG)<jupyter_code>import pint, math
unit = pint.UnitRegistry(system='mks')

# define synonyms for common units
inch = unit.inch; mm = unit.mm; m = unit.m; 
dimensionless = unit.dimensionless; s = unit.second; pi = math.pi

def u_round(Q, digits=3):
    """
    Takes a Pint.py quantity and returns same rounded to digits, 
    default is 3 digits
    """
    try:
        unit.check(Q.units)
        magnitude = Q.magnitude
        units = Q.units
        return round(magnitude,digits) * units
    except:
        print("ERROR: u_round() first arguement must be a Pint.py quantity")
        return NaN
# Specify Outside Face Width, d_1
# AND Wall Thickness, t
d_1 = 4.000 * inch
t = 0.500 * inch
# Results returned in units of inch and mm
# Geometric Properties of Hollow Square [4]
d_2 = d_1 - ( 2.0 * t )     # inside width
A =  (d_1**2 - d_2**2)
c = d_1 / 2.0     # distance from centroid of area
I = (d_1**4 - d_2**4) / 12.0
S = (d_1**4 - d_2**4) / (6.0 * d_1)
r = ( ( d_1**2 + d_2**2 ) / 12.0 )**(1/2)
print('Geometric Properties of Hollow Square with Neutral Axis in Middle:')
print('Given: Outside Face Width, d_1 =', round(d_1,3), '=', round(d_1.to(mm),2))
print('Given: Wall Thickness, t =', round(t,3), '=', round(t.to(mm),2))
print('Inside Width, d_2 =', round(d_2,3), '=', round(d_2.to(mm),2))
print('Area, A =', round(A,3), '=', round(A.to(mm**2),1) )
print('c =', round(c,3), '=', round(c.to(mm),2))
print('Radius of Gyration, r =', round(r,4), '=', round(r.to(mm),2))
print('Second Moment of Inertia, I =', u_round(I,4), '=', u_round(I.to(mm**4),1))
print('Elastic Section Modulus, S =', u_round(S,4), '=', u_round(S.to(mm**3),1))
# print('Plastic Section Modulus, Z =', u_round(Z,4), '=', u_round(Z.to(mm**3),1))<jupyter_output>Geometric Properties of Hollow Square with Neutral Axis in Middle:
Given: Outside Face Width, d_1 = 4.0 inch = 101.6 millimeter
Given: Wall Thickness, t = 0.5 inch = 12.7 millimeter
Inside Width, d_2 = 3.0 inch = 76.2 millimeter
Area, A = 7.0 inch ** 2 = 4516.1 millimeter ** 2
c = 2.0 inch = 50.8 millimeter
Radius of Gyration, r = 1.4434 inch = 36.66 millimeter
Second Moment of Inertia, I = 14.5833 inch ** 4 = 6070041.6 millimeter ** 4
Elastic Section Modulus, S = 7.2917 inch ** 3 = 119489.0 millimeter ** 3
{'fraction_non_alphanumeric': 0.17533304684142673, 'fraction_numerical': 0.06274172754619682, 'mean_word_length': 3.7901234567901234, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '137614', 'license': 'MIT', 'n_tokens_mistral': 1003, 'n_tokens_neox': 909, 'n_words': 257, 'path': 'Properties_of_Geometric_Sections/Hollow_Square/.ipynb_checkpoints/Hollow_Square-checkpoint.ipynb', 'repo_name': 'Ewdy/Structural-Design', 'size': '2327'}