# continuum_mechanics: added `Beam_3d` class #14883

Merged
merged 11 commits into from Jul 23, 2018

## Conversation

Projects
None yet
4 participants
Contributor

### jashan498 commented Jul 9, 2018 • edited

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

`Beam_3d` can be used to find Shear force, Bending moment, Slope and Deflection in the beam.

Equations used
From the Reference, following equations are used:

• To find Shear force and Bending moment

where [N, Qy, Qz] and [Mx, My, Mz] are shear force and bending moment along x-y-z axes respectively (q and m are applied load and moment).
• To find Slope and Deflection:

where [wx, wy, wz] and x, θy, θz] are deflection and slope along three axes respectively.

As `Beam_3d` doesn't use `SingularityFunction`, I was unable to find a way to represent point load/moments (also I wasn't able to find any online resource regarding it). So for now `Beam_3d` only supports continous load applied over whole span of beam.

### jashan498 added some commits Jul 7, 2018

``` Started Beam_3d class ```
``` dd93e18 ```
``` added apply_load method ```
``` e53157f ```
``` added solver for finding slope and deflection ```
``` 2010894 ```
``` made basic structure of Beam_3d class ```
``` bb09a8d ```
``` extended solver to find def_z and slope_y ```
``` 94f431d ```
``` solve can now find def_x and slope_x too ```
``` 6aff557 ```
``` Second moment can have more than oe value along different plane ```
`Few changes in Docstring`
``` 54e470d ```

### parsoyaarihant reviewed Jul 10, 2018

 class Beam_3d(Beam): """

#### parsoyaarihant Jul 10, 2018

Contributor

I dont think you need to explain `what is beam?` here because this has already been explained in `class Beam()`.

#### jashan498 Jul 10, 2018 • edited

Author Contributor

Ok, I will change it. Btw should `Beam_3d` inherit from `Beam` class?
The only methods they both share are setter methods for `length` and `elastic_modulus`. Rest all methods are different for both of the classes.

#### parsoyaarihant Jul 12, 2018

Contributor

I actually think the `Beam` (2D beam) class should inherit from `Beam_3d` class because all 2D beams can be modelled as a 3D beam. We can discuss this possibility in the future when `Beam_3D` is complete.

For now, keep the `Beam_3d` class inherit from `Beam` class. We could potentially inherit class functions in the future.

### jashan498 added some commits Jul 10, 2018

``` added shear_force and bending_moment_methods ```
``` 2b2e928 ```
``` Added test case fro Beam_3d ```
`Few changes in the Docstring`
``` 9f08b56 ```

### jashan498 changed the title [WIP] continuum_mechanics: added `Beam_3d` classcontinuum_mechanics: added `Beam_3d` classJul 11, 2018

Contributor Author

### Abdullahjavednesar reviewed Jul 11, 2018

 eq1 = Derivative(E*I_z*Derivative(theta(x), x), x) + (integrate(-load[1], x) + C_i) + moment[2] slope_z = dsolve(Eq(eq1, 0)).args[1] #solve for constants originated from using dsolve on eq1

#### Abdullahjavednesar Jul 11, 2018

Member

Must have a whitespace after #

#### Abdullahjavednesar Jul 14, 2018

Member

You should repair all such cases.

### Abdullahjavednesar added the PR: author's turn label Jul 12, 2018

``` added whitespace at the starting of comments ```
``` 378d9fe ```

Contributor

### parsoyaarihant commented Jul 16, 2018

 Are you planning to add anything else in this PR?
Contributor Author

### jashan498 commented Jul 17, 2018 • edited

 I have implemented the relevant material from this reference but there can be need for some improvements in `Beam_3d` class, which I am struggling to do myself due to lack of relevant material online regarding 3dbeams.
``` Added NonImplemented warnings for point loads ```
``` b582043 ```

### jashan498force-pushed the jashan498:3dbeam branch from `75fa18e` to `b582043`Jul 23, 2018

Contributor Author

### jashan498 commented Jul 23, 2018

 @parsoyaarihant have a look. I made the changes we discussed.

### parsoyaarihant merged commit `b32d904` into sympy:master Jul 23, 2018 1 check passed

#### 1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

### moorepants reviewed Jul 28, 2018

 class Beam_3d(Beam):

#### moorepants Jul 28, 2018

Member

Don't use underscores in class names. This should be "Beam3D".

#### jashan498 Jul 29, 2018 • edited

Author Contributor

Oh, I don't know what I was thinking while using underscore. Changed it in #14967

### moorepants reviewed Jul 28, 2018

 variable : Symbol, optional A Symbol object that will be used as the variable along the beam while representing the load, shear, moment, slope and deflection curve. By default, it is set to ``Symbol('x')``.

#### moorepants Jul 28, 2018

Member

should have default assumptions on x

#### jashan498 Jul 30, 2018

Author Contributor

Changed it in #14967

### moorepants reviewed Jul 28, 2018

 + 12*E*I*q)/(8*E*I*(A*G*l**2 + 12*E*I)) + l*m*x**2/(4*E*I) - l*x**3*(A*G*l**2*q - 2*A*G*l*m + 12*E*I*q)/(12*E*I*(A*G*l**2 + 12*E*I)) - m*x**3/(6*E*I) + q*x**4/(24*E*I) + l*x*(A*G*l**2*q - 2*A*G*l*m + 12*E*I*q)/(2*A*G*(A*G*l**2 + 12*E*I)) - q*x**2/(2*A*G), 0]

#### moorepants Jul 28, 2018

Member

It'd be nice to see some varying examples to test this code out. I doubt that one test is sufficient.

#### jashan498 Jul 29, 2018 • edited

Author Contributor

Actually, I was unable to find more examples for test cases online. Maybe 3D beams are not very common.

#### moorepants Jul 30, 2018 • edited

Member

Here are some resources I found that may have some examples or test problems:

Member