GSoC Week 10

Hello, guys. Welcome back. It’s been ten weeks into the coding period. I had a meeting with Jason on 25th of this month. We discussed many new changed on the API that I had implemented before this week. Now, the beam bending module is almost ready to solve beam bending problems.

Let us see how to solve a beam bending problem using this module.

Problem Statement :

Loaded beam.svg

The deflection is restricted at the end of the beam.

Solution :

>>> from sympy.physics.continuum_mechanics.beam import Beam

>>> from sympy import Symbol, Piecewise
 
>>> x = Symbol('x')

>>> E = Symbol('E')

>>> I = Symbol('I')

>>> b = Beam(4, E, I)

>>> b.apply_load(value=-9, start=4, order=-1)

>>> b.apply_load(value=-3, start=0, order=-1)

>>> b.apply_load(order=0, start=2, value=6)

>>> b.bc_deflection = [(4, 0)]

>>> b.boundary_conditions
 {'deflection': [(4, 0)], 'moment': [], 'slope': []}

>>> b.load
 -3*SingularityFunction(x, 0, -1) + 6*SingularityFunction(x, 2, 0) - 9*SingularityFunction(x, 4, -1)

>>> b.shear_force()
 -3*SingularityFunction(x, 0, 0) + 6*SingularityFunction(x, 2, 1) - 9*SingularityFunction(x, 4, 0)

>>> b.bending_moment()
 3*SingularityFunction(x, 0, 1) - 3*SingularityFunction(x, 2, 2) + 9*SingularityFunction(x, 4, 1)

>>> b.slope()
 (3*SingularityFunction(x, 0, 2)/2 - SingularityFunction(x, 2, 3) + 9*SingularityFunction(x, 4, 2)/2 - 7)/(E*I)

>>> b.deflection()
 (-7*x + SingularityFunction(x, 0, 3)/2 - SingularityFunction(x, 2, 4)/4 + 3*SingularityFunction(x, 4, 3)/2)/(E*I)

If the user wants to represent the deflection in the piecewise form, then:

>>> b.deflection().rewrite(Piecewise)
 (-7*x + Piecewise((x**3, x > 0), (0, True))/2
 + 3*Piecewise(((x - 4)**3, x - 4 > 0), (0, True))/2
 - Piecewise(((x - 2)**4, x - 2 > 0), (0, True))/4)/(E*I)

 

Next week 

  • Add the end argument in the apply_load method.
  • Add Sphinx documentations.

That’s all for this week. Cheers !!

Happy Coding.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s