sympy / sympy

A computer algebra system written in pure Python

Home Page:https://sympy.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The `point_cflexure` method doesn't return points when a region of the bending moment line is 0.

mvg2002 opened this issue · comments

The point_cflexure method returns the points where the bending moment is 0 and where the curve changes it's sign. This function does not work when a region of the bending moment curve is 0. Take the following example:

import sympy as sm
from sympy.physics.continuum_mechanics.beam import Beam
E = sm.Symbol('E')
E = 200
I = sm.Symbol('I')
I = 1000
b1 = Beam(5, E, I)
b2 = Beam(10, E, I)
b = b1.join(b2, via="hinge")
b.apply_support(0, type='pin')
b.apply_support(10, type='pin')
b.apply_support(15, type='fixed')
b.apply_load(-10, 5, -1)
b.apply_load(-5, 10, 0, 15)
r0, r10, r15, m15 = sm.symbols('R_0, R_10, R_15, M_15')
b.solve_for_reaction_loads(r0, r10, r15, m15)
b.plot_bending_moment();

Currently this will return the wrong bending moment line:
image

After implementation of #26594, the bending moment line will be correct:
image

The line b.point_cflexure() will give an NotImplementedError. This happens because the solve method cannot solve the equation for bending moment = 0, when this is the case for a whole region of the beam.

In #26594 I added a NotImplementedError for this that gives more information on the problem:

Traceback (most recent call last):
  File "C:\Users\mvgmv\PycharmProjects\sympy\sympy\physics\continuum_mechanics\ILD_tryout.py", line 34, in <module>
    b.point_cflexure()
  File "C:\Users\mvgmv\PycharmProjects\sympy\sympy\physics\continuum_mechanics\beam.py", line 1222, in point_cflexure
    raise NotImplementedError("This method cannot be used when a whole region of "
NotImplementedError: This method cannot be used when a whole region of the bending moment line is equal to 0.

This problem can possibly be solved by removing the region where the bending moment line is equal to 0 from the equation.