|
| 1 | +"""Formula 6.47 from NEN-EN 1992-1-1+C2:2011: Chapter 6 - Ultimate Limit State.""" |
| 2 | + |
| 3 | +import numpy as np |
| 4 | + |
| 5 | +from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011 |
| 6 | +from blueprints.codes.formula import Formula |
| 7 | +from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols |
| 8 | +from blueprints.type_alias import DIMENSIONLESS, MM, MM2, MPA, N |
| 9 | +from blueprints.validations import raise_if_less_or_equal_to_zero, raise_if_negative |
| 10 | + |
| 11 | + |
| 12 | +class SubForm6Dot47FactorK(Formula): |
| 13 | + r"""Class representing the sub-formula which calculates the factor [$$k$$] for formula 6.47 .""" |
| 14 | + |
| 15 | + label = "6.47 (factor k)" |
| 16 | + source_document = NEN_EN_1992_1_1_C2_2011 |
| 17 | + |
| 18 | + def __init__(self, d: MM) -> None: |
| 19 | + r"""[$$k$$] Calculation of factor k. |
| 20 | +
|
| 21 | + NEN-EN 1992-1-1+C2:2011 art.6.4.4(1) - Factor k for Formula (6.47) |
| 22 | +
|
| 23 | + Parameters |
| 24 | + ---------- |
| 25 | + d : MM |
| 26 | + [$$d$$] Effective depth [$$mm$$]. |
| 27 | + """ |
| 28 | + super().__init__() |
| 29 | + self.d = d |
| 30 | + |
| 31 | + @staticmethod |
| 32 | + def _evaluate(d: MM) -> DIMENSIONLESS: |
| 33 | + """Evaluates the formula, for more information see the __init__ method.""" |
| 34 | + raise_if_less_or_equal_to_zero(d=d) |
| 35 | + return min(1 + np.sqrt(200 / d), 2.0) |
| 36 | + |
| 37 | + def latex(self) -> LatexFormula: |
| 38 | + """Returns LatexFormula object for sub-formula 6.47 (factor k).""" |
| 39 | + _equation: str = r"\min \left( 1 + \sqrt{\frac{200}{d}}, 2.0 \right)" |
| 40 | + _numeric_equation: str = latex_replace_symbols( |
| 41 | + _equation, |
| 42 | + { |
| 43 | + r"d": f"{self.d:.3f}", |
| 44 | + }, |
| 45 | + False, |
| 46 | + ) |
| 47 | + return LatexFormula( |
| 48 | + return_symbol=r"k", |
| 49 | + result=f"{self:.3f}", |
| 50 | + equation=_equation, |
| 51 | + numeric_equation=_numeric_equation, |
| 52 | + comparison_operator_label="=", |
| 53 | + unit="-", |
| 54 | + ) |
| 55 | + |
| 56 | + |
| 57 | +class SubForm6Dot47FactorRhoL(Formula): |
| 58 | + r"""Class representing the sub-formula which calculates the factor [$$\rho_l$$] for formula 6.47 .""" |
| 59 | + |
| 60 | + label = "6.47 (factor rho_l)" |
| 61 | + source_document = NEN_EN_1992_1_1_C2_2011 |
| 62 | + |
| 63 | + def __init__(self, rho_ly: DIMENSIONLESS, rho_lz: DIMENSIONLESS) -> None: |
| 64 | + r"""[$$\rho_l$$] Calculation of factor [$$\rho_l$$]. |
| 65 | +
|
| 66 | + NEN-EN 1992-1-1+C2:2011 art.6.4.4(1) - Factor rho_l for Formula (6.47) |
| 67 | +
|
| 68 | + Parameters |
| 69 | + ---------- |
| 70 | + rho_ly : DIMENSIONLESS |
| 71 | + [$$\rho_{ly}$$] Related to the bonded tension steel in y- drection. The value $$\rho_ly$$ should be calculated as mean values taking |
| 72 | + into account a slab width equal to the column width plus 3d each side [$$-$$]. |
| 73 | + rho_lz : DIMENSIONLESS |
| 74 | + [$$\rho_{lz}$$] Related to the bonded tension steel in z- drection. The value $$\rho_lz$$ should be calculated as mean values taking |
| 75 | + into account a slab width equal to the column width plus 3d each side [$$-$$]. |
| 76 | + """ |
| 77 | + super().__init__() |
| 78 | + self.rho_ly = rho_ly |
| 79 | + self.rho_lz = rho_lz |
| 80 | + |
| 81 | + @staticmethod |
| 82 | + def _evaluate(rho_ly: DIMENSIONLESS, rho_lz: DIMENSIONLESS) -> DIMENSIONLESS: |
| 83 | + """Evaluates the formula, for more information see the __init__ method.""" |
| 84 | + raise_if_negative(rho_ly=rho_ly, rho_lz=rho_lz) |
| 85 | + return min(np.sqrt(rho_ly * rho_lz), 0.02) |
| 86 | + |
| 87 | + def latex(self) -> LatexFormula: |
| 88 | + """Returns LatexFormula object for sub-formula 6.47 (factor rho_l).""" |
| 89 | + _equation: str = r"\min \left( \sqrt{\rho_{ly} \cdot \rho_{lz}}, 0.02 \right)" |
| 90 | + _numeric_equation: str = latex_replace_symbols( |
| 91 | + _equation, |
| 92 | + { |
| 93 | + r"\rho_{ly}": f"{self.rho_ly:.3f}", |
| 94 | + r"\rho_{lz}": f"{self.rho_lz:.3f}", |
| 95 | + }, |
| 96 | + False, |
| 97 | + ) |
| 98 | + return LatexFormula( |
| 99 | + return_symbol=r"\rho_l", |
| 100 | + result=f"{self:.3f}", |
| 101 | + equation=_equation, |
| 102 | + numeric_equation=_numeric_equation, |
| 103 | + comparison_operator_label="=", |
| 104 | + unit="-", |
| 105 | + ) |
| 106 | + |
| 107 | + |
| 108 | +class SubForm6Dot47FactorSigmaCp(Formula): |
| 109 | + r"""Class representing the sub-formula which calculates the factor [$$\sigma_{cp}$$] for formula 6.47,.""" |
| 110 | + |
| 111 | + label = "6.47 (factor sigma_cp)" |
| 112 | + source_document = NEN_EN_1992_1_1_C2_2011 |
| 113 | + |
| 114 | + def __init__(self, sigma_cy: MPA, sigma_cz: MPA) -> None: |
| 115 | + r"""[$$\sigma_{cp}$$] Calculation of factor [$$\sigma_{cp}$$]. |
| 116 | +
|
| 117 | + NEN-EN 1992-1-1+C2:2011 art.6.4.4(1) - Factor sigma_cp for Formula (6.47) |
| 118 | +
|
| 119 | + Parameters |
| 120 | + ---------- |
| 121 | + sigma_cy : MPA |
| 122 | + [$$\sigma_{cy}$$] Normal concrete stress in the critical section in the y-direction [$$MPa$$], Positive if compression. |
| 123 | + See equation SubForm6Dot47FactorSigmaCy. |
| 124 | + sigma_cz : MPA |
| 125 | + [$$\sigma_{cz}$$] Normal concrete stress inm the critical section in the z-direction [$$MPa$$], Positive if compression. |
| 126 | + See equation SubForm6Dot47FactorSigmaCz. |
| 127 | + """ |
| 128 | + super().__init__() |
| 129 | + self.sigma_cy = sigma_cy |
| 130 | + self.sigma_cz = sigma_cz |
| 131 | + |
| 132 | + @staticmethod |
| 133 | + def _evaluate(sigma_cy: MPA, sigma_cz: MPA) -> MPA: |
| 134 | + """Evaluates the formula, for more information see the __init__ method.""" |
| 135 | + raise_if_negative(sigma_cy=sigma_cy, sigma_cz=sigma_cz) |
| 136 | + return (sigma_cy + sigma_cz) / 2 |
| 137 | + |
| 138 | + def latex(self) -> LatexFormula: |
| 139 | + """Returns LatexFormula object for sub-formula 6.47 (sigma_cp).""" |
| 140 | + _equation: str = r"\frac{\sigma_{cy} + \sigma_{cz}}{2}" |
| 141 | + _numeric_equation: str = latex_replace_symbols( |
| 142 | + _equation, |
| 143 | + { |
| 144 | + r"\sigma_{cy}": f"{self.sigma_cy:.3f}", |
| 145 | + r"\sigma_{cz}": f"{self.sigma_cz:.3f}", |
| 146 | + }, |
| 147 | + False, |
| 148 | + ) |
| 149 | + return LatexFormula( |
| 150 | + return_symbol=r"\sigma_{cp}", |
| 151 | + result=f"{self:.3f}", |
| 152 | + equation=_equation, |
| 153 | + numeric_equation=_numeric_equation, |
| 154 | + comparison_operator_label="=", |
| 155 | + unit="MPa", |
| 156 | + ) |
| 157 | + |
| 158 | + |
| 159 | +class SubForm6Dot47FactorSigmaCy(Formula): |
| 160 | + r"""Class representing the sub-formula which calculates the factor [$$\sigma_{cy}$$] for formula 6.47.""" |
| 161 | + |
| 162 | + label = "6.47 (factor sigma_cy)" |
| 163 | + source_document = NEN_EN_1992_1_1_C2_2011 |
| 164 | + |
| 165 | + def __init__(self, n_ed_y: N, a_cy: MM2) -> None: |
| 166 | + r"""[$$\sigma_{cy}$$] Calculation of factor [$$\sigma_{cy}$$]. |
| 167 | +
|
| 168 | + NEN-EN 1992-1-1+C2:2011 art.6.4.4(1) - Factor sigma_cy for Formula (6.47) |
| 169 | +
|
| 170 | + Parameters |
| 171 | + ---------- |
| 172 | + n_ed_y : N |
| 173 | + [$$N_{Ed,y}$$] Longitudinal forces across the full bay for internal columns and the logintudinal force across |
| 174 | + the control section for edge columns. The force may be from a load or prestressing action [$$N$$]. |
| 175 | + a_cy : MM2 |
| 176 | + [$$A_{cy}$$] Cross-sectional area in y-direction [$$mm^2$$]. |
| 177 | + """ |
| 178 | + super().__init__() |
| 179 | + self.n_ed_y = n_ed_y |
| 180 | + self.a_cy = a_cy |
| 181 | + |
| 182 | + @staticmethod |
| 183 | + def _evaluate(n_ed_y: N, a_cy: MM2) -> MPA: |
| 184 | + """Evaluates the formula, for more information see the __init__ method.""" |
| 185 | + raise_if_less_or_equal_to_zero(a_cy=a_cy) |
| 186 | + raise_if_negative(n_ed_y=n_ed_y) |
| 187 | + return n_ed_y / a_cy |
| 188 | + |
| 189 | + def latex(self) -> LatexFormula: |
| 190 | + """Returns LatexFormula object for sub-formula 6.47 (sigma_cy).""" |
| 191 | + _equation: str = r"\frac{N_{Ed,y}}{A_{cy}}" |
| 192 | + _numeric_equation: str = latex_replace_symbols( |
| 193 | + _equation, |
| 194 | + { |
| 195 | + r"N_{Ed,y}": f"{self.n_ed_y:.3f}", |
| 196 | + r"A_{cy}": f"{self.a_cy:.3f}", |
| 197 | + }, |
| 198 | + False, |
| 199 | + ) |
| 200 | + return LatexFormula( |
| 201 | + return_symbol=r"\sigma_{cy}", |
| 202 | + result=f"{self:.3f}", |
| 203 | + equation=_equation, |
| 204 | + numeric_equation=_numeric_equation, |
| 205 | + comparison_operator_label="=", |
| 206 | + unit="MPa", |
| 207 | + ) |
| 208 | + |
| 209 | + |
| 210 | +class SubForm6Dot47FactorSigmaCz(Formula): |
| 211 | + r"""Class representing the sub-formula which calculates the factor [$$\sigma_{cz}$$] for formula 6.47.""" |
| 212 | + |
| 213 | + label = "6.47 (factor sigma_cz)" |
| 214 | + source_document = NEN_EN_1992_1_1_C2_2011 |
| 215 | + |
| 216 | + def __init__(self, n_ed_z: N, a_cz: MM2) -> None: |
| 217 | + r"""[$$\sigma_{cz}$$] Calculation of factor [$$\sigma_{cz}$$]. |
| 218 | +
|
| 219 | + NEN-EN 1992-1-1+C2:2011 art.6.4.4(1) - Factor sigma_cz for Formula (6.47) |
| 220 | +
|
| 221 | + Parameters |
| 222 | + ---------- |
| 223 | + n_ed_z : N |
| 224 | + [$$N_{Ed,z}$$] Longitudinal forces across the full bay for internal columns and the logintudinal force across |
| 225 | + the control section for edge columns. The force may be from a load or prestressing action [$$N$$]. |
| 226 | + a_cz : MM2 |
| 227 | + [$$A_{cz}$$] Cross-sectional area in z-direction [$$mm^2$$]. |
| 228 | + """ |
| 229 | + super().__init__() |
| 230 | + self.n_ed_z = n_ed_z |
| 231 | + self.a_cz = a_cz |
| 232 | + |
| 233 | + @staticmethod |
| 234 | + def _evaluate(n_ed_z: N, a_cz: MM2) -> MPA: |
| 235 | + """Evaluates the formula, for more information see the __init__ method.""" |
| 236 | + raise_if_less_or_equal_to_zero(a_cz=a_cz) |
| 237 | + raise_if_negative(n_ed_z=n_ed_z) |
| 238 | + return n_ed_z / a_cz |
| 239 | + |
| 240 | + def latex(self) -> LatexFormula: |
| 241 | + """Returns LatexFormula object for sub-formula 6.47 sigma_cz.""" |
| 242 | + _equation: str = r"\frac{N_{Ed,z}}{A_{cz}}" |
| 243 | + _numeric_equation: str = latex_replace_symbols( |
| 244 | + _equation, |
| 245 | + { |
| 246 | + r"N_{Ed,z}": f"{self.n_ed_z:.3f}", |
| 247 | + r"A_{cz}": f"{self.a_cz:.3f}", |
| 248 | + }, |
| 249 | + False, |
| 250 | + ) |
| 251 | + return LatexFormula( |
| 252 | + return_symbol=r"\sigma_{cz}", |
| 253 | + result=f"{self:.3f}", |
| 254 | + equation=_equation, |
| 255 | + numeric_equation=_numeric_equation, |
| 256 | + comparison_operator_label="=", |
| 257 | + unit="MPa", |
| 258 | + ) |
0 commit comments