Skip to content

Commit 5de4951

Browse files
Merge pull request #504 from Blueprints-org/503-feature-request-add-formulas-617-622-from-nen_en_1993_1_1
503 feature request add formulas 6.17-6.22 from nen-en-1993-1-1
2 parents de61c37 + 4f51ebd commit 5de4951

File tree

15 files changed

+2028
-6
lines changed

15 files changed

+2028
-6
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""Formula 6.17 from NEN-EN 1993-1-1+C2+A1:2016: Chapter 6 - Ultimate Limit State."""
2+
3+
from blueprints.codes.eurocode.nen_en_1993_1_1_c2_a1_2016 import NEN_EN_1993_1_1_C2_A1_2016
4+
from blueprints.codes.formula import Formula
5+
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
6+
from blueprints.type_alias import N
7+
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative
8+
9+
10+
class Form6Dot17CheckShearForce(Formula):
11+
r"""Class representing formula 6.17 for checking the design value of the shear force."""
12+
13+
label = "6.17"
14+
source_document = NEN_EN_1993_1_1_C2_A1_2016
15+
16+
def __init__(
17+
self,
18+
v_ed: N,
19+
v_c_rd: N,
20+
) -> None:
21+
r"""Check the design value of the shear force at each cross section.
22+
23+
NEN-EN 1993-1-1+C2+A1:2016 art.6.2.6(1) - Formula (6.17)
24+
25+
Parameters
26+
----------
27+
v_ed : N
28+
[$V_{Ed}$] Design value of the shear force [$N$].
29+
v_c_rd : N
30+
[$V_{c,Rd}$] Design shear resistance [$N$].
31+
"""
32+
super().__init__()
33+
self.v_ed = v_ed
34+
self.v_c_rd = v_c_rd
35+
36+
@staticmethod
37+
def _evaluate(
38+
v_ed: N,
39+
v_c_rd: N,
40+
) -> bool:
41+
"""Evaluates the formula, for more information see the __init__ method."""
42+
raise_if_less_or_equal_to_zero(v_c_rd=v_c_rd)
43+
raise_if_negative(v_ed=v_ed)
44+
45+
return v_ed / v_c_rd <= 1.0
46+
47+
def latex(self) -> LatexFormula:
48+
"""Returns LatexFormula object for formula 6.17."""
49+
_equation: str = r"\left( \frac{V_{Ed}}{V_{c,Rd}} \leq 1.0 \right)"
50+
_numeric_equation: str = latex_replace_symbols(
51+
_equation,
52+
{
53+
"V_{Ed}": f"{self.v_ed:.3f}",
54+
"V_{c,Rd}": f"{self.v_c_rd:.3f}",
55+
},
56+
False,
57+
)
58+
return LatexFormula(
59+
return_symbol=r"CHECK",
60+
result="OK" if self.__bool__() else "\\text{Not OK}",
61+
equation=_equation,
62+
numeric_equation=_numeric_equation,
63+
comparison_operator_label="\\to",
64+
unit="",
65+
)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"""Formula 6.18 from NEN-EN 1993-1-1+C2+A1:2016: Chapter 6 - Ultimate Limit State."""
2+
3+
import numpy as np
4+
5+
from blueprints.codes.eurocode.nen_en_1993_1_1_c2_a1_2016 import NEN_EN_1993_1_1_C2_A1_2016
6+
from blueprints.codes.formula import Formula
7+
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
8+
from blueprints.type_alias import DIMENSIONLESS, MM2, MPA, N
9+
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative
10+
11+
12+
class Form6Dot18DesignPlasticShearResistance(Formula):
13+
r"""Class representing formula 6.18 for the calculation of [$V_{pl,Rd}$]."""
14+
15+
label = "6.18"
16+
source_document = NEN_EN_1993_1_1_C2_A1_2016
17+
18+
def __init__(
19+
self,
20+
a_v: MM2,
21+
f_y: MPA,
22+
gamma_m0: DIMENSIONLESS,
23+
) -> None:
24+
r"""[$V_{pl,Rd}$] Calculation of the design plastic shear resistance [$N$].
25+
26+
NEN-EN 1993-1-1+C2+A1:2016 art.6.2.6(2) - Formula (6.18)
27+
28+
Parameters
29+
----------
30+
a_v : MM2
31+
[$A_v$] Shear area, to be taken from a subformula from 6.18 [$mm^2$].
32+
f_y : MPA
33+
[$f_y$] Yield strength of the material [$MPa$].
34+
gamma_m0 : DIMENSIONLESS
35+
[$\gamma_{M0}$] Partial safety factor for resistance of cross-sections.
36+
"""
37+
super().__init__()
38+
self.a_v = a_v
39+
self.f_y = f_y
40+
self.gamma_m0 = gamma_m0
41+
42+
@staticmethod
43+
def _evaluate(
44+
a_v: MM2,
45+
f_y: MPA,
46+
gamma_m0: DIMENSIONLESS,
47+
) -> N:
48+
"""Evaluates the formula, for more information see the __init__ method."""
49+
raise_if_negative(a_v=a_v, f_y=f_y)
50+
raise_if_less_or_equal_to_zero(gamma_m0=gamma_m0)
51+
52+
return (a_v * (f_y / np.sqrt(3))) / gamma_m0
53+
54+
def latex(self) -> LatexFormula:
55+
"""Returns LatexFormula object for formula 6.18."""
56+
_equation: str = r"\frac{A_v \cdot (f_y / \sqrt{3})}{\gamma_{M0}}"
57+
_numeric_equation: str = latex_replace_symbols(
58+
_equation,
59+
{
60+
r"A_v": f"{self.a_v:.3f}",
61+
r"f_y": f"{self.f_y:.3f}",
62+
r"\gamma_{M0}": f"{self.gamma_m0:.3f}",
63+
},
64+
False,
65+
)
66+
return LatexFormula(
67+
return_symbol=r"V_{pl,Rd}",
68+
result=f"{self:.3f}",
69+
equation=_equation,
70+
numeric_equation=_numeric_equation,
71+
comparison_operator_label="=",
72+
unit="N",
73+
)

0 commit comments

Comments
 (0)