New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of Examples and Tutorials for Beam Module. #11494

Merged
merged 12 commits into from Aug 22, 2016

Conversation

Projects
None yet
2 participants
@sampadsaha5
Contributor

sampadsaha5 commented Aug 8, 2016

At first PR #11374 should be merged. This PR is built on #11374.

@sampadsaha5

This comment has been minimized.

Show comment
Hide comment
Contributor

sampadsaha5 commented Aug 8, 2016

A Beam is a structural element that is capable of withstanding load
primarily by resisting against bending. Beams are characterized by
their second moment of area, their length and their elastic modulus.

This comment has been minimized.

@moorepants

moorepants Aug 10, 2016

Member

Be sure to mention that these are 2D beams.

@moorepants

moorepants Aug 10, 2016

Member

Be sure to mention that these are 2D beams.

@sampadsaha5 sampadsaha5 changed the title from [WIP] Documenting Examples and Tutorials for Beam Module. to Documentation of Examples and Tutorials for Beam Module. Aug 17, 2016

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
- Variable : A symbol that can be used as a variable along the length. By default,
this is set to ``Symbol(x)``.
- Boundary Conditions
- bc_moment : Boundary conditions for moment.

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

No longer there.

@moorepants

moorepants Aug 19, 2016

Member

No longer there.

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
A distributed constant load of 8 kN/m is applied downward from the starting
point till 5 meters away from the start. A clockwise moment of 50 kN.m is
applied at 5 meters away from the start of the beam. A downward point load
of 12 kN is applied at the end.

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

It'd really be nice to have some simple sketches of these beams for a visual description.

@moorepants

moorepants Aug 19, 2016

Member

It'd really be nice to have some simple sketches of these beams for a visual description.

This comment has been minimized.

@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

Yah, I also felt so while documenting example problems. But how do we add sketches in the .rst file?

@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

Yah, I also felt so while documenting example problems. But how do we add sketches in the .rst file?

This comment has been minimized.

@moorepants

moorepants Aug 20, 2016

Member

You can include a png, gif, or svg file using the image directive.

@moorepants

moorepants Aug 20, 2016

Member

You can include a png, gif, or svg file using the image directive.

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
A beam of length 9 meters is having a fixed support at the start.
A distributed constant load of 8 kN/m is applied downward from the starting
point till 5 meters away from the start. A clockwise moment of 50 kN.m is

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

kN.m > kNm or kN-m

@moorepants

moorepants Aug 19, 2016

Member

kN.m > kNm or kN-m

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
>>> b.apply_load(-12, 9, -1)
>>> b.bc_slope = [(0, 0)]
>>> b.bc_deflection = [(0, 0)]
>>> b.evaluate_reaction_forces(R1, M1)

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

I think this method name would be better as solve_for_reaction_loads or solve_reaction_loads.

@moorepants

moorepants Aug 19, 2016

Member

I think this method name would be better as solve_for_reaction_loads or solve_reaction_loads.

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
>>> b.bc_slope = [(0, 0)]
>>> b.bc_deflection = [(0, 0)]
>>> b.evaluate_reaction_forces(R1, M1)
>>> b.reaction_forces

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

This should be reaction_loads.

@moorepants

moorepants Aug 19, 2016

Member

This should be reaction_loads.

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
>>> b.apply_load(50, 5, -2)
>>> b.apply_load(-12, 9, -1)
>>> b.bc_slope = [(0, 0)]
>>> b.bc_deflection = [(0, 0)]

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

When I do:

In [30]: b.bc_deflection?
Type:        property
String form: <property object at 0x7fab4b156368>
Docstring:   <no docstring>

I don't get any kind of useful docstring. It should show me how to set this attribute properly.

@moorepants

moorepants Aug 19, 2016

Member

When I do:

In [30]: b.bc_deflection?
Type:        property
String form: <property object at 0x7fab4b156368>
Docstring:   <no docstring>

I don't get any kind of useful docstring. It should show me how to set this attribute properly.

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

I also think it'd be better to show this:

b.bc_slope.append((0, 0))

You shouldn't really be overwriting this property, only adding or removing boundary conditions.

@moorepants

moorepants Aug 19, 2016

Member

I also think it'd be better to show this:

b.bc_slope.append((0, 0))

You shouldn't really be overwriting this property, only adding or removing boundary conditions.

- 129⋅<x> + ─────── - ──── + 25⋅<x - 5> + ──────── - 2⋅<x - 9>
3 3 3
─────────────────────────────────────────────────────────────────
E⋅I

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

It'd really be nice if this worked:

In [41]: plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (0, 9))
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-41-d233ba84faab> in <module>()
----> 1 plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (0, 9))

/home/moorepants/src/sympy/sympy/plotting/plot.py in plot(*args, **kwargs)
   1289     series = []
   1290     plot_expr = check_arguments(args, 1, 1)
-> 1291     series = [LineOver1DRangeSeries(*arg, **kwargs) for arg in plot_expr]
   1292 
   1293     plots = Plot(*series, **kwargs)

/home/moorepants/src/sympy/sympy/plotting/plot.py in <listcomp>(.0)
   1289     series = []
   1290     plot_expr = check_arguments(args, 1, 1)
-> 1291     series = [LineOver1DRangeSeries(*arg, **kwargs) for arg in plot_expr]
   1292 
   1293     plots = Plot(*series, **kwargs)

/home/moorepants/src/sympy/sympy/plotting/plot.py in __init__(self, expr, var_start_end, **kwargs)
    438         self.var = sympify(var_start_end[0])
    439         self.start = float(var_start_end[1])
--> 440         self.end = float(var_start_end[2])
    441         self.nb_of_points = kwargs.get('nb_of_points', 300)
    442         self.adaptive = kwargs.get('adaptive', True)

/home/moorepants/src/sympy/sympy/core/containers.py in __getitem__(self, i)
     42             indices = i.indices(len(self))
     43             return Tuple(*[self.args[j] for j in range(*indices)])
---> 44         return self.args[i]
     45 
     46     def __len__(self):

IndexError: tuple index out of range

I'm not yet sure why it doesn't.

@moorepants

moorepants Aug 19, 2016

Member

It'd really be nice if this worked:

In [41]: plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (0, 9))
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-41-d233ba84faab> in <module>()
----> 1 plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (0, 9))

/home/moorepants/src/sympy/sympy/plotting/plot.py in plot(*args, **kwargs)
   1289     series = []
   1290     plot_expr = check_arguments(args, 1, 1)
-> 1291     series = [LineOver1DRangeSeries(*arg, **kwargs) for arg in plot_expr]
   1292 
   1293     plots = Plot(*series, **kwargs)

/home/moorepants/src/sympy/sympy/plotting/plot.py in <listcomp>(.0)
   1289     series = []
   1290     plot_expr = check_arguments(args, 1, 1)
-> 1291     series = [LineOver1DRangeSeries(*arg, **kwargs) for arg in plot_expr]
   1292 
   1293     plots = Plot(*series, **kwargs)

/home/moorepants/src/sympy/sympy/plotting/plot.py in __init__(self, expr, var_start_end, **kwargs)
    438         self.var = sympify(var_start_end[0])
    439         self.start = float(var_start_end[1])
--> 440         self.end = float(var_start_end[2])
    441         self.nb_of_points = kwargs.get('nb_of_points', 300)
    442         self.adaptive = kwargs.get('adaptive', True)

/home/moorepants/src/sympy/sympy/core/containers.py in __getitem__(self, i)
     42             indices = i.indices(len(self))
     43             return Tuple(*[self.args[j] for j in range(*indices)])
---> 44         return self.args[i]
     45 
     46     def __len__(self):

IndexError: tuple index out of range

I'm not yet sure why it doesn't.

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

This works!

plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (b.variable, 0, 9))

beam-deflection

@moorepants

moorepants Aug 19, 2016

Member

This works!

plot(b.deflection().rewrite(Piecewise).subs({E: 207E9, I: 10}), (b.variable, 0, 9))

beam-deflection

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

You don't even have to rewrite it:

plot(b.deflection().subs({E: 207E9, I: 10}), (b.variable, 0, 9))
@moorepants

moorepants Aug 19, 2016

Member

You don't even have to rewrite it:

plot(b.deflection().subs({E: 207E9, I: 10}), (b.variable, 0, 9))

This comment has been minimized.

@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

Yah. Without rewriting also it can be plotted.

@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

Yah. Without rewriting also it can be plotted.

@moorepants

This comment has been minimized.

Show comment
Hide comment
@moorepants

moorepants Aug 19, 2016

Member

Please update wrt to master.

Member

moorepants commented Aug 19, 2016

Please update wrt to master.

- 258⋅<x> + 52⋅<x> - 8⋅<x> + 50⋅<x - 5> + 8⋅<x - 5> - 12⋅<x - 9>
>>> b.shear_force()
-1 0 1 -1 1 0
- 258⋅<x> + 52⋅<x> - 8⋅<x> + 50⋅<x - 5> + 8⋅<x - 5> - 12⋅<x - 9>

This comment has been minimized.

@moorepants

moorepants Aug 19, 2016

Member

For the shear I get this plot:

plot(b.shear_force(), (b.variable, 0, b.length))

beam-shear

If I want to evaluate the function at specific values of x I get:

In [59]: b.shear_force().subs({b.variable: 0})
Out[59]: -∞

In [60]: b.shear_force().subs({b.variable: 2})
Out[60]: 36000

In [61]: b.shear_force().subs({b.variable: 5})
Out[61]: ∞

In [62]: b.shear_force().subs({b.variable: 7})
Out[62]: 12000

In [63]: b.shear_force().subs({b.variable: 9})
Out[63]: 0

Which gives odd results for the discontinuous points. It'd be nice if this gave the correct values. Why is this?

@moorepants

moorepants Aug 19, 2016

Member

For the shear I get this plot:

plot(b.shear_force(), (b.variable, 0, b.length))

beam-shear

If I want to evaluate the function at specific values of x I get:

In [59]: b.shear_force().subs({b.variable: 0})
Out[59]: -∞

In [60]: b.shear_force().subs({b.variable: 2})
Out[60]: 36000

In [61]: b.shear_force().subs({b.variable: 5})
Out[61]: ∞

In [62]: b.shear_force().subs({b.variable: 7})
Out[62]: 12000

In [63]: b.shear_force().subs({b.variable: 9})
Out[63]: 0

Which gives odd results for the discontinuous points. It'd be nice if this gave the correct values. Why is this?

This comment has been minimized.

@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

It is all due to the fact of this :

In [26]: SingularityFunction(0, 0, -1)
Out[26]: ∞

In [27]: SingularityFunction(5, 5, -1)
Out[27]: ∞
@sampadsaha5

sampadsaha5 Aug 20, 2016

Contributor

It is all due to the fact of this :

In [26]: SingularityFunction(0, 0, -1)
Out[26]: ∞

In [27]: SingularityFunction(5, 5, -1)
Out[27]: ∞
Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
@@ -0,0 +1,202 @@
===========================================================
Solving Beam Bending Problems using Discontinuity Functions

This comment has been minimized.

@moorepants

moorepants Aug 21, 2016

Member

Discontinuity > Singularity

@moorepants

moorepants Aug 21, 2016

Member

Discontinuity > Singularity

Show outdated Hide outdated doc/src/tutorial/beam_problems.rst
Let us solve some beam bending problems using this module :
**Example 1**

This comment has been minimized.

@moorepants

moorepants Aug 21, 2016

Member

Change to:

Example 1
---------
@moorepants

moorepants Aug 21, 2016

Member

Change to:

Example 1
---------
@moorepants

This comment has been minimized.

Show comment
Hide comment
@moorepants

moorepants Aug 22, 2016

Member

@sampadsaha5 Please add a note about this new package to the release notes: https://github.com/sympy/sympy/wiki/Release-Notes-for-1.1

Member

moorepants commented Aug 22, 2016

@sampadsaha5 Please add a note about this new package to the release notes: https://github.com/sympy/sympy/wiki/Release-Notes-for-1.1

@moorepants moorepants merged commit 1a1485d into sympy:master Aug 22, 2016

1 check passed

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

This comment has been minimized.

Show comment
Hide comment
@sampadsaha5

sampadsaha5 Aug 22, 2016

Contributor

Sure. Thank You @moorepants .

Contributor

sampadsaha5 commented Aug 22, 2016

Sure. Thank You @moorepants .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment