Skip to content

add last point to complete domain in nm_interaction_domain#342

Open
talledodiego wants to merge 1 commit intodevfrom
complete-domain-last-point
Open

add last point to complete domain in nm_interaction_domain#342
talledodiego wants to merge 1 commit intodevfrom
complete-domain-last-point

Conversation

@talledodiego
Copy link
Copy Markdown
Collaborator

Added the last point in nm_interaction_domain when setting complete_domain=True.
Indeed without this modification the following code:

import numpy as np
import matplotlib.pyplot as plt
from structuralcodes.geometry import RectangularGeometry
from structuralcodes.materials.basic import ElasticMaterial
from structuralcodes.sections import BeamSection

width = 200
height = 400
E = 10000
eps_u = 0.01

def elastic_rec_section() -> BeamSection:
    """Create a simple rectangular section with known properties."""
    # Square section centered at (0, 0)
    mat = ElasticMaterial(E=E, density=700, ultimate_strain=eps_u)

    geo = RectangularGeometry(width, height, mat)

    # It should not be concrete
    assert not geo.concrete

    return BeamSection(geo, integrator="marin")

sec = elastic_rec_section()
nm_domain_pos = sec.section_calculator.calculate_nm_interaction_domain()
nm_domain_neg = sec.section_calculator.calculate_nm_interaction_domain(theta=np.pi)
nm_domain_all = sec.section_calculator.calculate_nm_interaction_domain(complete_domain=True)

fig, axs = plt.subplots(1, 2, figsize=(12, 6))
axs[0].plot(nm_domain_pos.n * 1e-3, -nm_domain_pos.m_y * 1e-6, label="N-M Interaction Domain")
axs[0].plot(nm_domain_neg.n * 1e-3, -nm_domain_neg.m_y * 1e-6, label="N-M Interaction Domain (Negative)",)
axs[0].set_xlabel("N [kN]")
axs[0].set_ylabel("M_y [kNm]")
axs[0].legend()
axs[1].plot(nm_domain_all.n * 1e-3, -nm_domain_all.m_y * 1e-6, label="Complete N-M Interaction Domain",)
axs[1].set_xlabel("N [kN]")
axs[1].set_ylabel("M_y [kNm]")
axs[1].legend()
plt.show()

would produce the following picture (the full domain on the right plot is not closed).

image

After this PR the same code produces the following:

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.

1 participant