Skip to content

Conversation

Psycho-Pirate
Copy link
Member

References to other Issues or PRs

Brief description of what is fixed or changed

Functions to find max shear force, bending moment and deflection are added.

Other comments

Release Notes

  • physics.continuum_mechanics
    • Added ability to find maximum shear force, bending moment and deflection in Beam3D class

@sympy-bot
Copy link

sympy-bot commented Aug 21, 2021

Hi, I am the SymPy bot (v161). 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:

  • physics.continuum_mechanics
    • Added ability to find maximum shear force, bending moment and deflection in Beam3D class (#21919 by @Psycho-Pirate)

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

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->


#### Brief description of what is fixed or changed

Functions to find max shear force, bending moment and deflection are added.

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

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 -->
* physics.continuum_mechanics 
   * Added ability to find maximum shear force, bending moment and deflection in Beam3D class
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@Psycho-Pirate
Copy link
Member Author

Here is an example:

>>> from sympy.physics.continuum_mechanics.beam import Beam3D
>>> from sympy import symbols
>>> l, E, G, I, A, x = symbols('l, E, G, I, A, x')
>>> b = Beam3D(20, 40, 21, 100, 25, x)
>>> b.apply_load(15, start=0, order=0, dir="z")
>>> b.apply_load(12*x, start=0, order=0, dir="y")
>>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])]
>>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4')
>>> b.apply_load(R1, start=0, order=-1, dir="z")
>>> b.apply_load(R2, start=20, order=-1, dir="z")
>>> b.apply_load(R3, start=0, order=-1, dir="y")
>>> b.apply_load(R4, start=20, order=-1, dir="y")
>>> b.solve_for_reaction_loads(R1, R2, R3, R4)
>>> b.solve_slope_deflection()
>>> b.plot_loading_results('y')

maxex

>>> b.max_shear_force('y')
(20, 2400)
>>> b.max_bending_moment('y')
(20, 3000)
>>> b.max_deflection('y')
(10, 495/14)

@Psycho-Pirate
Copy link
Member Author

@ishanaj

@github-actions
Copy link

github-actions bot commented Aug 21, 2021

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [ed9a550f]       [b8156f36]
     <sympy-1.8^0>                 
-        909±10ms        126±0.8ms     0.14  dsolve.TimeDsolve01.time_dsolve
-      7.55±0.02s       4.07±0.02s     0.54  integrate.TimeIntegrationRisch02.time_doit(100)
-      65.3±0.6μs       26.9±0.3μs     0.41  matrices.TimeDiagonalEigenvals.time_eigenvals
-      81.5±0.9μs         53.1±1μs     0.65  matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
-      80.1±0.8μs       53.2±0.3μs     0.66  matrices.TimeMatrixGetItem.time_MutableSparseMatrix_getitem
+        79.6±3μs         130±10μs     1.64  solve.TimeMatrixArithmetic.time_dense_add(10, 5)
+      10.5±0.1μs       16.7±0.2μs     1.59  solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+      12.3±0.2μs       26.8±0.1μs     2.19  solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+      18.3±0.2μs       35.4±0.2μs     1.94  solve.TimeMatrixArithmetic.time_dense_add(4, 5)
+      34.8±0.9μs       58.4±0.2μs     1.68  solve.TimeMatrixArithmetic.time_dense_add(6, 5)
-     1.08±0.01ms          226±3μs     0.21  solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
-      42.0±0.8μs       22.3±0.3μs     0.53  solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+      64.0±0.6μs          115±2μs     1.80  solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
-      87.6±0.6μs       29.7±0.2μs     0.34  solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
-         258±3μs       63.6±0.7μs     0.25  solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
-        78.2±1μs       40.2±0.8μs     0.51  solve.TimeMatrixOperations.time_det(3, 0)
-         147±1μs       91.7±0.7μs     0.62  solve.TimeMatrixOperations.time_det(3, 2)
-         141±1μs       84.3±0.5μs     0.60  solve.TimeMatrixOperations.time_det(3, 5)
-        79.2±1μs         39.9±1μs     0.50  solve.TimeMatrixOperations.time_det_bareiss(3, 0)
-         144±2μs       93.2±0.4μs     0.65  solve.TimeMatrixOperations.time_det_bareiss(3, 2)
-         131±2μs         83.4±1μs     0.64  solve.TimeMatrixOperations.time_det_bareiss(3, 5)
-        76.4±6μs       38.3±0.5μs     0.50  solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
-         141±2μs         90.6±1μs     0.64  solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
-         137±1μs       83.8±0.4μs     0.61  solve.TimeMatrixOperations.time_det_berkowitz(3, 5)
+         652±8μs      1.07±0.01ms     1.64  solve.TimeMatrixOperations.time_det_berkowitz(4, 0)
+        785±30μs      1.57±0.02ms     2.00  solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+         832±6μs      1.67±0.01ms     2.01  solve.TimeMatrixOperations.time_det_berkowitz(4, 5)
+         239±2μs         425±20μs     1.78  solve.TimeMatrixOperations.time_rank(3, 0)
+         387±9μs          626±4μs     1.62  solve.TimeMatrixOperations.time_rank(4, 0)
+         109±2μs          172±2μs     1.59  solve.TimeMatrixOperations.time_rref(3, 0)
-      4.53±0.1ms      2.65±0.06ms     0.59  solve.TimeRationalSystem.time_linsolve(10)
+        918±50μs      1.38±0.01ms     1.50  solve.TimeSparseSystem.time_linear_eq_to_matrix(10)
+     2.73±0.06ms      4.24±0.02ms     1.55  solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
+      5.46±0.1ms      8.64±0.08ms     1.58  solve.TimeSparseSystem.time_linear_eq_to_matrix(30)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@ishanaj
Copy link
Contributor

ishanaj commented Aug 21, 2021

Please add some tests corresponding to these functions in the test file.

@Psycho-Pirate
Copy link
Member Author

I have added the tests.

@ishanaj
Copy link
Contributor

ishanaj commented Aug 23, 2021

I have reviewed max_shear_force(), but these comments apply on the other functions too.

@Psycho-Pirate
Copy link
Member Author

I have addressed all the issues you mentioned in the latest commit.

@ishanaj
Copy link
Contributor

ishanaj commented Aug 26, 2021

Looks good to me!

@Psycho-Pirate
Copy link
Member Author

Please get this merged!

@ishanaj ishanaj merged commit e93bda4 into sympy:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants