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

fix: rotate strain in result from bending strength #206

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

talledodiego
Copy link
Collaborator

This PR solves the bug spot by @MestreCarlos in #163.

Now the following code snippet provided by @MestreCarlos:

import math
from pprint import pprint

from shapely import Polygon

from structuralcodes.geometry import SurfaceGeometry
from structuralcodes.materials.concrete import ConcreteEC2_2004
from structuralcodes.materials.reinforcement import ReinforcementEC2_2023
from structuralcodes.sections._generic import GenericSection
from structuralcodes.geometry import add_reinforcement_line

# Materials
concrete = ConcreteEC2_2004(25)
reinforcement = ReinforcementEC2_2023(
    fyk=500, Es=200000, density=7850, ftk=550, epsuk=0.07
)

# Create section
poly = Polygon(((0, 0), (350, 0), (350, 500), (0, 500)))
geo = SurfaceGeometry(poly, concrete)
geo = add_reinforcement_line(
    geo, (50, 450), (300, 450), 20, reinforcement, n=10
)
geo = add_reinforcement_line(geo, (50, 50), (300, 50), 20, reinforcement, n=10)
geo = geo.translate(-175, -250)
sec = GenericSection(geo)

# Draw & print
print('====== SECTION ======')
print('====== Theta = pi/6 ======')
pprint(sec.section_calculator.calculate_bending_strength(theta=math.pi / 6))

produces the following expected result:

====== SECTION ======
====== Theta = pi/6 ======
UltimateBendingMomentResults(theta=0.5235987755982988,
n=-0.003881820593960583,
m_y=-537978185.0265349,
m_z=-64913391.04673183,
chi_y=-1.4516931240180188e-05,
chi_z=-8.381354159325317e-06,
eps_a=0.0015959697879269737)

@talledodiego talledodiego added the bug Something isn't working label Nov 21, 2024
@talledodiego talledodiego linked an issue Nov 21, 2024 that may be closed by this pull request
Copy link
Member

@mortenengen mortenengen left a comment

Choose a reason for hiding this comment

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

Thanks for providing this fix!

@mortenengen mortenengen changed the title rotate strain in result from bending strength fix: rotate strain in result from bending strength Nov 26, 2024
@mortenengen mortenengen merged commit c0da944 into dev Nov 26, 2024
5 checks passed
@mortenengen mortenengen deleted the bugfix-strain-rotation branch November 26, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done 🚀
Development

Successfully merging this pull request may close these issues.

calculate_bending_strength results - coordinate axes
2 participants