Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
147b53c
feat: add EN 1993-1-1:2025 module and chapter 8 formulas
GerjanDorgelo Jan 13, 2026
89977d7
feat: implement Form 8.3 for utilization ratio calculation in EN 1993…
GerjanDorgelo Jan 13, 2026
84fc770
fix: correct docstring for Formula 8.3 in EN 1993-1-1:2025
GerjanDorgelo Jan 13, 2026
c5797da
feat: add Formula 8.5 for minimum area deduction of staggered fastene…
GerjanDorgelo Jan 13, 2026
ce1723b
feat: add Formula 8.7 for additional moment calculation in EN 1993-1-…
GerjanDorgelo Jan 13, 2026
1810b21
feat: implement Formula 8.13 for unity check of tensile strength in E…
GerjanDorgelo Jan 13, 2026
6c39cb0
feat: implement Formula 8.14 for design plastic resistance calculatio…
GerjanDorgelo Jan 13, 2026
6e6faac
feat: add Formula 8.16 for design tension resistance calculation in E…
GerjanDorgelo Jan 13, 2026
35d2799
feat: add Formula 8.17 for compression force check in EN 1993-1-1:2025
GerjanDorgelo Jan 13, 2026
b30e13a
feat: add Formula 8.19 for bending moment check in EN 1993-1-1:2025
GerjanDorgelo Jan 13, 2026
ebc5d15
feat: add Formula 8.22 for design shear force check in EN 1993-1-1:2025
GerjanDorgelo Jan 13, 2026
b499070
feat: add Formula 8.23 for design plastic shear resistance calculatio…
GerjanDorgelo Jan 13, 2026
70b15eb
feat: add Formula 8.25 for design elastic shear stress calculation in…
GerjanDorgelo Jan 13, 2026
db06073
fix: rename class from Form6Dot20ShearStress to Form8Dot25ShearStress…
GerjanDorgelo Jan 13, 2026
8f939f0
refactor: rename classes for formulas 8.5, 8.7, 8.13, 8.14, 8.16, 8.1…
GerjanDorgelo Jan 13, 2026
99423ef
feat: add Formula 8.26 for design elastic shear stress calculation in…
GerjanDorgelo Jan 13, 2026
116fdb5
feat: add Formula 8.27 for checking shear buckling resistance in EN 1…
GerjanDorgelo Jan 13, 2026
67741d0
feat: add Formula 8.28 for total torsional moment calculation in EN 1…
GerjanDorgelo Jan 13, 2026
f626275
feat: add Formula 8.30 for combined shear force and torsional moment …
GerjanDorgelo Jan 13, 2026
c5813e1
feat: add Formula 8.31 for design plastic shear resistance calculatio…
GerjanDorgelo Jan 13, 2026
19b6c6c
feat: add Formula 8.32 for calculation of shear resistance in channel…
GerjanDorgelo Jan 13, 2026
8614e50
feat: add Formula 8.33 for calculation of design plastic shear resist…
GerjanDorgelo Jan 13, 2026
2ddaa3c
feat: add Formula 8.29 for calculation of reduced yield strength acco…
GerjanDorgelo Jan 13, 2026
d937a9d
feat: update Formula 8.36 for calculation of reduced yield strength a…
GerjanDorgelo Jan 13, 2026
8bdf96e
feat: add Formula 8.37 for calculation of reduction factor with and w…
GerjanDorgelo Jan 13, 2026
b3cae22
feat: add Formula 8.44 for calculation of reduced plastic moment for …
GerjanDorgelo Jan 13, 2026
fc8170f
feat: add Formula 8.45 for checking axial force about the y-y axis ac…
GerjanDorgelo Jan 13, 2026
053c6f5
feat: add Formula 8.46 for checking axial force about the y-y axis ac…
GerjanDorgelo Jan 13, 2026
39c74f1
fix: correct reference to conditions 6.45 and 6.46 in Formula 8.45 do…
GerjanDorgelo Jan 13, 2026
e0eb3af
feat: add Formula 8.47 for checking axial force about the z-z axis ac…
GerjanDorgelo Jan 13, 2026
040981c
feat: add Formula 8.48 for calculation of reduced bending moment when…
GerjanDorgelo Jan 13, 2026
c5bdfac
feat: add Formulas 8.49 and 8.50 for reduced bending moment calculati…
GerjanDorgelo Jan 13, 2026
deca5c0
fix: update references in Form8Dot49And50MomentReduction docstring to…
GerjanDorgelo Jan 13, 2026
c70d78e
feat: add Formula 8.51 for reduced bending moment resistance calculat…
GerjanDorgelo Jan 13, 2026
800e4f2
feat: add Formula 8.51aw for reduction factor calculations in hollow …
GerjanDorgelo Jan 13, 2026
f89aac9
feat: add Formula 8.52aw for reduced bending moment resistance calcul…
GerjanDorgelo Jan 13, 2026
d30e41e
refactor: rename Formula 8.52aw to Formula 8.52 and update related do…
GerjanDorgelo Jan 13, 2026
88f414c
feat: add Formula 8.52af for reduction factor calculations in hollow …
GerjanDorgelo Jan 13, 2026
236eb18
feat: add Formula 8.57 for longitudinal stress checks in Class 3 cros…
GerjanDorgelo Jan 13, 2026
63321a4
feat: add Formula 8.58 for longitudinal stress checks in Class 4 cros…
GerjanDorgelo Jan 13, 2026
e53d45d
feat: add Formula 8.60 for reduced yield strength calculations accord…
GerjanDorgelo Jan 13, 2026
d9e61e0
fix: update parameter names in Formula 8.37 for consistency with EN 1…
GerjanDorgelo Jan 13, 2026
65dbc63
fix: update references in formulas to correct section numbers accordi…
GerjanDorgelo Jan 13, 2026
2bb4174
fix: update references in formulas 8.45 and 8.46 for consistency with…
GerjanDorgelo Jan 13, 2026
7235462
fix: update documentation in Formula 8.48 and add test package for Eu…
GerjanDorgelo Jan 13, 2026
f8ec161
test: add tests for formula 8.3 validation and evaluation according t…
GerjanDorgelo Jan 13, 2026
212274f
test: add tests for formula 8.5 validation and evaluation according t…
GerjanDorgelo Jan 13, 2026
9dc7abf
test: add tests for formula 8.7 validation and evaluation according t…
GerjanDorgelo Jan 13, 2026
83c5887
test: add tests for formula 8.13 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
98643d4
test: add tests for formula 8.14 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
a8e51ad
test: add tests for formula 8.16 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
796b643
test: add tests for formula 8.17 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
3fb8ac1
test: add tests for formula 8.19 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
421ffb2
test: add tests for formula 8.22 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
fba56b0
test: add tests for formula 8.23 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
8bca519
test: add tests for formula 8.25 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
1d55ce3
test: add tests for formula 8.26 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
c99575a
test: add tests for formula 8.27 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
68a0756
test: add tests for formula 8.28 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
8024dcd
test: add tests for formula 8.30 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
dacfb27
test: add tests for formula 8.31 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
4470c4e
test: add tests for formula 8.32 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
85768ed
test: add tests for formula 8.33 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
df2e8c5
test: add tests for formula 8.36 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
ba925df
test: add tests for formula 8.37 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
1ddfa5b
test: add tests for formula 8.44 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
eaabc8b
test: add tests for formula 8.45 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
f763913
test: add tests for formula 8.46 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
14e785e
test: add tests for formula 8.47 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
2dc0331
test: add tests for formula 8.48 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
cac0ed3
test: add tests for formulas 8.49 and 8.50 validation and evaluation …
GerjanDorgelo Jan 13, 2026
c4c030d
test: add tests for formula 8.51 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
d43dac9
test: add tests for formula 8.51aw validation and evaluation accordin…
GerjanDorgelo Jan 13, 2026
d86eb3e
test: add tests for formula 8.52 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
2b8a48c
test: add tests for formula 8.52af validation and evaluation accordin…
GerjanDorgelo Jan 13, 2026
c8b01f7
test: add tests for formula 8.57 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
ce8141e
test: add tests for formula 8.58 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
c2b1c8f
test: add tests for formula 8.60 validation and evaluation according …
GerjanDorgelo Jan 13, 2026
06fc116
refactor: correct class name and remove unused class for formula 8.14…
GerjanDorgelo Jan 13, 2026
15a89df
fix: update parameter names in tests for formula 8.37 to match new im…
GerjanDorgelo Jan 13, 2026
4c3df6d
test: update parameter names in tests for formula 8.5 to match new im…
GerjanDorgelo Jan 13, 2026
64bc411
fix: update variable names in latex output for formula 8.37 to match …
GerjanDorgelo Jan 13, 2026
4671d4f
refactor: simplify import statement for formula 8.37 test
GerjanDorgelo Jan 13, 2026
00f3064
split pr
GerjanDorgelo Jan 13, 2026
3ef7dfb
Merge branch 'main' into 927_code_batch4
egarciamendez Mar 25, 2026
0d83935
refactor: update references from EN 1993-1-1:2025 to EN 1993-1-1:2022…
egarciamendez Mar 25, 2026
fc48be2
Merge branch 'main' into 927_code_batch4
egarciamendez Mar 25, 2026
82c9e9c
Merge branch '927_code_batch4' of https://github.com/Blueprints-org/b…
egarciamendez Mar 25, 2026
9080221
feat: add numeric equation with units to LatexFormula and update tests
egarciamendez Mar 25, 2026
cd2b039
feat: add numeric equation with units to LatexFormula and update tests
egarciamendez Mar 25, 2026
2ffafe2
feat: add numeric equation with units to LatexFormula and update tests
egarciamendez Mar 25, 2026
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,83 @@
"""Formula 8.23 from EN 1993-1-1:2022: Chapter 8 - Ultimate Limit State."""

import numpy as np

from blueprints.codes.eurocode.en_1993_1_1_2022 import EN_1993_1_1_2022
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS, MM2, MPA, N
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form8Dot23DesignPlasticShearResistance(Formula):
r"""Class representing formula 8.23 for the calculation of [$V_{pl,Rd}$]."""

label = "8.23"
source_document = EN_1993_1_1_2022

def __init__(
self,
a_v: MM2,
f_y: MPA,
gamma_m0: DIMENSIONLESS,
) -> None:
r"""[$V_{pl,Rd}$] Calculation of the design plastic shear resistance [$N$].

EN 1993-1-1:2022 art.8.2.6(2) - Formula (8.23)

Parameters
----------
a_v : MM2
[$A_v$] Shear area, to be taken from a subformula from 8.23 [$mm^2$].
f_y : MPA
[$f_y$] Yield strength of the material [$MPa$].
gamma_m0 : DIMENSIONLESS
[$\gamma_{M0}$] Partial safety factor for resistance of cross-sections.
"""
super().__init__()
self.a_v = a_v
self.f_y = f_y
self.gamma_m0 = gamma_m0

@staticmethod
def _evaluate(
a_v: MM2,
f_y: MPA,
gamma_m0: DIMENSIONLESS,
) -> N:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(a_v=a_v, f_y=f_y)
raise_if_less_or_equal_to_zero(gamma_m0=gamma_m0)

return (a_v * (f_y / np.sqrt(3))) / gamma_m0

def latex(self, n: int = 3) -> LatexFormula:
"""Returns LatexFormula object for formula 8.23."""
_equation: str = r"\frac{A_v \cdot (f_y / \sqrt{3})}{\gamma_{M0}}"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"A_v": f"{self.a_v:.{n}f}",
r"f_y": f"{self.f_y:.{n}f}",
r"\gamma_{M0}": f"{self.gamma_m0:.{n}f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"A_v": rf"{self.a_v:.{n}f} \ mm^2",
r"f_y": rf"{self.f_y:.{n}f} \ MPa",
r"\gamma_{M0}": f"{self.gamma_m0:.{n}f}",
},
False,
)
return LatexFormula(
return_symbol=r"V_{pl,Rd}",
result=f"{self:.{n}f}",
equation=_equation,
numeric_equation=_numeric_equation,
numeric_equation_with_units=_numeric_equation_with_units,
comparison_operator_label="=",
unit="N",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"""Formula 8.25 from EN 1993-1-1:2022: Chapter 8 - Ultimate Limit State."""

from blueprints.codes.eurocode.en_1993_1_1_2022 import EN_1993_1_1_2022
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import MM, MM3, MM4, MPA, N
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form8Dot25ShearStress(Formula):
r"""Class representing formula 8.25 for the calculation of [$\tau_{Ed}$]."""

label = "8.25"
source_document = EN_1993_1_1_2022

def __init__(
self,
v_ed: N,
s: MM3,
i: MM4,
t: MM,
) -> None:
r"""[$\tau_{Ed}$] Calculation of the design elastic shear stress [$MPa$].

EN 1993-1-1:2022 art.8.2.6(4) - Formula (8.25)

Parameters
----------
v_ed : N
[$V_{Ed}$] Design value of the shear force [$N$].
s : MM3
[$S$] First moment of area about the centroidal axis of that portion of the cross-section between
the point at which the shear is required and the boundary of the cross-section [$mm^3$].
i : MM4
[$I$] Second moment of area of the whole cross section [$mm^4$].
t : MM
[$t$] Thickness at the examined point [$mm$].
"""
super().__init__()
self.v_ed = v_ed
self.s = s
self.i = i
self.t = t

@staticmethod
def _evaluate(
v_ed: N,
s: MM3,
i: MM4,
t: MM,
) -> MPA:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(v_ed=v_ed, s=s)
raise_if_less_or_equal_to_zero(i=i, t=t)

return (v_ed * s) / (i * t)

def latex(self, n: int = 3) -> LatexFormula:
"""Returns LatexFormula object for formula 8.25."""
_equation: str = r"\frac{V_{Ed} \cdot S}{I \cdot t}"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": f"{self.v_ed:.{n}f}",
r"S": f"{self.s:.{n}f}",
r"I": f"{self.i:.{n}f}",
r" t": f" {self.t:.{n}f}",
},
False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
{
r"V_{Ed}": rf"{self.v_ed:.{n}f} \ N",
r"S": rf"{self.s:.{n}f} \ mm^3",
r"I": rf"{self.i:.{n}f} \ mm^4",
r" t": rf" {self.t:.{n}f} \ mm",
},
False,
)
return LatexFormula(
return_symbol=r"\tau_{Ed}",
result=f"{self:.{n}f}",
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,84 @@
"""Formula 8.26 from EN 1993-1-1:2022: Chapter 8 - Ultimate Limit State."""

from blueprints.codes.eurocode.en_1993_1_1_2022 import EN_1993_1_1_2022
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import MM2, MPA, N
from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative


class Form8Dot26ShearStressIOrHSection(Formula):
r"""Class representing formula 8.26 for the calculation of [$\tau_{Ed}$]."""

label = "8.26"
source_document = EN_1993_1_1_2022

def __init__(
self,
v_ed: N,
a_w: MM2,
a_f: MM2,
) -> None:
r"""[$\tau_{Ed}$] Calculation of the design elastic shear stress [$MPa$].
For I- or H-sections the shear stress in the web may be taken with this equation.

EN 1993-1-1:2022 art.8.2.6(5) - Formula (8.26)

Parameters
----------
v_ed : N
[$V_{Ed}$] Design shear force [$N$].
a_w : MM2
[$A_w$] Area of the web [$mm^2$].
a_f : MM2
[$A_f$] Area of one flange [$mm^2$].
"""
super().__init__()
self.v_ed = v_ed
self.a_w = a_w
self.a_f = a_f

@staticmethod
def _evaluate(
v_ed: N,
a_w: MM2,
a_f: MM2,
) -> MPA:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(v_ed=v_ed, a_f=a_f)
raise_if_less_or_equal_to_zero(a_w=a_w)
if not a_f / a_w >= 0.6:
raise ValueError("A_f / A_w must be greater than or equal to 0.6")

return v_ed / a_w

def latex(self, n: int = 3) -> LatexFormula:
"""Returns LatexFormula object for formula 8.26."""
_equation: str = r"\frac{V_{Ed}}{A_w} \text{ if } A_f / A_w \ge 0.6"
_numeric_equation: str = latex_replace_symbols(
_equation,
replacements={
r"V_{Ed}": f"{self.v_ed:.{n}f}",
r"A_w": f"{self.a_w:.{n}f}",
r"A_f": f"{self.a_f:.{n}f}",
},
unique_symbol_check=False,
)
_numeric_equation_with_units: str = latex_replace_symbols(
_equation,
replacements={
r"V_{Ed}": rf"{self.v_ed:.{n}f} \ N",
r"A_w": rf"{self.a_w:.{n}f} \ mm^2",
r"A_f": rf"{self.a_f:.{n}f} \ mm^2",
},
unique_symbol_check=False,
)
return LatexFormula(
return_symbol=r"\tau_{Ed}",
result=f"{self:.{n}f}",
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,84 @@
"""Testing formula 8.23 from EN 1993-1-1:2022, chapter 8, ultimate limit state."""

import pytest

from blueprints.codes.eurocode.en_1993_1_1_2022.chapter_8_ultimate_limit_state.formula_8_23 import Form8Dot23DesignPlasticShearResistance
from blueprints.validations import LessOrEqualToZeroError, NegativeValueError


class TestForm8Dot23DesignPlasticShearResistance:
"""Validation for formula 8.23 from EN 1993-1-1:2022, chapter 8, ultimate limit state."""

def test_evaluation(self) -> None:
"""Tests the evaluation of the result."""
# Example values
a_v = 2000.0
f_y = 355.0
gamma_m0 = 1.0

# Object to test
formula = Form8Dot23DesignPlasticShearResistance(a_v=a_v, f_y=f_y, gamma_m0=gamma_m0)

# Expected result, manually calculated
manually_calculated_result = 409918.6911246343 # N

assert formula == pytest.approx(expected=manually_calculated_result, rel=1e-4)

@pytest.mark.parametrize(
("a_v", "f_y", "gamma_m0"),
[
(-2000.0, 355.0, 1.0), # a_v is negative
(2000.0, -355.0, 1.0), # f_y is negative
(2000.0, 355.0, -1.0), # gamma_m0 is negative
],
)
def test_raise_error_when_invalid_values_are_given(self, a_v: float, f_y: float, gamma_m0: float) -> None:
"""Test invalid values."""
with pytest.raises((NegativeValueError, LessOrEqualToZeroError)):
Form8Dot23DesignPlasticShearResistance(a_v=a_v, f_y=f_y, gamma_m0=gamma_m0)

@pytest.mark.parametrize(
("a_v", "f_y", "gamma_m0"),
[
(2000.0, 355.0, 0.0), # gamma_m0 is zero
(2000.0, 355.0, -1.0), # gamma_m0 is negative
],
)
def test_raise_error_when_gamma_m0_is_invalid(self, a_v: float, f_y: float, gamma_m0: float) -> None:
"""Test invalid gamma_m0 values."""
with pytest.raises(LessOrEqualToZeroError):
Form8Dot23DesignPlasticShearResistance(a_v=a_v, f_y=f_y, gamma_m0=gamma_m0)

@pytest.mark.parametrize(
("representation", "expected"),
[
(
"complete",
r"V_{pl,Rd} = \frac{A_v \cdot (f_y / \sqrt{3})}{\gamma_{M0}} = "
r"\frac{2000.000 \cdot (355.000 / \sqrt{3})}{1.000} = 409918.691 \ N",
),
("short", r"V_{pl,Rd} = 409918.691 \ N"),
(
"complete_with_units",
r"V_{pl,Rd} = \frac{A_v \cdot (f_y / \sqrt{3})}{\gamma_{M0}} = "
r"\frac{2000.000 \ mm^2 \cdot (355.000 \ MPa / \sqrt{3})}{1.000} = 409918.691 \ N",
),
],
)
def test_latex(self, representation: str, expected: str) -> None:
"""Test the latex representation of the formula."""
# Example values
a_v = 2000.0
f_y = 355.0
gamma_m0 = 1.0

# Object to test
latex = Form8Dot23DesignPlasticShearResistance(a_v=a_v, f_y=f_y, gamma_m0=gamma_m0).latex()

actual = {
"complete": latex.complete,
"short": latex.short,
"complete_with_units": latex.complete_with_units,
}

assert expected == actual[representation], f"{representation} representation failed."
Loading