"""Formula 6.10a/bN from NEN-EN 1992-1-1+C2:2011: Chapter 6 - Ultimate 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, DEG, KG, N, NMM, MM, MM2, MM3, MM4, MPA from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative class Form6Dot10abNStrengthReductionFactor(Formula): r"""Class representing formula 6.10a/bN for the calculation of the strength reduction factor for concrete cracked in shear.""" label = "6.10a/bN" source_document = NEN_EN_1992_1_1_C2_2011 def __init__( self, f_ck: MPA, ) -> None: r"""[$$\nu_{1}$$] Strength reduction factor for concrete cracked in shear [-]. NEN-EN 1992-1-1+C2:2011 art.6.2.2(1) - Formula (6.10.aN and 6.10.bN) 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) f_ck = 100 output = 0 match f_ck: case f_ck if f_ck <= 60: output= 0.6 case f_ck if f_ck > 60: output= max(0.9 - f_ck / 200, 0.5) return output def latex(self) -> LatexFormula: """Returns LatexFormula object for formula 6.10a/bN.""" _equation: str = r"\begin{cases} 0.600 & \text{if } f_{ck} \leq 60 MPa \\ \max\left(0.9 - \frac{f_{ck}}{200}, 0.5\right) & \text{if } f_{ck} > 60 MPa \end{cases}" _numeric_equation: str = latex_replace_symbols( _equation, { "f_{ck}": f"{self.f_ck:.3f}", }, False, ) return LatexFormula( return_symbol=r"\nu_{1}", result=f"{self:.3f}", equation=_equation, numeric_equation=_numeric_equation, comparison_operator_label="=", unit="-", )