-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 349-feature-request-add-latex-to-existing-fo…
…rmulas-from-1992-1-1-chapter-5
- Loading branch information
Showing
11 changed files
with
570 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
86 changes: 86 additions & 0 deletions
86
...nts/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_5_structural_analysis/formula_5_10a.py
This file contains 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,86 @@ | ||
"""Formula 5.10a from NEN-EN 1992-1-1+C2:2011: Chapter 5 - Structural Analysis.""" | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011 | ||
from blueprints.codes.latex_formula import LatexFormula | ||
from blueprints.type_alias import DIMENSIONLESS, M | ||
from blueprints.validations import raise_if_less_or_equal_to_zero | ||
|
||
|
||
class Form5Dot10aRedistributionOfMomentsLowerFck: | ||
r"""Class representing formula 5.10a for the redistribution of moments in continuous beams or slabs when :math:`f_{ck} \leq 50 MPa`.""" | ||
|
||
label = "5.10a" | ||
source_document = NEN_EN_1992_1_1_C2_2011 | ||
|
||
def __init__(self, delta: DIMENSIONLESS, k1: DIMENSIONLESS, k2: DIMENSIONLESS, xu: M, d: M) -> None: | ||
r"""[:math:`δ`] Redistribution of moments in continuous beams or slabs when :math:`f_{ck} \leq 50 MPa`. | ||
NEN-EN 1992-1-1+C2:2011 art.5.5(4) - Formula (5.10a) | ||
Parameters | ||
---------- | ||
delta : DIMENSIONLESS | ||
[:math:`δ`] is the ratio of the redistributed moment to the elastic moment. | ||
k1 : DIMENSIONLESS | ||
[:math:`k1`] is a coefficient for redistribution. | ||
k2 : DIMENSIONLESS | ||
[:math:`k2`] is a coefficient for redistribution. | ||
xu : M | ||
[:math:`x_u`] is the depth of the compression zone in the ultimate limit state after redistribution. | ||
d : M | ||
[:math:`d`] is the effective depth of the section. | ||
""" | ||
super().__init__() | ||
self.delta = delta | ||
self.k1 = k1 | ||
self.k2 = k2 | ||
self.xu = xu | ||
self.d = d | ||
raise_if_less_or_equal_to_zero(delta=delta, k1=k1, k2=k2, xu=xu, d=d) | ||
|
||
@property | ||
def left_hand_side(self) -> DIMENSIONLESS: | ||
"""Calculate the left hand side of the comparison. | ||
Returns | ||
------- | ||
DIMENSIONLESS | ||
Left hand side of the comparison. | ||
""" | ||
return self.delta | ||
|
||
@property | ||
def right_hand_side(self) -> DIMENSIONLESS: | ||
"""Calculate the right hand side of the comparison. | ||
Returns | ||
------- | ||
DIMENSIONLESS | ||
Right hand side of the comparison. | ||
""" | ||
raise_if_less_or_equal_to_zero(d=self.d) | ||
raise_if_less_or_equal_to_zero(xu=self.xu) | ||
return self.k1 + self.k2 * (self.xu / self.d) | ||
|
||
@property | ||
def ratio(self) -> DIMENSIONLESS: | ||
"""Ratio between left hand side and right hand side of the comparison, commonly referred to as unity check.""" | ||
return self.left_hand_side / self.right_hand_side | ||
|
||
def __bool__(self) -> bool: | ||
"""Evaluates the comparison, for more information see the __init__ method.""" | ||
return self.left_hand_side >= self.right_hand_side | ||
|
||
def __str__(self) -> str: | ||
"""Return the result of the comparison.""" | ||
return self.latex().complete | ||
|
||
def latex(self) -> LatexFormula: | ||
"""Returns LatexFormula object for formula 5.10a.""" | ||
return LatexFormula( | ||
return_symbol=r"CHECK", | ||
result="OK" if self.__bool__() else "\\text{Not OK}", | ||
equation=r"\delta \geq k_1 + k_2 \frac{x_u}{d}", | ||
numeric_equation=rf"{self.left_hand_side:.3f} \geq {self.k1} + {self.k2} \frac{{{self.xu}}}{{{self.d}}}", | ||
comparison_operator_label=r"\rightarrow", | ||
) |
49 changes: 49 additions & 0 deletions
49
...ints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_5_structural_analysis/formula_5_19.py
This file contains 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,49 @@ | ||
"""Formula 5.19 from NEN-EN 1992-1-1+C2:2011: Chapter 5 - Structural Analysis.""" | ||
|
||
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 | ||
from blueprints.type_alias import DIMENSIONLESS, KN_M | ||
from blueprints.validations import raise_if_less_or_equal_to_zero | ||
|
||
|
||
class Form5Dot19EffectiveCreepCoefficient(Formula): | ||
"""Class representing formula 5.19 for the calculation of the effective creep coefficient, ϕef.""" | ||
|
||
label = "5.19" | ||
source_document = NEN_EN_1992_1_1_C2_2011 | ||
|
||
def __init__(self, phi_inf_t0: DIMENSIONLESS, m0_eqp: KN_M, m0_ed: KN_M) -> None: | ||
"""[:math:`ϕ_{ef}`] Effective creep coefficient. | ||
NEN-EN 1992-1-1+C2:2011 art.5.8.4(2) - Formula (5.19) | ||
Parameters | ||
---------- | ||
phi_inf_t0 : DIMENSIONLESS | ||
[:math:`ϕ (∞,t0)`] is the final value of the creep coefficient according to art. 3.1.4. | ||
m0_eqp : KN_M | ||
[:math:`M_{0,Eqp}`] is the first-order bending moment in the quasi-permanent load combination (SLS). | ||
m0_ed : KN_M | ||
[:math:`M_{0,Ed}`] is the first-order bending moment in the ultimate limit state (ULS). | ||
""" | ||
super().__init__() | ||
self.phi_inf_t0 = phi_inf_t0 | ||
self.m0_eqp = m0_eqp | ||
self.m0_ed = m0_ed | ||
|
||
@staticmethod | ||
def _evaluate(phi_inf_t0: DIMENSIONLESS, m0_eqp: KN_M, m0_ed: KN_M) -> DIMENSIONLESS: | ||
"""Evaluates the formula, for more information see the __init__ method.""" | ||
raise_if_less_or_equal_to_zero(m0_ed=m0_ed) | ||
return phi_inf_t0 * (m0_eqp / m0_ed) | ||
|
||
def latex(self) -> LatexFormula: | ||
"""Returns LatexFormula object for formula 5.19.""" | ||
return LatexFormula( | ||
return_symbol=r"\phi_{ef}", | ||
result=f"{self:.3f}", | ||
equation=r"\phi (\infty,t_0) \cdot \frac{M_{0,Eqp}}{M_{0,Ed}}", | ||
numeric_equation=rf"{self.phi_inf_t0} \cdot \frac{{{self.m0_eqp}}}{{{self.m0_ed}}}", | ||
comparison_operator_label="=", | ||
) |
46 changes: 46 additions & 0 deletions
46
...ints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_5_structural_analysis/formula_5_20.py
This file contains 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,46 @@ | ||
"""Formula 5.20 from NEN-EN 1992-1-1+C2:2011: Chapter 5 - Structural Analysis.""" | ||
|
||
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 | ||
from blueprints.type_alias import DIMENSIONLESS, MPA | ||
from blueprints.validations import raise_if_less_or_equal_to_zero | ||
|
||
|
||
class Form5Dot20DesignModulusElasticity(Formula): | ||
"""Class representing formula 5.20 for the calculation of the design modulus of elasticity, :math:`E_{cd}`.""" | ||
|
||
label = "5.20" | ||
source_document = NEN_EN_1992_1_1_C2_2011 | ||
|
||
def __init__(self, e_cm: MPA, gamma_ce: DIMENSIONLESS = 1.2) -> None: | ||
r"""[:math:`E_{cd}`] Design modulus of elasticity. | ||
NEN-EN 1992-1-1+C2:2011 art.5.8.6(3) - Formula (5.20) | ||
Parameters | ||
---------- | ||
e_cm : MPA | ||
[:math:`E_{cm}`] is the characteristic modulus of elasticity of concrete. | ||
gamma_ce : DIMENSIONLESS, optional | ||
[:math:`\gamma_{cE}`] is the factor for the design value of the modulus of elasticity. Default is 1.2 which is the recommended value. | ||
""" | ||
super().__init__() | ||
self.e_cm = e_cm | ||
self.gamma_ce = gamma_ce | ||
|
||
@staticmethod | ||
def _evaluate(e_cm: MPA, gamma_ce: DIMENSIONLESS) -> MPA: | ||
"""Evaluates the formula, for more information see the __init__ method.""" | ||
raise_if_less_or_equal_to_zero(gamma_ce=gamma_ce) | ||
return e_cm / gamma_ce | ||
|
||
def latex(self) -> LatexFormula: | ||
"""Returns LatexFormula object for formula 5.20.""" | ||
return LatexFormula( | ||
return_symbol=r"E_{cd}", | ||
result=f"{self:.3f}", | ||
equation=r"\frac{E_{cm}}{\gamma_{CE}}", | ||
numeric_equation=rf"\frac{{{self.e_cm}}}{{{self.gamma_ce}}}", | ||
comparison_operator_label="=", | ||
) |
This file contains 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
This file contains 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.