question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plastic centroid/principal axis centroid not at elastic centroid for doubly symmetric section

See original GitHub issue

Describe the bug In the following code I would expect the plastic centroid to be at the origin (0, 0) and align with the elastic centroid. Yet it is reporting the plastic centroid below the origin. Section geometry centroid is shifted to 0,0 position.

Also, the horizontal principal axis is shown correctly at y=0, but the principal plastic axis centroid is not, being drawn below y=0.

The reported results agree with the plot in so far as the plastic centroid is not at 0,0 point.

Is this possibly a bug or maybe I’m missing something obvious here?

To Reproduce Run code below and observe results

import sectionproperties.pre.sections as sections
from sectionproperties.analysis.cross_section import CrossSection

mesh_area = 25  # max mesh size

d = 612  # I section depth
b_f = 229  # I-section flange width
t_f = 19.6  # I-section flange thickness
t_w = 11.9  # I-section web thickness
r_1 = 14  # I-section root radii
n_r = 50  # number of points considered around root radii

d_p = 650  # strengthening plate depth
b_p = 12  # strengthening plate thickness

# create constituent geometry
geometry1 = sections.ISection(d=d, b=b_f, t_f=t_f, t_w=t_w, r=r_1, n_r=n_r, shift=[-b_f / 2, -d / 2])
geometry2 = sections.RectangularSection(d=d_p, b=b_p, shift=[-b_f / 2 - b_p, -d_p / 2])
geometry3 = sections.RectangularSection(d=d_p, b=b_p, shift=[b_f / 2, -d_p / 2])

# create merged section
geometry = sections.MergedSection([geometry1, geometry2, geometry3])

# add holes
geometry.add_hole([-b_f / 2, 0])
geometry.add_hole([b_f / 2, 0])

# create mesh
mesh = geometry.create_mesh(mesh_sizes=[mesh_area, mesh_area, mesh_area])

# clean geometry
geometry.clean_geometry(verbose=True)

# create section
section = CrossSection(geometry, mesh)

# calculate results
section.calculate_geometric_properties()
section.calculate_plastic_properties()
section.calculate_warping_properties()

# plot results
section.plot_mesh()
section.plot_centroids()

# display all results
# check https://sectionproperties.readthedocs.io/en/latest/rst/post.html for definitions
section.display_results(fmt='.3f')

# this will specifically display torsion and warping constants
J = section.get_j()
I_w = section.get_gamma()
print(f'J = {J}')
print(f'I_w = {I_w}')

Expected behaviour For doubly symmetric section plastic and elastic centroid should align?

Screenshots Note how principal plastic axis centroid does not align with the principal axes, and plastic centroid is shown below elastic centroid:- Figure_1

Additional context Using latest version 1.0.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Spectre5commented, Dec 21, 2020

I’ve added a PR that should add this check, but it is not nearly as clean looking as what @Agent6-6-6 posted above 😃 It does do the entire calculation vectorized in numpy though, so it should be much faster than looping in python.

0reactions
Agent6-6-6commented, Dec 21, 2020

Agree, I always find it useful to protect the user against themselves… by providing sufficient warnings when stuff matters.

If you’re already using shapely and moving that way you can check for “touching” geometry as follows:-

from shapely.geometry import Point, Polygon

a = Point([0, 0.5])
b = Polygon([(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)])
c = Point([2, 2])
print(a.touches(b))
print(c.touches(b))

Probably the easiest way to implement the intersection check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 2. Design of Beams – Flexure and Shear 2.1 Section ...
the plastic centroidal axis. • For a doubly symmetric cross-section, the elastic and the plastic centroid lie at the same point. • Mp...
Read more >
Geometric Properties of Complex Shapes - Eng-Tips
My question is twofold: 1. My only guess in attempting to solve for the plastic centroid for a non-symmetric shape about a single...
Read more >
Centroidal Axis - an overview | ScienceDirect Topics
The columns we have considered so far have had doubly symmetrical cross sections with equal second moments of area about both centroidal axes....
Read more >
I/H section (double-tee) | calcresource
This tool calculates the properties of an I/H cross-section, also known as double-tee, I-beam or I-section. Enter the shape dimensions h, b, ...
Read more >
Engineering Students Understand the Elastic Neutral Axis, but ...
Centroids represent the elastic neutral axis assuming the beam is prismatic. ... No real mention of plastic behavior is discussed with civil engineering ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found