Connections / Joints#
Module containing joint classes to connect multiple rods together.
Description#
Available Connections/Joints
This Connection base class is for all system-to-system connections. |
|
Free or spherical joints constrains the relative movement between two nodes (chosen by the user) by applying restoring forces. |
|
The fixed joint class restricts the relative movement and rotation between two nodes and elements by applying restoring forces and torques. |
|
This hinge joint class constrains the relative movement and rotation (only one axis defined by the user) between two nodes and elements (chosen by the user) by applying restoring forces and torques. |
Compatibility#
Connection / Joints |
Rod |
Rigid Body |
|---|---|---|
ConnectionBase |
✅ |
✅ |
FreeJoint |
✅ |
❌ |
FixedJoint |
✅ |
❌ |
HingeJoint |
✅ |
❌ |
Built-in Connection / Joint#
- class elastica.joint.ConnectionBase[source]#
This Connection base class is for all system-to-system connections. Every operator for Connections must be derived from this class.
- abstract apply_forces(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply connection force to the connected objects.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object
- index_twoConnectionIndex
Index of second system for connection.
- abstract apply_torques(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply connection torques to the connected objects.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object
- index_oneConnectionIndex
Index of first system for connection
- system_twoRodType | RigidBodyType
Rod or rigid-body object
- index_twoConnectionIndex
Index of second system for connection.
- __init__(*args, **kwargs)#
- class elastica.joint.FreeJoint(k, nu)[source]#
Free or spherical joints constrains the relative movement between two nodes (chosen by the user) by applying restoring forces. For implementation details, refer to Zhang et al. Nature Communications (2019).
- Attributes:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
Notes
Alias for BallJoint and SphericalJoint
- __init__(k, nu)[source]#
- Parameters:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
- apply_forces(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint force to the connected rod objects.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object
- index_twoConnectionIndex
Index of second system for connection.
- apply_torques(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint torques to the connected objects.
In FreeJoint class, this routine simply passes.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object.
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object.
- index_twoConnectionIndex
Index of second system for connection.
- timefloat
The time of simulation.
- class elastica.joint.FixedJoint(k, nu, kt, nut=0.0, rest_rotation_matrix=None)[source]#
The fixed joint class restricts the relative movement and rotation between two nodes and elements by applying restoring forces and torques. For implementation details, refer to Zhang et al. Nature Communications (2019).
- Attributes:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
- kt: float
Rotational stiffness coefficient of the joint.
- nut: float
Rotational damping coefficient of the joint.
- rest_rotation_matrix: numpy.ndarray
2D (3, 3) array containing data with ‘float’ type. Rest 3x3 rotation matrix from system one to system two at the connected elements. Instead of aligning the directors of both systems directly, a desired rest rotational matrix labeled C_12* is enforced.
Notes
Issue #131 : Add constraint in twisting, add rest_rotation_matrix (v0.3.0)
- __init__(k, nu, kt, nut=0.0, rest_rotation_matrix=None)[source]#
- Parameters:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
- kt: float
Rotational stiffness coefficient of the joint.
- nut: float
Rotational damping coefficient of the joint.
- rest_rotation_matrix: numpy.ndarray | None
2D (3, 3) array containing data with ‘float’ type. Rest 3x3 rotation matrix from system one to system two at the connected elements. If provided, the rest rotation matrix is enforced between the two systems throughout the simulation. If not provided, rest_rotation_matrix is initialized to the identity matrix, which means that a restoring torque will be applied to align the directors of both systems directly. (default=None)
- apply_forces(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint force to the connected rod objects.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object
- index_twoConnectionIndex
Index of second system for connection.
- apply_torques(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint torques to the connected objects.
In FreeJoint class, this routine simply passes.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object.
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object.
- index_twoConnectionIndex
Index of second system for connection.
- timefloat
The time of simulation.
- class elastica.joint.HingeJoint(k, nu, kt, normal_direction)[source]#
This hinge joint class constrains the relative movement and rotation (only one axis defined by the user) between two nodes and elements (chosen by the user) by applying restoring forces and torques. For implementation details, refer to Zhang et. al. Nature Communications (2019).
- Attributes:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
- kt: float
Rotational stiffness coefficient of the joint.
- normal_direction: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Constraint rotation direction.
- __init__(k, nu, kt, normal_direction)[source]#
- Parameters:
- k: float
Stiffness coefficient of the joint.
- nu: float
Damping coefficient of the joint.
- kt: float
Rotational stiffness coefficient of the joint.
- normal_direction: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Constraint rotation direction.
- apply_forces(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint force to the connected rod objects.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object
- index_twoConnectionIndex
Index of second system for connection.
- apply_torques(system_one, index_one, system_two, index_two, time=np.float64(0.0))[source]#
Apply joint torques to the connected objects.
In FreeJoint class, this routine simply passes.
- Parameters:
- system_oneRodType | RigidBodyType
Rod or rigid-body object.
- index_oneConnectionIndex
Index of first system for connection.
- system_twoRodType | RigidBodyType
Rod or rigid-body object.
- index_twoConnectionIndex
Index of second system for connection.
- timefloat
The time of simulation.