Skip to content

Commit

Permalink
all LaTeX code related to chapter 3. for consistency eq 24 and 25 wer…
Browse files Browse the repository at this point in the history
…e merged into single file. just as 19/20 and 21/22 are.
  • Loading branch information
gerjan.dorgelo committed Sep 4, 2024
1 parent a43e2d5 commit bfd2230
Show file tree
Hide file tree
Showing 49 changed files with 1,011 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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 DAYS, MM, MM2


Expand Down Expand Up @@ -60,6 +61,16 @@ def _evaluate(
raise ValueError(f"Invalid h_0: {h_0}. h_0 cannot be negative or zero")
return (t - t_s) / ((t - t_s) + 0.04 * np.sqrt(h_0**3))

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.10 formula."""
return LatexFormula(
return_symbol=r"\beta_{ds}(t,t_s)",
result=f"{self:.3f}",
equation=r"\frac{(t - t_s)}{(t - t_s) + 0.04 \sqrt{h_0^3}}",
numeric_equation=rf"\frac{{({self.t:.3f} - {self.t_s:.3f})}}{{({self.t:.3f} - {self.t_s:.3f}) + 0.04 \sqrt{{{self.h_0:.3f}^3}}}}",
comparison_operator_label="=",
)


class SubForm3Dot10FictionalCrossSection(Formula):
"""Class representing sub-formula for formula 3.10 for the calculation of fictional thickness of the cross-section."""
Expand Down Expand Up @@ -98,3 +109,13 @@ def _evaluate(
if u <= 0:
raise ValueError(f"Invalid u: {u}. u cannot be negative or zero")
return 2 * a_c / u

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.10 subformula."""
return LatexFormula(
return_symbol=r"h_0",
result=f"{self:.3f}",
equation=r"2 \cdot A_c / u",
numeric_equation=rf"2 \cdot {self.a_c:.3f} / {self.u:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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


class Form3Dot11AutogeneShrinkage(Formula):
Expand Down Expand Up @@ -47,3 +48,13 @@ def _evaluate(
if beta_as_t < 0:
raise ValueError(f"Invalid beta_as_t: {beta_as_t}. beta_as_t cannot be negative")
return beta_as_t * epsilon_ca_inf

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.11."""
return LatexFormula(
return_symbol=r"\epsilon_{ca}(t)",
result=f"{self:.3f}",
equation=r"\beta_{as}(t) \cdot \epsilon_{ca}(\infty)",
numeric_equation=rf"{self.beta_as_t:.3f} \cdot {self.epsilon_ca_inf:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -39,3 +40,13 @@ def _evaluate(
if f_ck < 0:
raise ValueError(f"Invalid f_ck: {f_ck}. f_ck cannot be negative")
return 2.5 * (f_ck - 10) * 10**-6

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.12."""
return LatexFormula(
return_symbol=r"\epsilon_{ca}(\infty)",
result=f"{self:.6f}",
equation=r"2.5 \cdot (f_{ck} - 10) \cdot 10^{-6}",
numeric_equation=rf"2.5 \cdot ({self.f_ck:.3f} - 10) \cdot 10^{{-6}}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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 DAYS


Expand Down Expand Up @@ -41,3 +42,13 @@ def _evaluate(
if t < 0:
raise ValueError(f"Invalid t: {t}. t cannot be negative")
return 1 - np.exp(-0.2 * t**0.5)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.13."""
return LatexFormula(
return_symbol=r"\beta_{as}(t)",
result=f"{self:.3f}",
equation=r"1 - \exp(-0.2 \cdot t^{0.5})",
numeric_equation=rf"1 - \exp(-0.2 \cdot {self.t:.3f}^{{0.5}})",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -51,6 +52,16 @@ def _evaluate(
raise ValueError(f"Invalid eta: {eta}. eta cannot be negative")
return (k * eta - eta**2) / (1 + (k - 2) * eta)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.14."""
return LatexFormula(
return_symbol=r"\frac{\sigma_c}{f_{cm}}",
result=f"{self:.3f}",
equation=r"\frac{k \cdot \eta - \eta^2}{1 + (k-2) \cdot \eta}",
numeric_equation=rf"\frac{{{self.k:.3f} \cdot {self.eta:.3f} - {self.eta:.3f}^2}}{{1 + ({self.k:.3f}-2) \cdot {self.eta:.3f}}}",
comparison_operator_label="=",
)


class SubForm3Dot14Eta(Formula):
"""Class representing sub-formula 1 for formula 3.14, which calculates eta."""
Expand Down Expand Up @@ -86,6 +97,16 @@ def _evaluate(
"""Evaluates the formula, for more information see the __init__ method."""
return epsilon_c / epsilon_c1

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.14 sub 1."""
return LatexFormula(
return_symbol=r"\eta",
result=f"{self:.3f}",
equation=r"\epsilon_c / \epsilon_{c1}",
numeric_equation=rf"{self.epsilon_c:.3f} / {self.epsilon_c1:.3f}",
comparison_operator_label="=",
)


class SubForm3Dot14K(Formula):
"""Class representing sub-formula 2 for formula 3.14, which calculates k."""
Expand Down Expand Up @@ -124,3 +145,13 @@ def _evaluate(
if f_cm <= 0:
raise ValueError(f"Invalid f_cm: {f_cm}. f_cm cannot be negative or zero")
return 1.05 * e_cm * abs(epsilon_c1) / f_cm

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.14 sub 2."""
return LatexFormula(
return_symbol=r"k",
result=f"{self:.3f}",
equation=r"1.05 \cdot E_{cm} \cdot |\epsilon_{c1}| / f_{cm}",
numeric_equation=rf"1.05 \cdot {self.e_cm:.3f} \cdot |{self.epsilon_c1:.3f}| / {self.f_cm:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -54,3 +55,13 @@ def _evaluate(
if gamma_c <= 0:
raise ValueError(f"Invalid gamma_c: {gamma_c}. gamma_c cannot be negative or zero")
return alpha_cc * f_ck / gamma_c

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.15."""
return LatexFormula(
return_symbol=r"f_{cd}",
result=f"{self:.3f}",
equation=r"\alpha_{cc} \cdot f_{ck} / \gamma_C",
numeric_equation=rf"{self.alpha_cc:.3f} \cdot {self.f_ck:.3f} / {self.gamma_c:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -54,3 +55,13 @@ def _evaluate(
if gamma_c <= 0:
raise ValueError(f"Invalid gamma_c: {gamma_c}. gamma_c cannot be negative or zero")
return alpha_ct * f_ctk_0_05 / gamma_c

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.16."""
return LatexFormula(
return_symbol=r"f_{ctd}",
result=f"{self:.3f}",
equation=r"\alpha_{ct} \cdot f_{ctk,0.05} / \gamma_C",
numeric_equation=rf"{self.alpha_ct:.3f} \cdot {self.f_ctk_0_05:.3f} / {self.gamma_c:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -58,3 +59,16 @@ def _evaluate(
if epsilon_c > epsilon_c2:
raise ValueError(f"epsilon_c: {epsilon_c} > epsilon_c2: {epsilon_c2}. Try using Form3Dot18CompressiveStressConcrete class.")
return f_cd * (1 - (1 - (epsilon_c / epsilon_c2)) ** n)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.17."""
return LatexFormula(
return_symbol=r"\sigma_c",
result=f"{self:.3f}",
equation=r"f_{cd} \cdot \left[ 1 - \left( 1 - \frac{\epsilon_c}{\epsilon_{c2}} \right)^n \right]",
numeric_equation=(
rf"{self.f_cd:.3f} \cdot \left[ 1 - \left( 1 - \frac{{{self.epsilon_c:.3f}}}"
rf"{{{self.epsilon_c2:.3f}}} \right)^{self.n:.3f} \right]"
),
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -39,3 +40,13 @@ def _evaluate(
if f_cd < 0:
raise ValueError(f"Invalid f_cd: {f_cd}. f_cd cannot be negative")
return f_cd

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.18."""
return LatexFormula(
return_symbol=r"sigma_c",
result=f"{self:.3f}",
equation=r"f_{cd}",
numeric_equation=rf"{self.f_cd:.3f}",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -42,3 +43,13 @@ def _evaluate(
if f_ck <= 90:
return 0.8 - (f_ck - 50) / 400
raise ValueError(f"Invalid f_ck: {f_ck}. Maximum of f_ck is 90 MPa")

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.19 and 3.20."""
return LatexFormula(
return_symbol=r"\lambda",
result=f"{self:.3f}",
equation=r"0.8" if self.f_ck <= 50 else r"0.8 - (f_{ck} - 50) / 400",
numeric_equation=r"0.8" if self.f_ck <= 50 else rf"0.8 - ({self.f_ck:.3f} - 50) / 400",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MPA


Expand Down Expand Up @@ -42,3 +43,13 @@ def _evaluate(
if f_ck <= 90:
return 1.0 - (f_ck - 50) / 200
raise ValueError(f"Invalid f_ck: {f_ck}. Maximum of f_ck is 90 MPa")

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.21 and 3.22."""
return LatexFormula(
return_symbol=r"\eta",
result=f"{self:.3f}",
equation=r"1.0" if self.f_ck <= 50 else r"1.0 - (f_{ck} - 50) / 200",
numeric_equation=r"1.0" if self.f_ck <= 50 else rf"1.0 - ({self.f_ck:.3f} - 50) / 200",
comparison_operator_label="=",
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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 MM, MPA


Expand Down Expand Up @@ -46,3 +47,13 @@ def _evaluate(
if f_ctm < 0:
raise ValueError(f"Invalid f_ctm: {f_ctm}. f_ctm cannot be negative")
return max((1.6 - h / 1000) * f_ctm, f_ctm)

def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 3.23."""
return LatexFormula(
return_symbol=r"f_{ctm,fl}",
result=f"{self:.3f}",
equation=r"\max \left[ (1.6 - h/1000) \cdot f_{ctm} ; f_{ctm} \right]",
numeric_equation=rf"\max \left[ (1.6 - {self.h:.3f}/1000) \cdot {self.f_ctm:.3f} ; {self.f_ctm:.3f} \right]",
comparison_operator_label="=",
)

This file was deleted.

Loading

0 comments on commit bfd2230

Please sign in to comment.