## Solving Beam Bending with SymPy

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
kkremitzki
Posts: 1874
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

### Solving Beam Bending with SymPy

If you've ever had to hand-draw a shear & moment diagram, you'll love this:

https://docs.sympy.org/dev/modules/phys ... blems.html
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
microelly2
Posts: 4560
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Solving Beam Bending with SymPy

+1
its worth to embed sympy. there are other nice tools too.
looo
Posts: 3113
Joined: Mon Nov 11, 2013 5:29 pm

### Re: Solving Beam Bending with SymPy

microelly2 wrote:
Fri Oct 05, 2018 9:19 am
its worth to embed sympy
No need to embed anything if freecad stays more closely to the python ecosystem...(conda, pip)
minimalistic blog: https://looooo.github.io/mini-blog/
chakkree
Posts: 288
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

### Re: Solving Beam Bending with SymPy

Wow!

SymPy-SimpleBeam.png (176.42 KiB) Viewed 709 times
Source Code. (installed SymPy before used)

Code: Select all

``````from sympy.physics.continuum_mechanics.beam import Beam
from sympy import symbols

E, I = symbols('E, I')
R1, R2 = symbols('R1, R2')
b = Beam(4, E, I)
b.bc_deflection.append((0, 0))
b.bc_deflection.append((4, 0))

b.plot_shear_force()
b.plot_bending_moment()
``````

Code: Select all

``````OS: Windows 10
Word size of OS: 64-bit
Version: 0.19.17477 (Git)
Build type: Release
Branch: master
Hash: 8806e4490606d7a1be52c831049b17d8c8d9c320
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
``````
Last edited by chakkree on Wed Jul 31, 2019 6:19 am, edited 2 times in total.
yorik
Posts: 11645
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

### Re: Solving Beam Bending with SymPy

Wow! (2)
sgrogan
Posts: 5586
Joined: Wed Oct 22, 2014 5:02 pm

### Re: Solving Beam Bending with SymPy

looo wrote:
Fri Oct 05, 2018 4:04 pm
No need to embed anything if freecad stays more closely to the python ecosystem...(conda, pip, UCRT)
Prophetic
Kunda1
Posts: 6452
Joined: Thu Jan 05, 2017 9:03 pm

### Re: Solving Beam Bending with SymPy

chakkree wrote:
Tue Jul 30, 2019 4:01 pm
Wow!
Can you share source?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chakkree
Posts: 288
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

### Re: Solving Beam Bending with SymPy

Kunda1 wrote:
Tue Jul 30, 2019 10:56 pm
Can you share source?
chakkree
Posts: 288
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

### Re: Solving Beam Bending with SymPy

Test Continuous beam with 2 spans. Uniform load all 1000.
SymPy-ContBeam2Span.png (213.56 KiB) Viewed 574 times

Source Code

Code: Select all

``````from sympy.physics.continuum_mechanics.beam import Beam
from sympy import symbols

L1 = 4.0
L2 = 3.0

E, I = symbols('E, I')
R1, R2 , R3 = symbols('R1, R2, R3')
b = Beam(L1+L2, E, I)

b.bc_deflection.append((0, 0))
b.bc_deflection.append((L1, 0))
b.bc_deflection.append((L1+L2, 0))

b.plot_shear_force()
b.plot_bending_moment()
``````

Code: Select all

``````OS: Windows 10
Word size of OS: 64-bit
Version: 0.19.17477 (Git)
Build type: Release
Branch: master
Hash: 8806e4490606d7a1be52c831049b17d8c8d9c320
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
``````
hardeeprai
Posts: 167
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

### Re: Solving Beam Bending with SymPy

chakkree wrote:
Thu Aug 01, 2019 5:53 am
Test Continuous beam with 2 spans. Uniform load all 1000
Wonderful!
--
H.S.Rai