Skip to content

Add formulas 6.29, 6.29rho, and 6.30 from 1993-1-1 #583

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,74 @@
"""Formula 6.29 from NEN-EN 1993-1-1+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, MPA
from blueprints.validations import raise_if_negative


class Form6Dot29ReducedYieldStrength(Formula):
r"""Class representing formula 6.29 for the calculation of reduced yield strength."""

label = "6.29"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
rho: DIMENSIONLESS,
f_y: MPA,
) -> None:
r"""[$f_{y,red}$] Calculation of reduced yield strength [$MPa$].

NEN-EN 1993-1-1+A1:2016 art.6.2.8(3) - Formula (6.29)

Parameters
----------
rho : DIMENSIONLESS
[$\rho$] Reduction factor for shear force, see equation 6.29rho (dimensionless).
f_y : MPA
[$f_y$] Yield strength of the material [$MPa$].
"""
super().__init__()
self.rho = rho
self.f_y = f_y

@staticmethod
def _evaluate(
rho: DIMENSIONLESS,
f_y: MPA,
) -> MPA:
"""Evaluates the formula, for more information see the __init__ method."""
one_minus_rho = 1 - rho
raise_if_negative(rho=rho, f_y=f_y, one_minus_rho=one_minus_rho)

return (1 - rho) * f_y

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.29."""
_equation: str = r"(1 - \rho) \cdot f_y"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"\rho": f"{self.rho:.3f}",
r"f_y": f"{self.f_y:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"\rho": rf"{self.rho:.3f}",
r"f_y": rf"{self.f_y:.3f} \ MPa",
},
True,
)
return LatexFormula(
return_symbol=r"f_{y,red}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label="=",
unit="MPa",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
"""Formula 6.29rho 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, N
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form6Dot29Rho(Formula):
r"""Class representing formula 6.29rho for the calculation of [$\rho$], where no torsion is present."""

label = "6.29rho"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
v_ed: N,
v_pl_rd: N,
) -> None:
r"""[$\rho$] Calculation of the reduction factor, where no torsion is present [$\text{dimensionless}$].

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.10(3) - Formula (6.29rho)

Parameters
----------
v_ed : N
[$V_{Ed}$] Design shear force [$N$].
v_pl_rd : N
[$V_{pl,Rd}$] Plastic shear resistance, obtained from 6.2.6(2) [$N$].

Note, see also 6.2.10(3)
"""
super().__init__()
self.v_ed = v_ed
self.v_pl_rd = v_pl_rd

@staticmethod
def _evaluate(
v_ed: N,
v_pl_rd: N,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_less_or_equal_to_zero(v_pl_rd=v_pl_rd)
raise_if_negative(v_ed=v_ed)

if v_ed <= 0.5 * v_pl_rd:
return 0
return ((2 * v_ed / v_pl_rd) - 1) ** 2

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.29rho."""
_equation: str = (
r"\begin{cases} "
r"0 & \text{if } V_{Ed} \leq 0.5 \cdot V_{pl,Rd} \\ "
r"\left( \frac{2 \cdot V_{Ed}}{V_{pl,Rd}} - 1 \right)^2 & \text{if } V_{Ed} > 0.5 \cdot V_{pl,Rd} "
r"\end{cases}"
)
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": f"{self.v_ed:.3f}",
r"V_{pl,Rd}": f"{self.v_pl_rd:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": rf"{self.v_ed:.3f} \ N",
r"V_{pl,Rd}": rf"{self.v_pl_rd:.3f} \ N",
},
False,
)
return LatexFormula(
return_symbol=r"\rho",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label="=",
unit="-",
)


class Form6Dot29RhoWithTorsion(Formula):
r"""Class representing formula 6.29rho with torsion for the calculation of [$\rho$]."""

label = "6.29rho_with_torsion"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
v_ed: N,
v_pl_t_rd: N,
) -> None:
r"""[$\rho$] Calculation of the reduction factor with torsion [$\text{dimensionless}$].

NEN-EN 1993-1-1+C2+A1:2016 art.6.2.7(4) - Formula (6.29rho with torsion)

Parameters
----------
v_ed : N
[$V_{Ed}$] Design shear force [$N$].
v_pl_t_rd : N
[$V_{pl,T,Rd}$] Plastic shear resistance with torsion [$N$].

Note, see also 6.2.7
"""
super().__init__()
self.v_ed = v_ed
self.v_pl_t_rd = v_pl_t_rd

@staticmethod
def _evaluate(
v_ed: N,
v_pl_t_rd: N,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_less_or_equal_to_zero(v_pl_t_rd=v_pl_t_rd)
raise_if_negative(v_ed=v_ed)

if v_ed <= 0.5 * v_pl_t_rd:
return 0
return ((2 * v_ed / v_pl_t_rd) - 1) ** 2

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.29rho with torsion."""
_equation: str = (
r"\begin{cases} "
r"0 & \text{if } V_{Ed} \leq 0.5 \cdot V_{pl,T,Rd} \\ "
r"\left( \frac{2 \cdot V_{Ed}}{V_{pl,T,Rd}} - 1 \right)^2 & \text{if } V_{Ed} > 0.5 \cdot V_{pl,T,Rd} "
r"\end{cases}"
)
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": f"{self.v_ed:.3f}",
r"V_{pl,T,Rd}": f"{self.v_pl_t_rd:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": rf"{self.v_ed:.3f} \ N",
r"V_{pl,T,Rd}": rf"{self.v_pl_t_rd:.3f} \ N",
},
False,
)
return LatexFormula(
return_symbol=r"\rho",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label="=",
unit="-",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
"""Formula 6.30 from NEN-EN 1993-1-1+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, MM3, MPA, NMM
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


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

label = "6.30"
source_document = NEN_EN_1993_1_1_C2_A1_2016

def __init__(
self,
w_pl_y: MM3,
rho: DIMENSIONLESS,
h_w: MM,
t_w: MM,
f_y: MPA,
gamma_m0: DIMENSIONLESS,
m_y_c_rd: NMM,
) -> None:
r"""[$M_{y,V,Rd}$] Reduced design plastic resistance moment [$Nmm$].

NEN-EN 1993-1-1+A1:2016 art.6.2.8(5) - Formula (6.30)

Parameters
----------
w_pl_y : MM3
[$W_{pl,y}$] Plastic section modulus about the y-axis [$mm^3$].
rho : DIMENSIONLESS
[$\rho$] Shear force ratio (see 6.2.8 (3) or equation 6.29 (rho)) [-].
h_w : MM
[$h_w$] Web height [$mm$].
t_w : MM
[$t_w$] Web thickness [$mm$].
f_y : MPA
[$f_y$] Yield strength of the material [$MPa$].
gamma_m0 : DIMENSIONLESS
[$\gamma_{M0}$] Partial safety factor for resistance of cross-sections [-].
m_y_c_rd : NMM
[$M_{y,c,Rd}$] Design resistance moment, obtained from 6.2.5(2) [$Nmm$].
"""
super().__init__()
self.w_pl_y = w_pl_y
self.rho = rho
self.h_w = h_w
self.t_w = t_w
self.f_y = f_y
self.gamma_m0 = gamma_m0
self.m_y_c_rd = m_y_c_rd

@staticmethod
def _evaluate(
w_pl_y: MM3,
rho: DIMENSIONLESS,
h_w: MM,
t_w: MM,
f_y: MPA,
gamma_m0: DIMENSIONLESS,
m_y_c_rd: NMM,
) -> NMM:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(w_pl_y=w_pl_y, rho=rho, h_w=h_w, f_y=f_y, m_y_c_rd=m_y_c_rd)
raise_if_less_or_equal_to_zero(gamma_m0=gamma_m0, t_w=t_w)

a_w = h_w * t_w
m_y_v_rd = (w_pl_y - (rho * a_w**2) / (4 * t_w)) * f_y / gamma_m0
return min(m_y_v_rd, m_y_c_rd)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 6.30."""
_equation: str = (
r"\min\left(\frac{\left[W_{pl,y} - \frac{\rho \cdot (h_w \cdot t_w)^2}{4 \cdot t_w}\right] \cdot f_y}{\gamma_{M0}}, M_{y,c,Rd}\right)"
)
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"W_{pl,y}": f"{self.w_pl_y:.3f}",
r"\rho": f"{self.rho:.3f}",
r"h_w": f"{self.h_w:.3f}",
r"t_w": f"{self.t_w:.3f}",
r"f_y": f"{self.f_y:.3f}",
r"\gamma_{M0}": f"{self.gamma_m0:.3f}",
r"M_{y,c,Rd}": f"{self.m_y_c_rd:.3f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"W_{pl,y}": rf"{self.w_pl_y:.3f} \ mm^3",
r"\rho": rf"{self.rho:.3f}",
r"h_w": rf"{self.h_w:.3f} \ mm",
r"t_w": rf"{self.t_w:.3f} \ mm",
r"f_y": rf"{self.f_y:.3f} \ MPa",
r"\gamma_{M0}": rf"{self.gamma_m0:.3f}",
r"M_{y,c,Rd}": rf"{self.m_y_c_rd:.3f} \ Nmm",
},
False,
)
return LatexFormula(
return_symbol=r"M_{y,V,Rd}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label="=",
unit="Nmm",
)
5 changes: 3 additions & 2 deletions docs/objects_overview/eurocode/ec3_1993_1_1_2016/formulas.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Total of 108 formulas present.
| 6.26 | :heavy_check_mark: | | Form6Dot26VplTRdIOrHSection |
| 6.27 | :heavy_check_mark: | | Form6Dot27VplTRdChannelSection |
| 6.28 | :heavy_check_mark: | | Form6Dot28VplTRdHollowSection |
| 6.29 | :x: | | |
| 6.30 | :x: | | |
| 6.29 | :heavy_check_mark: | | Form6Dot29ReducedYieldStrength |
| 6.29 (rho) | :heavy_check_mark: | | Form6Dot29Rho and Form6Dot29RhoWithTorsion |
| 6.30 | :heavy_check_mark: | | Form6Dot30ReducedPlasticResistanceMoment |
| 6.31 | :heavy_check_mark: | | Form6Dot31CheckBendingAndAxialForce |
| 6.32 | :heavy_check_mark: | | Form6Dot32MNrdRectangular |
| 6.33 | :heavy_check_mark: | | Form6Dot33CheckAxialForceY |
Expand Down
Loading