Skip to content
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

Add formulas from chapter 12 1 to 12 6 from nen en 1992 1 1 #441

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

RamiEvans
Copy link
Contributor

@RamiEvans RamiEvans commented Jan 22, 2025

Description

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

Copy link

Thank you so much for contributing to Blueprints! This is your Pull Request # 1 to this project.
Your contributions help thousands of engineers work more efficiently and accurately.

Now that you've created your pull request, please don't go away; take a look at the bottom of this page for the automated checks that should already be running. If they pass, great! If not, please click on 'Details' and see if you can fix the problem they've identified. A maintainer should be along shortly to review your pull request and help get it added!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened with this file? i'd suggest reverting it to original and then only add the 6 rows that shouldve had changes


def __init__(
self,
alpha_ct_pl: DIMENSIONLESS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expression is with alpha_ct. the pl suffix is only found in the description.


class Form12Dot1PlainConcreteTensileStrength(Formula):
r"""Class representing formula 12.1 for the calculation of the design tensile strength of plain concrete,
:math:`f_{ctd,pl}`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12.1 is for regular f_ctd?

) -> None:
r"""[:math:`f_{ctd,pl}`] Design tensile strength of plain concrete [:math:`MPa`].

NEN-EN 1992-1-1+C2:2011 art.12.3.1 - Formula (12.1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12.3.1(2)

),
("short", r"f_{ctd,pl} = 1.333"),
(
"string",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we're using the string anymore. so no need add it for next Pull Requests


Parameters
----------
eta_f_cd_pl : MPa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12.2 is without the _pl

"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(
v_ed=v_ed,
a_cc=a_cc,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for a_cc here

a_cc: MM2,
) -> MPA:
"""Evaluates the formula, for more information see the __init__ method."""
raise_if_negative(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k is missing in this one

"""Helper class for sigma_cp vs sigma_c,lim evaluation."""


class Form12Dot4PlainConcreteShearStressComparison:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
shouldnt this class represent this function? id place this code in the 12.5/6 file.

return LatexFormula(
return_symbol=r"f_{cvd}",
result=f"{result:.3f}",
equation=equation,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about if done like this?:

image

example code (didnt test completely):
` def latex(self) -> LatexFormula:
"""Returns LatexFormula object for formula 12.5. / 12.6."""
result = self._evaluate(self.f_ctd_pl, self.sigma_cp, self.sigma_c_lim)

    equation_smallor_or_equal = r"\sqrt{f_{ctd, pl} ^ 2 + \sigma_{cp} \cdot f_{ctd, pl}}"
    numeric_equation_smallor_or_equal = rf"\sqrt{{{self.f_ctd_pl:.3f} ^ 2 + {self.sigma_cp:.3f} \cdot {self.f_ctd_pl:.3f}}}"

    equation_larger = r"\sqrt{f_{ctd, pl} ^ 2 + \sigma_{cp} \cdot f_{ctd, pl} - \left(\frac{\sigma_{cp} - \sigma_{c, lim}}{2}\right) ^ 2}"
    part1 = f"{self.f_ctd_pl:.3f} ^ 2"
    part2 = rf"{self.sigma_cp:.3f} \cdot {self.f_ctd_pl:.3f}"
    part3 = f"\\left(\\frac{{{self.sigma_cp:.3f} - {self.sigma_c_lim:.3f}}}{2}\\right) ^ 2"
    numeric_equation_larger = rf"\sqrt{{{part1} + {part2} - {part3}}}"

    equation = rf"\begin{{cases}} {equation_smallor_or_equal} & \text{{if }} \sigma_{{cp}} \leq \sigma_{{c, lim}} \\ {equation_larger} & \text{{otherwise}} \end{{cases}}"
    numeric_equation = rf"\begin{{cases}} {numeric_equation_smallor_or_equal} & \text{{if }} \sigma_{{cp}} \leq \sigma_{{c, lim}} \\ {numeric_equation_larger} & \text{{otherwise}} \end{{cases}}"

    return LatexFormula(
        return_symbol=r"f_{cvd}",
        result=f"{result:.3f}",
        equation=equation,
        numeric_equation=numeric_equation,
        comparison_operator_label="=",
    )`

)
def test_raise_error_when_negative_values_are_given(
self,
alpha_ct_pl: float,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dimensionless x3

@GerjanDorgelo GerjanDorgelo removed the request for review from egarciamendez January 26, 2025 12:51

def __init__(
self,
f_ctd_pl: MPA,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code doesnt show this as _pl
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants