Skip to content

484 feature request add formulas 716-721 from nen en 1992 1 1 #485

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d45875a
Add implementation and tests for formula 7.16a/b from NEN-EN 1992-1-1…
GerjanDorgelo Feb 16, 2025
a51b678
Add implementation and tests for formula 7.17 from NEN-EN 1992-1-1+C2…
GerjanDorgelo Feb 16, 2025
b61ba7a
Add implementation and tests for formula 7.18 from NEN-EN 1992-1-1+C2…
GerjanDorgelo Feb 16, 2025
8db14e6
Update documentation for formula 7.18 to clarify tension stiffening c…
GerjanDorgelo Feb 16, 2025
846d32f
Add implementation and tests for formula 7.19 from NEN-EN 1992-1-1+C2…
GerjanDorgelo Feb 16, 2025
7fad8b3
Add implementation and tests for formula 7.20 from NEN-EN 1992-1-1+C2…
GerjanDorgelo Feb 16, 2025
b5dc9b5
Add implementation and tests for formula 7.21 from NEN-EN 1992-1-1+C2…
GerjanDorgelo Feb 16, 2025
241ca67
Merge remote-tracking branch 'origin/main' into 484-feature-request-a…
GerjanDorgelo Feb 20, 2025
cb2a9ac
fix: update formula documentation to use correct LaTeX formatting
GerjanDorgelo Feb 20, 2025
3d492c2
Merge branch 'main' into 484-feature-request-add-formulas-716a-721-fr…
GerjanDorgelo Apr 9, 2025
a8665ce
Merge branch 'main' into 484-feature-request-add-formulas-716a-721-fr…
GerjanDorgelo Apr 9, 2025
e03e8a3
Fix LaTeX formatting in test formulas 7.16 to 7.21 for improved reada…
GerjanDorgelo Apr 9, 2025
b84b3b9
Merge branch 'main' into 484-feature-request-add-formulas-716a-721-fr…
GerjanDorgelo Apr 9, 2025
d62ddba
Merge branch '484-feature-request-add-formulas-716a-721-from-nen_en_1…
GerjanDorgelo Apr 9, 2025
450a442
Refactor formulas and tests for improved clarity and accuracy in NEN-…
GerjanDorgelo Apr 28, 2025
f67ae51
Merge remote-tracking branch 'origin/main' into 484-feature-request-a…
GerjanDorgelo Apr 28, 2025
5d154d0
Refactor variable names in test for clarity and consistency with form…
GerjanDorgelo Apr 28, 2025
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,148 @@
"""Formula 7.16a/b from NEN-EN 1992-1-1+C2:2011: Chapter 7 - Serviceability limit state."""

import numpy as np

from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011
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_less_or_equal_to_zero, raise_if_negative


class Form7Dot16abSpanDepthRatio(Formula):
r"""Class representing formula 7.16a/b for the calculation of the limit span/depth ratio."""

label = "7.16a/b"
source_document = NEN_EN_1992_1_1_C2_2011

def __init__(
self,
capital_k: DIMENSIONLESS,
f_ck: MPA,
rho: DIMENSIONLESS,
rho_0: DIMENSIONLESS,
rho_prime: DIMENSIONLESS,
) -> None:
r"""[$\frac{l}{d}$] Limit span/depth ratio [-].

NEN-EN 1992-1-1+C2:2011 art.7.4.2(2) - Formula (7.16a and 7.16b)

Parameters
----------
capital_k : DIMENSIONLESS
[$K$] Factor to take into account the different structural systems [-].
f_ck : MPA
[$f_{ck}$] Characteristic compressive strength of concrete [$MPa$].
rho : DIMENSIONLESS
[$\rho$] Required tension reinforcement ratio at mid-span to resist the moment
due to the design loads (at support for cantilevers) [-].
rho_0 : DIMENSIONLESS
[$\rho_0$] Reference reinforcement ratio [$\sqrt{f_{ck}} \cdot 10^{-3}$] [-].
rho_prime : DIMENSIONLESS
[$\rho'$] Required compression reinforcement ratio at mid-span to resist the moment
due to design loads (at support for cantilevers) [-].
"""
super().__init__()
self.capital_k = capital_k
self.f_ck = f_ck
self.rho = rho
self.rho_0 = rho_0
self.rho_prime = rho_prime

@staticmethod
def _evaluate(
capital_k: DIMENSIONLESS,
f_ck: MPA,
rho: DIMENSIONLESS,
rho_0: DIMENSIONLESS,
rho_prime: DIMENSIONLESS,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(capital_k=capital_k, f_ck=f_ck, rho=rho, rho_0=rho_0, rho_prime=rho_prime)
raise_if_less_or_equal_to_zero(rho=rho)

if rho <= rho_0:
l_over_d = capital_k * (11 + 1.5 * np.sqrt(f_ck) * rho_0 / rho + 3.2 * np.sqrt(f_ck) * (rho_0 / rho - 1) ** 1.5)
else:
l_over_d = capital_k * (11 + 1.5 * np.sqrt(f_ck) * rho_0 / (rho - rho_prime) + 1 / 12 * np.sqrt(f_ck) * np.sqrt(rho_prime / rho_0))

return l_over_d

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 7.16a/b."""
_equation: str = (
r"\begin{cases} K \cdot \left[11 + 1.5 \cdot \sqrt{f_{ck}} \cdot \frac{\rho_0}{\rho} + "
r"3.2 \cdot \sqrt{f_{ck}} \cdot \left(\frac{\rho_0}{\rho} - 1\right)^{3/2}\right] & \text{if } \rho \leq \rho_0 \\ "
r"K \cdot \left[11 + 1.5 \cdot \sqrt{f_{ck}} \cdot \frac{\rho_0}{\rho - \rho'} + "
r"\frac{1}{12} \cdot \sqrt{f_{ck}} \cdot \sqrt{\frac{\rho'}{\rho_0}}\right] & \text{if } \rho > \rho_0 \end{cases}"
)
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"K": f"{self.capital_k:.3f}",
r"f_{ck}": f"{self.f_ck:.3f}",
r"\rho_0": f"{self.rho_0:.4f}",
r"\rho'": f"{self.rho_prime:.4f}",
r"\rho": f"{self.rho:.4f}",
},
False,
)
return LatexFormula(
return_symbol=r"\frac{l}{d}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
comparison_operator_label="=",
unit="-",
)


class Form7Dot16ReferenceReinforcementRatio(Formula):
r"""Class representing formula 7.16 for the calculation of [$\rho_0$]."""

label = "7.16_rho_0"
source_document = NEN_EN_1992_1_1_C2_2011

def __init__(
self,
f_ck: MPA,
) -> None:
r"""[$\rho_0$] Reference reinforcement ratio [-].

NEN-EN 1992-1-1+C2:2011 art.7.4.2(2) - Formula (7.16)

Parameters
----------
f_ck : MPA
[$f_{ck}$] Characteristic compressive strength of concrete [$MPa$].
"""
super().__init__()
self.f_ck = f_ck

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

return np.sqrt(f_ck) * 10**-3

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 7.16_rho_0."""
_equation: str = r"\sqrt{f_{ck}} \cdot 10^{-3}"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"f_{ck}": f"{self.f_ck:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"\rho_0",
result=f"{self:.6f}",
equation=_equation,
numeric_equation=_numeric_equation,
comparison_operator_label="=",
unit="-",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""Formula 7.17 from NEN-EN 1992-1-1+C2:2011: Chapter 7 - Serviceability limit state (SLS)."""

from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS, MM2, N
from blueprints.validations import raise_if_less_or_equal_to_zero


class Form7Dot1MultiplicationFactorLimitSlenderness(Formula):
r"""Class representing formula 7.17 for the calculation of the stress multiplication factor for the limit span to depth ratio."""

label = "7.17"
source_document = NEN_EN_1992_1_1_C2_2011

def __init__(
self,
f_yk: N,
a_s_req: MM2,
a_s_prov: MM2,
) -> None:
r"""[$\frac{310}{\sigma_s}$] Calculation of the multiplication factor [$-$].

NEN-EN 1992-1-1+C2:2011 art.7.4.2(2) - Formula (7.17)

Parameters
----------
f_yk : MPa
[$f_{yk}$] Characteristic yield strength of the steel [$MPa$].
a_s_req : MM2
[$A_{s,req}$] Area of steel required at this section for ultimate limit state [$mm^2$].
a_s_prov : MM2
[$A_{s,prov}$] Area of steel provided at this section [$mm^2$].
"""
super().__init__()
self.f_yk = f_yk
self.a_s_req = a_s_req
self.a_s_prov = a_s_prov

@staticmethod
def _evaluate(
f_yk: N,
a_s_req: MM2,
a_s_prov: MM2,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_less_or_equal_to_zero(f_yk=f_yk, a_s_req=a_s_req, a_s_prov=a_s_prov)

return 500 / (f_yk * a_s_req / a_s_prov)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 7.17."""
_equation: str = r"\frac{500}{f_{yk} \cdot \frac{A_{s,req}}{A_{s,prov}}}"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"f_{yk}": f"{self.f_yk:.3f}",
r"A_{s,req}": f"{self.a_s_req:.3f}",
r"A_{s,prov}": f"{self.a_s_prov:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"\frac{310}{\sigma_s}",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
comparison_operator_label="=",
unit="-",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""Formula 7.18 from NEN-EN 1992-1-1+C2:2011: Chapter 7 - Serviceability Limit State."""

from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS
from blueprints.validations import raise_if_negative


class Form7Dot18DeformationParameter(Formula):
r"""Class representing formula 7.18 for the calculation of [$\alpha$]."""

label = "7.18"
source_document = NEN_EN_1992_1_1_C2_2011

def __init__(
self,
zeta: DIMENSIONLESS,
alpha_l: DIMENSIONLESS,
alpha_ll: DIMENSIONLESS,
) -> None:
r"""[$\alpha$] Calculation of the deformation parameter [$\alpha$].

NEN-EN 1992-1-1+C2:2011 art.7.4.3(3) - Formula (7.18)

Parameters
----------
zeta : DIMENSIONLESS
[$\zeta$] Distribution coefficient allowing for tension stiffening at a section, calculated with Expression (7.19).
alpha_l : DIMENSIONLESS
[$\alpha_{I}$] Value of the parameter calculated for the uncracked condition
alpha_ll : DIMENSIONLESS
[$\alpha_{II}$] Value of the parameter calculated for the fully cracked condition.
.
"""
super().__init__()
self.zeta = zeta
self.alpha_l = alpha_l
self.alpha_ll = alpha_ll

@staticmethod
def _evaluate(
zeta: DIMENSIONLESS,
alpha_l: DIMENSIONLESS,
alpha_ll: DIMENSIONLESS,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(alpha_ll=alpha_ll, alpha_l=alpha_l, zeta=zeta)

return zeta * alpha_ll + (1 - zeta) * alpha_l

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 7.18."""
_equation: str = r"\zeta \cdot \alpha_{II} + (1 - \zeta) \cdot \alpha_{I}"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"\zeta": f"{self.zeta:.3f}",
r"\alpha_{II}": f"{self.alpha_ll:.3f}",
r"\alpha_{I}": f"{self.alpha_l:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"\alpha",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
comparison_operator_label="=",
unit="-",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"""Formula 7.19 from NEN-EN 1992-1-1+C2:2011: Chapter 7 - Serviceability Limit State."""

from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011
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_less_or_equal_to_zero, raise_if_negative


class Form7Dot19DistributionCoefficient(Formula):
r"""Class representing formula 7.19 for the calculation of [$\zeta$]."""

label = "7.19"
source_document = NEN_EN_1992_1_1_C2_2011

def __init__(
self,
beta: DIMENSIONLESS,
sigma_sr: MPA,
sigma_s: MPA,
) -> None:
r"""[$\zeta$] Calculation of the distribution coefficient, 0 for uncracked sections [$\zeta$].

Note: $\sigma_{sr} / \sigma_{s}$ may be replaced by $M_{cr} / M$ for flexure or $N_{cr} / N$ for pure tension,
where $M_{cr}$ is the cracking moment and $N_{cr}$ is the cracking force.

NEN-EN 1992-1-1+C2:2011 art.7.4.3(3) - Formula (7.19)

Parameters
----------
beta : DIMENSIONLESS
[$\beta$] Coefficient taking account of the influence of the duration of the loading or of
repeated loading on the average strain. For short-term loading, [$\beta$] = 1.0. For sustained loads or
many cycles of repeated loading [$\beta$] = 0.5 [$-$].
sigma_sr : MPA
[$\sigma_{sr}$] Stress in the tension reinforcement calculated on the basis of a
cracked section under the loading conditions causing first cracking [$MPa$].
sigma_s : MPA
[$\sigma_{s}$] Stress in the tension reinforcement calculated on the basis of a cracked section under
loading conditions causing first cracking [$MPa$].
"""
super().__init__()
self.beta = beta
self.sigma_sr = sigma_sr
self.sigma_s = sigma_s

@staticmethod
def _evaluate(
beta: DIMENSIONLESS,
sigma_sr: MPA,
sigma_s: MPA,
) -> DIMENSIONLESS:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(beta=beta, sigma_sr=sigma_sr, sigma_s=sigma_s)
raise_if_less_or_equal_to_zero(sigma_s=sigma_s)

return 1 - beta * (sigma_sr / sigma_s) ** 2

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 7.19."""
_equation: str = r"1 - \beta \left(\frac{\sigma_{sr}}{\sigma_{s}}\right)^2"
_numeric_equation: str = latex_replace_symbols(
_equation,
{
r"\beta": f"{self.beta:.3f}",
r"\sigma_{sr}": f"{self.sigma_sr:.3f}",
r"\sigma_{s}": f"{self.sigma_s:.3f}",
},
False,
)
return LatexFormula(
return_symbol=r"\zeta",
result=f"{self:.3f}",
equation=_equation,
numeric_equation=_numeric_equation,
comparison_operator_label="=",
unit="-",
)
Loading