Skip to content

Add formulas 6.39-6.40 from Eurocode 1993-1-1 #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Formula 6.39 from NEN-EN 1993-1-1+C2+A1:2016: Chapter 6 - Ultimate Limit State."""

from blueprints.codes.eurocode.nen_en_1993_1_1_c2_a1_2016 import NEN_EN_1993_1_1_C2_A1_2016
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS, NMM
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form6Dot39ReducedBendingMomentResistance(Formula):
r"""Class representing formula 6.39 for the calculation of [$M_{N,y,Rd}$]."""

label = "6.39"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
mpl_y_rd: NMM,
n: DIMENSIONLESS,
a_w: DIMENSIONLESS,
) -> None:
r"""[$M_{N,y,Rd}$] Calculation of the reduced bending moment [$Nmm$].

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.9.1(5) - Formula (6.39)

Parameters
----------
mpl_y_rd : NMM
[$M_{pl,y,Rd}$] Plastic bending moment resistance about the y-axis [$Nmm$].
n : DIMENSIONLESS
[$n$] Axial force ratio, see equation 6.38n (dimensionless).
a_w : DIMENSIONLESS
[$a_w$] Reduction factor for the web (dimensionless), see equation 6.39aw.
"""
super().__init__()
self.mpl_y_rd = mpl_y_rd
self.n = n
self.a_w = a_w

@staticmethod
def _evaluate(
mpl_y_rd: NMM,
n: DIMENSIONLESS,
a_w: DIMENSIONLESS,
) -> NMM:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(mpl_y_rd=mpl_y_rd, n=n, a_w=a_w)
raise_if_less_or_equal_to_zero(denominator=(1 - 0.5 * a_w))

return min(mpl_y_rd * (1 - n) / (1 - 0.5 * a_w), mpl_y_rd)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.39."""
_equation: str = r"\min \left( M_{pl,y,Rd} \cdot \frac{1 - n}{1 - 0.5 \cdot a_w}, M_{pl,y,Rd} \right)"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"M_{pl,y,Rd}": f"{self.mpl_y_rd:.3f}",
r" n": f" {self.n:.3f}",
r"a_w": f"{self.a_w:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"M_{pl,y,Rd}": rf"{self.mpl_y_rd:.3f} \ Nmm",
r" n": rf" {self.n:.3f}",
r"a_w": rf"{self.a_w:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"M_{N,y,Rd}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label=r"=",
unit="Nmm",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
"""Formula 6.39aw from NEN-EN 1993-1-1+C2+A1:2016: Chapter 6 - Ultimate Limit State."""

from blueprints.codes.eurocode.nen_en_1993_1_1_c2_a1_2016 import NEN_EN_1993_1_1_C2_A1_2016
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS, MM, MM2
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form6Dot39awHollowSections(Formula):
r"""Class representing formula 6.39aw for [$a_w$] in hollow sections."""

label = "6.39aw_hollow"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
a: MM2,
b: MM,
t: MM,
) -> None:
r"""[$a_w$] Calculation of the reduction factor for hollow sections (dimensionless).

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.9.1(5) - Formula (6.39aw)

Parameters
----------
a : MM2
[$A$] Total cross-sectional area [$mm^2$].
b : MM
[$b$] Width of the section [$mm$].
t : MM
[$t$] Thickness of the section [$mm$].
"""
super().__init__()
self.a = a
self.b = b
self.t = t

@staticmethod
def _evaluate(
a: MM2,
b: MM,
t: MM,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(a=a, b=b, t=t)
raise_if_less_or_equal_to_zero(denominator=a)

return min((a - 2 * b * t) / a, 0.5)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.39aw."""
_equation: str = r"\min \left( \frac{A - 2 \cdot b \cdot t}{A}, 0.5 \right)"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"A": f"{self.a:.3f}",
r"b": f"{self.b:.3f}",
r" t": f" {self.t:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"A": rf"{self.a:.3f} \ mm^2",
r"b": rf"{self.b:.3f} \ mm",
r" t": rf" {self.t:.3f} \ mm",
},
False,
)
return LatexFormula(
return_symbol=r"a_w",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label=r"=",
unit="-",
)


class Form6Dot39awWeldedBoxSections(Formula):
r"""Class representing formula 6.39aw for [$a_w$] in welded box sections."""

label = "6.39aw_welded_box"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
a: MM2,
b: MM,
t_f: MM,
) -> None:
r"""[$a_w$] Calculation of the reduction factor for welded box sections (dimensionless).

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.9.1(5) - Formula (6.39aw)

Parameters
----------
a : MM2
[$A$] Total cross-sectional area [$mm^2$].
b : MM
[$b$] Width of the section [$mm$].
t_f : MM
[$t_f$] Flange thickness [$mm$].
"""
super().__init__()
self.a = a
self.b = b
self.t_f = t_f

@staticmethod
def _evaluate(
a: MM2,
b: MM,
t_f: MM,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(a=a, b=b, t_f=t_f)
raise_if_less_or_equal_to_zero(denominator=a)

return min((a - 2 * b * t_f) / a, 0.5)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.39aw."""
_equation: str = r"\min \left( \frac{A - 2 \cdot b \cdot t_f}{A}, 0.5 \right)"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"A": f"{self.a:.3f}",
r"b": f"{self.b:.3f}",
r"t_f": f"{self.t_f:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"A": rf"{self.a:.3f} \ mm^2",
r"b": rf"{self.b:.3f} \ mm",
r"t_f": rf"{self.t_f:.3f} \ mm",
},
False,
)
return LatexFormula(
return_symbol=r"a_w",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label=r"=",
unit="-",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Formula 6.40 from NEN-EN 1993-1-1+C2+A1:2016: Chapter 6 - Ultimate Limit State."""

from blueprints.codes.eurocode.nen_en_1993_1_1_c2_a1_2016 import NEN_EN_1993_1_1_C2_A1_2016
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS, NMM
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form6Dot40ReducedBendingMomentResistance(Formula):
r"""Class representing formula 6.40 for the calculation of [$M_{N,z,Rd}$]."""

label = "6.40"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
mpl_z_rd: NMM,
n: DIMENSIONLESS,
a_f: DIMENSIONLESS,
) -> None:
r"""[$M_{N,z,Rd}$] Calculation of the reduced bending moment [$Nmm$].

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.9.1(5) - Formula (6.40)

Parameters
----------
mpl_z_rd : NMM
[$M_{pl,z,Rd}$] Plastic bending moment resistance about the z-axis [$Nmm$].
n : DIMENSIONLESS
[$n$] Axial force ratio, see equation 6.38n (dimensionless).
a_f : DIMENSIONLESS
[$a_f$] Reduction factor for the flange (dimensionless).
"""
super().__init__()
self.mpl_z_rd = mpl_z_rd
self.n = n
self.a_f = a_f

@staticmethod
def _evaluate(
mpl_z_rd: NMM,
n: DIMENSIONLESS,
a_f: DIMENSIONLESS,
) -> NMM:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(mpl_z_rd=mpl_z_rd, n=n, a_f=a_f)
raise_if_less_or_equal_to_zero(denominator=(1 - 0.5 * a_f))

return min(mpl_z_rd * (1 - n) / (1 - 0.5 * a_f), mpl_z_rd)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.40."""
_equation: str = r"\min \left( M_{pl,z,Rd} \cdot \frac{1 - n}{1 - 0.5 \cdot a_f}, M_{pl,z,Rd} \right)"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"M_{pl,z,Rd}": f"{self.mpl_z_rd:.3f}",
r" n": f" {self.n:.3f}",
r"a_f": f"{self.a_f:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"M_{pl,z,Rd}": rf"{self.mpl_z_rd:.3f} \ Nmm",
r" n": rf" {self.n:.3f}",
r"a_f": rf"{self.a_f:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"M_{N,z,Rd}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label=r"=",
unit="Nmm",
)
Loading