-
Notifications
You must be signed in to change notification settings - Fork 6
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
egarciamendez
merged 13 commits into
main
from
582-formula-request-add-formulas-from-chapter-628-from-eurocode-1993-1-1
Jun 11, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9a4c508
Add formulas 6.29, 6.29rho, and 6.30 with corresponding tests for red…
GerjanDorgelo 9692739
Add formulas 6.29 and 6.30 with corresponding object names for reduce…
GerjanDorgelo a62fdb6
Merge branch 'main' into 582-formula-request-add-formulas-from-chapte…
GerjanDorgelo f816134
Add additional test for formula 6.29rho with torsion to validate eval…
GerjanDorgelo e4303bd
Merge branch '582-formula-request-add-formulas-from-chapter-628-from-…
GerjanDorgelo db85ed0
Update latex representation for formula 6.29rho and its torsion varia…
GerjanDorgelo 03203bf
Update implementation status for formulas 6.29 and 6.30 to reflect co…
GerjanDorgelo fcd6603
Apply suggestions from code review
GerjanDorgelo d15c421
Update docstrings for Form6Dot29Rho to clarify torsion context
GerjanDorgelo 929b53f
Merge remote-tracking branch 'origin/main' into 582-formula-request-a…
GerjanDorgelo c382757
Fix case sensitivity in LaTeX output for short representation in test…
GerjanDorgelo 13f6545
Merge branch 'main' into 582-formula-request-add-formulas-from-chapte…
egarciamendez 606fb26
fix: correct hyphenation in docstring for plastic section modulus in …
egarciamendez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
.../codes/eurocode/nen_en_1993_1_1_c2_a1_2016/chapter_6_ultimate_limit_state/formula_6_29.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |
159 changes: 159 additions & 0 deletions
159
...des/eurocode/nen_en_1993_1_1_c2_a1_2016/chapter_6_ultimate_limit_state/formula_6_29rho.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} " | ||
GerjanDorgelo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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="-", | ||
) |
113 changes: 113 additions & 0 deletions
113
.../codes/eurocode/nen_en_1993_1_1_c2_a1_2016/chapter_6_ultimate_limit_state/formula_6_30.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.