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

Added functionality to determine polar modulus and section modulus of a polygon #17153

Open
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@ishanaj
Copy link
Contributor

commented Jul 5, 2019

Polar modulus and section modulus are properties of a polygon (more specifically a cross-section).

With beam module now accepting the cross-section (geometry object) as an alternative to the second_moment, this functionality would be of importance to the beam module, as it will be able to calculate the bending stresses and shear stresses on a beam with a particular cross-section
This is in addition to previously implemented second_moment_of_area(). Also it takes a parameter point similar to that in the second_moment_of_area()

ToDo's:

  • Tests
  • Documentation
  • Implementing the same for Ellipses class

Release Notes

  • geometry
    • added methods in the polygon class to calculate section modulus and polar modulus of a two-dimensional polygon
@sympy-bot

This comment has been minimized.

Copy link

commented Jul 5, 2019

Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • geometry
    • added methods in the polygon class to calculate section modulus and polar modulus of a two-dimensional polygon (#17153 by @ishanaj)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

[Polar modulus](https://en.wikipedia.org/wiki/Polar_moment_of_inertia) and [section modulus](https://en.wikipedia.org/wiki/Section_modulus) are properties of a polygon (more specifically a cross-section).

With `beam` module now accepting the cross-section (geometry object) as an alternative to the `second_moment`, this functionality would be of importance to the `beam` module, as it will be able to calculate the bending stresses and shear stresses on a beam with a particular cross-section
This is in addition to previously implemented `second_moment_of_area()`. Also it takes a parameter `point` similar to that in the `second_moment_of_area()`

ToDo's:
- [x] Tests
- [x] Documentation
- [ ] Implementing the same for Ellipses class

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
- geometry
    - added methods in the polygon class to calculate section modulus and polar modulus of a two-dimensional polygon
<!-- END RELEASE NOTES -->

@codecov

This comment has been minimized.

Copy link

commented Jul 5, 2019

Codecov Report

Merging #17153 into master will decrease coverage by 15.529%.
The diff coverage is 100%.

@@              Coverage Diff              @@
##            master    #17153       +/-   ##
=============================================
- Coverage   66.589%   51.059%   -15.53%     
=============================================
  Files          623       623               
  Lines       161382    161560      +178     
  Branches     37876     37911       +35     
=============================================
- Hits        107463     82492    -24971     
- Misses       48609     72829    +24220     
- Partials      5310      6239      +929
@smichr

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

👓 I did not notice the ability to make a draft PR before...good idea.

Show resolved Hide resolved sympy/geometry/polygon.py Outdated

ishanaj added some commits Jul 5, 2019

@ishanaj ishanaj marked this pull request as ready for review Jul 6, 2019

>>> rectangle = Polygon((0, 0), (a, 0), (a, b), (0, b))
>>> rectangle.section_modulus()
(a*b**2/6, a**2*b/6)
>>> rectangle.section_modulus(Point(a/4, b/4))

This comment has been minimized.

Copy link
@jashan498

jashan498 Jul 6, 2019

Contributor

Shouldn't we return a ValueError if the Point lies outside of the Polygon?

>>> rectangle = Polygon((0, 0), (a, 0), (a, b), (0, b))
>>> rectangle.section_modulus(Point(10*a, 10*b))
(a*b**2/114, a**2*b/114)

This comment has been minimized.

Copy link
@ishanaj

ishanaj Jul 6, 2019

Author Contributor

But I guess then it won't be able to handle arbitrary points like:
rectangle.section_modulus(Point(x, y))
I have added such an example in the tests.

@ishanaj

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2019

"""
x_c, y_c = self.centroid.x, self.centroid.y
if point is None:
# taking x and y as maximum distances from centroid

This comment has been minimized.

Copy link
@oscarbenjamin

oscarbenjamin Jul 13, 2019

Contributor

Is it useful to have this default?

@oscarbenjamin

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

I'm not familiar with these concepts but it looks like e.g. the section modulus is defined relative to the neutral axis rather than to a particular point. Maybe it makes more sense to pass the argument as a line rather than a point...

Also is the intention to add these features to Ellipse etc as well?

@ishanaj

This comment has been minimized.

Copy link
Contributor Author

commented Jul 14, 2019

I think if we accept a line instead of a point we might have to check it whether it is parallel to the centroidal axis.
Also then we might need to accept two lines for calculating it about x and y axis.
But if we take a point, we simply assume two perpendicular lines passing through it and parallel to the centroidal axis, and can calculate the section modulus about both x and y axis.

I guess this is also the reason why even second_moment_of area() takes a point as a parameter.
(And of course I have taken the idea from it).

Yes, if this is ok we can add similar function to Ellipses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.