Below is an engineering mechanics problem that can be solved with Python. Follow along to see how to solve the problem with code.

Problem

Given:

Two aluminum strips and a strip of steel are securely bonded together to form a a lamellar composite part. The width of the part is $b=60 \ mm$ and the thickness of the part $h = 40 \ mm$. The modulus of elasticity for the steel in the composite is $200 \ GPa$ and the modulus of elasticity of the aluminum is $75 GPa$. The bending moment $M$ of the part is $1500 N m$

Find:

(a) If the thickness of the aluminum top and bottom plates is varied from $ a = 0 \ mm$ to $a = 20 \ mm$ in $2 \ mm$ increments (the composite part keeps the same thickness), what is the stress in the steel and what is the stress in the aluminum?

(b) What is the largest stress that can occur in steel if aluminum thickness is varied from $a=0 \ mm$ to $a = 40/2 \ mm$ and how thick is the aluminum when this maximum steel stress occurs?

Solution

Start the solution: install Python

We are going to use Python to code the solution to this problem. If you don't already have Python installed on your computer, I recommend installing the Anaconda distribution of Python. See this post to learn how to install Anaconda on your computer.

I am coding this solution in a Jupyter Notebook. Once you install Anaconda, you can open a Jupyter notebook from the Windows Start Menu or the Anaconda Prompt. See this post to learn about 3 ways to open a Jupyter notebook.

Alternatively, instead of using a Jupyter notebook, you could code your solution in a .py file.

Alright. Let's get coding....

Define variables based on the composite dimensions and material properties

Based on parameters given in the problem, we can define the following variables in Python.

$h = 40 \ mm$ part thickness (height)

$b = 60 \ mm$ part width

$h_a = 2 \ mm$ thickness (height) of aluminum that we'll start the problem with

$h_s = h - 2h_a $ thickness of the steel

$E_a = 75 \ GPa$ elastic modulus of the aluminum

$E_s = 200 \ GPa$ elastic modulus of the steel

$M = 1500 \ N \ m$ applied moment


In [1]:
h = 40
b = 60
ha = 2
hs = h - 2*ha
Ea = 75*10**3 #Elastic modulus in MPa
Es = 200*10**3 #Elastic modulus in MPa
M = 1500*10**3 # N mm

Assume the aluminum thickness is 2 mm and find the stress in the steel and aluminum

Next we will compute the stress in the steel and the stress in the aluminum due to the applied moment $M$, assuming that the aluminum top and bottom layers are each $2 \ mm$ thick.


In [2]:
n = Es/Ea
ha = 2
I = (1/12)*b*h**3 + (1/12)*(2*(1/2)*(n*b-b))*(h-2*ha)**3
print(f"The moment of inertia I = {I} mm4")


The moment of inertia I = 708800.0 mm4

Calculate the stress in the aluminum

The maximum stress in the aluminum, $\sigma$ is dependent on the bending moment $M$, the distance from the neutral axis $c$ and the moment of inertia I according to the following equation:

$$ \sigma = \frac{Mc}{I} $$

In case of the aluminum, $c$ the distance from the neutral axis that we are calculating the stress for is $c = h/2$, so the equation above becomes:

$$ \sigma_a = \frac{M(h/2)}{I} $$

We can code this into Python pretty easily.


In [3]:
sa = M*(h/2)/I
print(f"The stress in the aluminum sigma a = {sa} MPa")


The stress in the aluminum sigma a = 42.32505643340858 MPa

Calculate the stress in the steel

Maximum stress in the steel, $\sigma$ is dependent on the bending moment $M$, the distance from the neutral axis $c$ and the moment of inertia I according to the the same equation we used to calculate the stress in the aluminum.

$$ \sigma = n\frac{Mc}{I} $$

In case of the c, $c$ the distance from the neutral axis that we are calculating the stress for is $c = h/2-h_a$, so the equation above becomes:

$$ \sigma_a = n\frac{M(h/2-a}{I} $$

Like before, we can code this into Python.


In [4]:
ss = n*M*(h/2-ha)/I
print(f"The stress in the steel sigma s = {ss} MPa")


The stress in the steel sigma s = 101.58013544018058 MPa

Code the calculation of stress using a for loop

Now we can find the stress in aluminum and the stress in steel for a range of aluminum thickness using a for loop. Each time through the loop we will use the aluminum thickness to calculate the stress in steel and aluminum.


In [5]:
for ha in range(0,22,2):
    print(f"For aluminum thickness h_a = {ha} mm")
    I = (1/12)*b*h**3 + (1/12)*(2*(1/2)*(n*b-b))*(h-2*ha)**3
    sa = M*(h/2)/I
    print(f"The stress in the aluminum sigma a = {sa} MPa")
    ss = n*M*(h/2-ha)/I
    print(f"The stress in the steel sigma s = {ss} MPa")


For aluminum thickness h_a = 0 mm
The stress in the aluminum sigma a = 35.15625 MPa
The stress in the steel sigma s = 93.75000000000001 MPa
For aluminum thickness h_a = 2 mm
The stress in the aluminum sigma a = 42.32505643340858 MPa
The stress in the steel sigma s = 101.58013544018058 MPa
For aluminum thickness h_a = 4 mm
The stress in the aluminum sigma a = 50.584532374100725 MPa
The stress in the steel sigma s = 107.9136690647482 MPa
For aluminum thickness h_a = 6 mm
The stress in the aluminum sigma a = 59.650053022269354 MPa
The stress in the steel sigma s = 111.34676564156946 MPa
For aluminum thickness h_a = 8 mm
The stress in the aluminum sigma a = 68.93382352941177 MPa
The stress in the steel sigma s = 110.29411764705883 MPa
For aluminum thickness h_a = 10 mm
The stress in the aluminum sigma a = 77.58620689655173 MPa
The stress in the steel sigma s = 103.44827586206898 MPa
For aluminum thickness h_a = 12 mm
The stress in the aluminum sigma a = 84.71385542168674 MPa
The stress in the steel sigma s = 90.36144578313254 MPa
For aluminum thickness h_a = 14 mm
The stress in the aluminum sigma a = 89.71291866028709 MPa
The stress in the steel sigma s = 71.77033492822966 MPa
For aluminum thickness h_a = 16 mm
The stress in the aluminum sigma a = 92.51644736842104 MPa
The stress in the steel sigma s = 49.34210526315789 MPa
For aluminum thickness h_a = 18 mm
The stress in the aluminum sigma a = 93.59400998336108 MPa
The stress in the steel sigma s = 24.95840266222962 MPa
For aluminum thickness h_a = 20 mm
The stress in the aluminum sigma a = 93.75 MPa
The stress in the steel sigma s = 0.0 MPa

Determine the maximum steel stress and which aluminum thickness this occurs at

Next we will code a way to find the maximum steel stress and what aluminum thickness this occurs at


In [6]:
import numpy as np
SS = []
for ha in np.arange(0,22,0.1):
    I = (1/12)*b*h**3 + (1/12)*(2*(1/2)*(n*b-b))*(h-2*ha)**3
    ss = n*M*(h/2-ha)/I
    SS.append([ss,ha])
maxs = max(SS)
print(f"The maximum stress in the steel is {maxs[0]} MPa at an aluminum thickness of {maxs[1]} mm")


The maximum stress in the steel is 111.5720783380312 MPa at an aluminum thickness of 6.6000000000000005 mm

Summary

In this post, we calculated the stress of two different materials in a laminar composite. We used a Python for loop to iterate through different thicknesses of one material to see how the stress changes. At the end we found the maximum stress and which thickness this occurs at.


In [ ]: