Cable (Docstrings)

Cable

This module can be used to solve problems related to 2D Cables.

class sympy.physics.continuum_mechanics.cable.Cable(support_1, support_2)[source]

Cables are structures in engineering that support the applied transverse loads through the tensile resistance developed in its members.

Cables are widely used in suspension bridges, tension leg offshore platforms, transmission lines, and find use in several other engineering applications.

Examples

A cable is supported at (0, 10) and (10, 10). Two point loads acting vertically downwards act on the cable, one with magnitude 3 kN and acting 2 meters from the left support and 3 meters below it, while the other with magnitude 2 kN is 6 meters from the left support and 6 meters below it.

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.apply_load(-1, ('P', 2, 7, 3, 270))
>>> c.apply_load(-1, ('Q', 6, 4, 2, 270))
>>> c.loads
{'distributed': {}, 'point_load': {'P': [3, 270], 'Q': [2, 270]}}
>>> c.loads_position
{'P': [2, 7], 'Q': [6, 4]}
apply_length(length)[source]

This method specifies the length of the cable

Parameters:

length : Sympifyable

The length of the cable

Examples

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.apply_length(20)
>>> c.length
20
apply_load(order, load)[source]

This method adds load to the cable.

Parameters:

order : Integer

The order of the applied load.

  • For point loads, order = -1

  • For distributed load, order = 0

load : tuple

  • For point loads, load is of the form (label, x, y, magnitude, direction), where:

labelString or symbol

The label of the load

xSympifyable

The x coordinate of the position of the load

ySympifyable

The y coordinate of the position of the load

magnitudeSympifyable

The magnitude of the load. It must always be positive

directionSympifyable

The angle, in degrees, that the load vector makes with the horizontal in the counter-clockwise direction. It takes the values 0 to 360, inclusive.

  • For uniformly distributed load, load is of the form (label, magnitude)

labelString or symbol

The label of the load

magnitudeSympifyable

The magnitude of the load. It must always be positive

Examples

For a point load of magnitude 12 units inclined at 30 degrees with the horizontal:

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.apply_load(-1, ('Z', 5, 5, 12, 30))
>>> c.loads
{'distributed': {}, 'point_load': {'Z': [12, 30]}}
>>> c.loads_position
{'Z': [5, 5]}

For a uniformly distributed load of magnitude 9 units:

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.apply_load(0, ('X', 9))
>>> c.loads
{'distributed': {'X': 9}, 'point_load': {}}
change_support(label, new_support)[source]

This method changes the mentioned support with a new support.

Parameters:

label: String or symbol

The label of the support to be changed

new_support: Tuple of the form (new_label, x, y)

new_label: String or symbol

The label of the new support

x: Sympifyable

The x-coordinate of the position of the new support.

y: Sympifyable

The y-coordinate of the position of the new support.

Examples

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.supports
{'A': [0, 10], 'B': [10, 10]}
>>> c.change_support('B', ('C', 5, 6))
>>> c.supports
{'A': [0, 10], 'C': [5, 6]}
draw()[source]

This method is used to obtain a plot for the specified cable with its supports, shape and loads.

Examples

For point loads,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(("A", 0, 10), ("B", 10, 10))
>>> c.apply_load(-1, ('Z', 2, 7.26, 3, 270))
>>> c.apply_load(-1, ('X', 4, 6, 8, 270))
>>> c.solve()
>>> p = c.draw()
>>> p  
Plot object containing:
[0]: cartesian line: Piecewise((10 - 1.37*x, x <= 2), (8.52 - 0.63*x, x <= 4), (2*x/3 + 10/3, x <= 10)) for x over (0.0, 10.0)
...
>>> p.show()

For uniformly distributed loads,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c=Cable(("A", 0, 40),("B", 100, 20))
>>> c.apply_load(0, ("X", 850))
>>> c.solve(58.58)
>>> p = c.draw()
>>> p 
Plot object containing:
[0]: cartesian line: 39.9955291375291*(0.0170706725844998*x - 1)**2 + 0.00447086247086247 for x over (0.0, 100.0)
[1]: cartesian line: -7.49552913752915 for x over (0.0, 100.0)
...
>>> p.show()
property left_support

Returns the position of the left support.

property length

Returns the length of the cable.

property loads

Returns the magnitude and direction of the loads acting on the cable.

property loads_position

Returns the position of the point loads acting on the cable.

plot_tension()[source]

Returns the diagram/plot of the tension generated in the cable at various points.

Examples

For point loads,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(("A", 0, 10), ("B", 10, 10))
>>> c.apply_load(-1, ('Z', 2, 7.26, 3, 270))
>>> c.apply_load(-1, ('X', 4, 6, 8, 270))
>>> c.solve()
>>> p = c.plot_tension()
>>> p
Plot object containing:
[0]: cartesian line: Piecewise((8.91403453669861, x <= 2), (4.79150773600774, x <= 4), (19*sqrt(13)/10, x <= 10)) for x over (0.0, 10.0)
>>> p.show()

For uniformly distributed loads,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c=Cable(("A", 0, 40),("B", 100, 20))
>>> c.apply_load(0, ("X", 850))
>>> c.solve(58.58)
>>> p = c.plot_tension()
>>> p
Plot object containing:
[0]: cartesian line: 36465.0*sqrt(0.00054335718671383*X**2 + 1) for X over (0.0, 100.0)
>>> p.show()
property reaction_loads

Returns the reaction forces at the supports, which are initialized to 0.

remove_loads(*args)[source]

This methods removes the specified loads.

Parameters:

This input takes multiple label(s) as input

label(s): String or symbol

The label(s) of the loads to be removed.

Examples

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(('A', 0, 10), ('B', 10, 10))
>>> c.apply_load(-1, ('Z', 5, 5, 12, 30))
>>> c.loads
{'distributed': {}, 'point_load': {'Z': [12, 30]}}
>>> c.remove_loads('Z')
>>> c.loads
{'distributed': {}, 'point_load': {}}
property right_support

Returns the position of the right support.

solve(*args)[source]

This method solves for the reaction forces at the supports, the tension developed in the cable, and updates the length of the cable.

Parameters:

This method requires no input when solving for point loads

For distributed load, the x and y coordinates of the lowest point of the cable are

required as

x: Sympifyable

The x coordinate of the lowest point

y: Sympifyable

The y coordinate of the lowest point

Examples

For point loads,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c = Cable(("A", 0, 10), ("B", 10, 10))
>>> c.apply_load(-1, ('Z', 2, 7.26, 3, 270))
>>> c.apply_load(-1, ('X', 4, 6, 8, 270))
>>> c.solve()
>>> c.tension
{A_Z: 8.91403453669861, X_B: 19*sqrt(13)/10, Z_X: 4.79150773600774}
>>> c.reaction_loads
{R_A_x: -5.25547445255474, R_A_y: 7.2, R_B_x: 5.25547445255474, R_B_y: 3.8}
>>> c.length
5.7560958484519 + 2*sqrt(13)

For distributed load,

>>> from sympy.physics.continuum_mechanics.cable import Cable
>>> c=Cable(("A", 0, 40),("B", 100, 20))
>>> c.apply_load(0, ("X", 850))
>>> c.solve(58.58)
>>> c.tension
{'distributed': 36465.0*sqrt(0.00054335718671383*X**2 + 1)}
>>> c.tension_at(0)
61717.4130533677
>>> c.reaction_loads
{R_A_x: 36465.0, R_A_y: -49793.0, R_B_x: 44399.9537590861, R_B_y: 42868.2071025955}
property supports

Returns the supports of the cable along with their positions.

property tension

Returns the tension developed in the cable due to the loads applied.

tension_at(x)[source]

Returns the tension at a given value of x developed due to distributed load.