Skip to content

Instantly share code, notes, and snippets.

@pmav99
Created May 4, 2015 08:45
Show Gist options
  • Save pmav99/b8e00064c1ae1c1456c4 to your computer and use it in GitHub Desktop.
Save pmav99/b8e00064c1ae1c1456c4 to your computer and use it in GitHub Desktop.
Modified von Mises
def von_mises(S11, S22, S12, fc, ft):
"""
Returns the type of failure according to the modified Von Mises
failure criterion.
Input
-----
S11 : float
Normal stresses (σx)
S22 : float
Normal stresses (σy)
S12 : float
Shear stresses (τ)
fc : float
The compressive strength of the wall
ft : float
The tensile strength of the wall
failure = 0 ----> No failure
failure = 1 ----> Compression - Compression failure
failure = 2 ----> Compression - Tension failure
failure = 3 ----> Tension - Tension failure
"""
failure = 0
if S11 <= 0:
if S22 <= 0: # S1
if S11**2 + S22**2 - S11 * S22 + 3 * S12**2 - fc**2 >= 0:
failure = 1
else: # S4
if S22 - S11 * ft / fc - ft >= 0:
failure = 2
else:
if S22 <= 0: # S2
if S22 - S11 * fc / ft + fc <= 0:
failure = 2
else: # S3
if S11 + S22 - ft >= 0:
failure = 3
return failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment