<jupyter_start><jupyter_text>How to calculate bolt loads within a bolt group**<NAME>** A **bolt group** is a collection of fasteners through which loads (forces and moments) are reacted. The forces and moments acting on the bolt group self-distrubute to act on each individual bolt within the bolt group. The reaction force generated in each bolt will be a combination of tensile and shear forces.The steps involved in calculating the individual bolt loads on fasteners within a bolt group are shown below:1. Determine the x, y cooridnates of each bolt within the bolt group2. Determine the centroid of the bolt group3. `Determine the loads (forces and moments) acting at the centroid of the bolt group`4. Distribute the loads on the bolt group centroid to each individual bolt In the previous notebook we explored simple functions to determine the x, y coorindates of a bolt group. We also reviewed how the bolt centroid is calculated and its relationship with the area of each fastener.In this notebook we will look at the process for `calculating loads acting at the centroid of the bolt group`.Before we start, we will import libraries which will make calculation easier:<jupyter_code># import helpful libraries / functions

import numpy as np
from numpy import array, cross<jupyter_output><empty_output><jupyter_text>3. Loads at centroid of bolt group Consider the beam in the image below loaded at point A and point B.The centroid of the bolt group is located at point C. ![RHS Beam](./images/RHS_1.png) The cooridnates of point A, B and C and the external force on point A and B are shown below:| ID    |x (mm) |y (mm) |z (mm) |Fx (N) |Fy (N) |Fz (N)| |:----  |:----: |:----: |:----: |:----: |:----: |:----:|| A     | 0     | 0     | 1500  | -1200 | 2000  | -3000|| B     | 0     | 800   | 1100  | 3200  | 1200  | -1200|| C     | 0     | 0     | 0     | ---   | ---   | ---  |  Forces at the bolt centroid To calculate the forces at the bolt group centroid, we use the following equation:$$ \overrightarrow{Fc} = {\sum}_i\overrightarrow{F_i} $$When considering force components in the x, y and z directions, this results in the following equations for our example problem:$$ F_{cx} = F_{ax} + F_{bx} $$$$ F_{cy} = F_{ay} + F_{by} $$$$ F_{cz} = F_{az} + F_{bz} $$ The calculation method you could use if you were manually summing the forces at the bolt centroid:<jupyter_code># Forces at point A
Fax, Fay, Faz = -1200, 2000, -3000

# Forces at point B
Fbx, Fby, Fbz = 3200, 1200, -1200

# Forces at bolt centroid
Fcx = Fax + Fbx
Fcy = Fay + Fby
Fcz = Faz + Fbz

print('Fcx: ', Fcx, 'N')
print('Fcy: ', Fcy, 'N')
print('Fcz: ', Fcz, 'N')<jupyter_output><empty_output><jupyter_text>A faster and more convenient method to calculate the sum of forces at the bolt centroid is to use vector addition:<jupyter_code>Fa = array([Fax, Fay, Faz])
Fb = array([Fbx, Fby, Fbz])

Fc = Fa + Fb

print('Fcx: ', Fc[0], 'N')
print('Fcy: ', Fc[1], 'N')
print('Fcz: ', Fc[2], 'N')<jupyter_output><empty_output><jupyter_text>Moments at the bolt centroid Let's consider the same example problem again:![RHS Beam](./images/RHS_1.png) The cooridnates of point A, B and C and the external force on point A and B are shown below:| ID    |x (mm) |y (mm) |z (mm) |Fx (N) |Fy (N) |Fz (N)| |:----  |:----: |:----: |:----: |:----: |:----: |:----:|| A     | 0     | 0     | 1500  | -1200 | 2000  | -3000|| B     | 0     | 800   | 1100  | 3200  | 1200  | -1200|| C     | 0     | 0     | 0     | ---   | ---   | ---  | The moment occuring at the bolt group centroid is equal to the sum of all applied moments and the moment generated by the offset forces. The moment occuring at the bolt group centroid is given by: $$ \overrightarrow{M_c} =  {\sum}_i \overrightarrow{M_i\ } + {\sum}_i ( \overrightarrow{R_{c,i}} {\times} \overrightarrow{F_i\ } )$$ The calculation method you could use if you were manually summing the moments at the bolt centroid is shown below. Note, the right hand rule is used to determine the direction of the moments (positive for anti-clockwise direction when right thumb points along the direction of the relevant axis).<jupyter_code># location of points A, B and C
point_a = ax, ay, az = 0, 0, 1500
point_b = bx, by, bz = 0, 800, 1100
point_c = cx, cy, cz = 0, 0, 0

# vector distance from the centroid to point A (CA) and the centroid to point B (CB) 
CA = CAx, CAy, CAz = (ax - cx, ay - cy, az - cz)
CB = CBx, CBy, CBz = (bx - cx, by - cy, bz - cz)

Mcx = (-Fay * CAz) - (Fby * CBz) + (Fbz * CBy)
Mcy = (Fax * CAz) + (Fbx * CBz)
Mcz = (-Fbx * CBy)

print('Mcx: ', Mcx, 'N.mm')
print('Mcy: ', Mcy, 'N.mm')
print('Mcz: ', Mcz, 'N.mm')<jupyter_output><empty_output><jupyter_text>A faster and more convenient method to calculate the sum of moments at the bolt centroid is to use vector opertions:<jupyter_code>Mc = cross(CA, Fa) + cross(CB, Fb)

print('Mcx: ', Mc[0], 'N.mm')
print('Mcy: ', Mc[1], 'N.mm')
print('Mcz: ', Mc[2], 'N.mm')<jupyter_output><empty_output><jupyter_text>If a moment were applied to point B (in additon to the previously defined forces), then the moment would be simply added to the moment at the bolt centroid Mc.For example,| ID    |x (mm) |y (mm) |z (mm) |Mx (Nmm) |My (Nmm) |Mz (Nmm)| |:----  |:----: |:----: |:----: |:----: |:----: |:----:|| B    | 0     | 800     | 1100  | -1,500,000 | 2,000,000  | -3,200,000 |<jupyter_code>Mc_new = Mc + array([-1_500_000, 2_000_000, -3_200_000])

print('The new value of Mc with a moment applied at point B:')
print('Mcx: ', Mc_new[0], 'N.mm')
print('Mcy: ', Mc_new[1], 'N.mm')
print('Mcz: ', Mc_new[2], 'N.mm')<jupyter_output><empty_output><jupyter_text>Exercise 3.1 🤔 Calculate the forces and moments occuring at the bolt centroid for the problem shown below:![RHS Beam 2](./images/RHS_2.png) The cooridnates of point B, C and D and the external force on point B and D are shown below:| ID    |x (mm) |y (mm) |z (mm) |Fx (N) |Fy (N) |Fz (N)| |:----  |:----: |:----: |:----: |:----: |:----: |:----:|| B     | 0     | 800   | 1100  | 3200  | 1200  | -1200|| C     | 0     | 0     | 0     | ---   | ---   | ---  || D     | 0     | -950  | 1475  | 1800  | 3300  | 2200 | Manually calculate the forces and moments at the bolt group centroid using the right hand rule (do not use vector operations)<jupyter_code># Forces at point D
# Fdx, Fdy, Fdz = 

# Forces at point B
# Fbx, Fby, Fbz = 

# Forces at bolt centroid
# Fcx = 
# Fcy = 
# Fcz = 

# print('Fcx: ', Fcx, 'N')
# print('Fcy: ', Fcy, 'N')
# print('Fcz: ', Fcz, 'N')
# location of points D, B and C
# point_d = dx, dy, dz = 
# point_b = bx, by, bz = 
# point_c = cx, cy, cz = 

# vector distance from the centroid to point D (CD) and the centroid to point B (CB) 
# CD = CDx, CDy, CDz = 
# CB = CBx, CBy, CBz = 

# Mcx = 
# Mcy = 
# Mcz = 

# print('Mcx: ', Mcx, 'N.mm')
# print('Mcy: ', Mcy, 'N.mm')
# print('Mcz: ', Mcz, 'N.mm')<jupyter_output><empty_output><jupyter_text>Check your calculations by using vector methods:<jupyter_code># complete using vector methods:

# Fc = 
# Mc = 

# print('Fcx: ', Fcx, 'N')
# print('Fcy: ', Fcy, 'N')
# print('Fcz: ', Fcz, 'N')

# print('Mcx: ', Mc[0], 'N.mm')
# print('Mcy: ', Mc[1], 'N.mm')
# print('Mcz: ', Mc[2], 'N.mm')<jupyter_output><empty_output><jupyter_text>Exercise 3.2 🤔 Calculate the forces and moments occuring at the bolt centroid for the problem shown below:![RHS Beam 2](./images/RHS_3.png) The cooridnates of point B, C and E and the external force on point B and E are shown below:| ID    |x (mm) |y (mm) |z (mm) |Fx (N) |Fy (N) |Fz (N)| |:----  |:----: |:----: |:----: |:----: |:----: |:----:|| B     | 0     | 800   | 1100  | 3200  | 1200  | -1200|| C     | 0     | 0     | 0     | ---   | ---   | ---  || E     | 600   | 0     | 1250  | 3300  | 2860  | -4280| Manually calculate the forces and moments at the centroid using the right hand rule (do not use vector operations)😣 this is the last time you will need to manually calculate forces and moments in this exercise 😉<jupyter_code># Forces at point E
# Fex, Fey, Fez = 

# Forces at point B
# Fbx, Fby, Fbz = 

# Forces at bolt centroid
# Fcx = 
# Fcy = 
# Fcz = 

# print('Fcx: ', Fcx, 'N')
# print('Fcy: ', Fcy, 'N')
# print('Fcz: ', Fcz, 'N')
# location of points E, B and C
# point_e = ex, ey, ez = 
# point_b = bx, by, bz = 
# point_c = cx, cy, cz = 

# vector distance from the centroid to point E (CE) and the centroid to point B (CB) 
# CE = CEx, CEy, CEz = 
# CB = CBx, CBy, CBz = 

# Mcx = 
# Mcy = 
# Mcz = 

# print('Mcx: ', Mcx, 'N.mm')
# print('Mcy: ', Mcy, 'N.mm')
# print('Mcz: ', Mcz, 'N.mm')<jupyter_output><empty_output><jupyter_text>Check your calculations using vector methods:<jupyter_code># complete using vector methods:

# Fc = 
# Mc = 

# print('Fcx: ', Fcx, 'N')
# print('Fcy: ', Fcy, 'N')
# print('Fcz: ', Fcz, 'N')

# print('Mcx: ', Mc[0], 'N.mm')
# print('Mcy: ', Mc[1], 'N.mm')
# print('Mcz: ', Mc[2], 'N.mm')<jupyter_output><empty_output><jupyter_text>Exercise 3.3 🤔 Calculate the forces and moments occuring at the bolt centroid for the problem shown below:![RHS Beam 3a](./images/RHS_4.png) The cooridnates of each point and associated external forces and moments are shown below:| ID    |x (mm) |y (mm) |z (mm) |Fx (N) |Fy (N) |Fz (N)|Mx (Nmm)    |My (Nmm)   |Mz (Nmm)   | |:----  |:----: |:----: |:----: |:----: |:----: |:----:|:----:      |:----:     |:----:     || A     | 0     | 0     | 1500  | -1200 | 2000  | -3000|0           |1,200,000  |0          || B     | 0     | 800   | 1100  | 3200  | 1200  | -1200|-2,500,000  |0          |0          || C     | 0     | 0     | 0     | ---   | ---   | ---  | ---        | ---       | ---       || D     | 0     | -950  | 1475  | 1800  | 3300  | 2200 |3,300,000   |0          |0          || E     | 600   | 0     | 1250  | 3300  | 2860  | -4280|1,200,000   |-3,400,000 |-5,600,000 | I wouldn't make you do this one manually 😊 Use vector operations to determine the forces and moments acting at the bolt group centroid:<jupyter_code># complete using vector methods:

# Fc = 
# Mc = 

# print('Fcx: ', Fcx, 'N')
# print('Fcy: ', Fcy, 'N')
# print('Fcz: ', Fcz, 'N')

# print('Mcx: ', Mc[0], 'N.mm')
# print('Mcy: ', Mc[1], 'N.mm')
# print('Mcz: ', Mc[2], 'N.mm')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1727076802507837, 'fraction_numerical': 0.04163401253918495, 'mean_word_length': 2.9646601941747575, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '312974', 'license': 'MIT', 'n_tokens_mistral': 4169, 'n_tokens_neox': 3783, 'n_words': 1353, 'path': 'training_loads_at_centroid.ipynb', 'repo_name': 'tim-au/loads_at_centroid', 'size': '10215'}