class_docstr: A spring with its spring force as a linear function of its length.
  
  Explanation
  ===========
  
  Note that the "linear" in the name ``LinearSpring`` refers to the fact that
  the spring force is a linear function of the springs length. I.e. for a
  linear spring with stiffness ``k``, distance between its ends of ``x``, and
  an equilibrium length of ``0``, the spring force will be ``-k*x``, which is
  a linear function in ``x``. To create a spring that follows a linear, or
  straight, pathway between its two ends, a ``LinearPathway`` instance needs
  to be passed to the ``pathway`` parameter.
  
  A ``LinearSpring`` is a subclass of ``ForceActuator`` and so follows the
  same sign conventions for length, extension velocity, and the direction of
  the forces it applies to its points of attachment on bodies. The sign
  convention for the direction of forces is such that, for the case where a
  linear spring is instantiated with a ``LinearPathway`` instance as its
  pathway, they act to push the two ends of the spring away from one another.
  Because springs produces a contractile force and acts to pull the two ends
  together towards the equilibrium length when stretched, the scalar portion
  of the forces on the endpoint are negative in order to flip the sign of the
  forces on the endpoints when converted into vector quantities. The
  following diagram shows the positive force sense and the distance between
  the points::
  
     P           Q
     o<--- F --->o
     |           |
     |<--l(t)--->|
  
  Examples
  ========
  
  To construct a linear spring, an expression (or symbol) must be supplied to
  represent the stiffness (spring constant) of the spring, alongside a
  pathway specifying its line of action. Let's also create a global reference
  frame and spatially fix one of the points in it while setting the other to
  be positioned such that it can freely move in the frame's x direction
  specified by the coordinate ``q``.
  
  >>> from sympy import symbols
  >>> from sympy.physics.mechanics import (LinearPathway, LinearSpring,
  ...     Point, ReferenceFrame)
  >>> from sympy.physics.vector import dynamicsymbols
  >>> N = ReferenceFrame('N')
  >>> q = dynamicsymbols('q')
  >>> stiffness = symbols('k')
  >>> pA, pB = Point('pA'), Point('pB')
  >>> pA.set_vel(N, 0)
  >>> pB.set_pos(pA, q*N.x)
  >>> pB.pos_from(pA)
  q(t)*N.x
  >>> linear_pathway = LinearPathway(pA, pB)
  >>> spring = LinearSpring(stiffness, linear_pathway)
  >>> spring
  LinearSpring(k, LinearPathway(pA, pB))
  
  This spring will produce a force that is proportional to both its stiffness
  and the pathway's length. Note that this force is negative as SymPy's sign
  convention for actuators is that negative forces are contractile.
  
  >>> spring.force
  -k*sqrt(q(t)**2)
  
  To create a linear spring with a non-zero equilibrium length, an expression
  (or symbol) can be passed to the ``equilibrium_length`` parameter on
  construction on a ``LinearSpring`` instance. Let's create a symbol ``l``
  to denote a non-zero equilibrium length and create another linear spring.
  
  >>> l = symbols('l')
  >>> spring = LinearSpring(stiffness, linear_pathway, equilibrium_length=l)
  >>> spring
  LinearSpring(k, LinearPathway(pA, pB), equilibrium_length=l)
  
  The spring force of this new spring is again proportional to both its
  stiffness and the pathway's length. However, the spring will not produce
  any force when ``q(t)`` equals ``l``. Note that the force will become
  expansile when ``q(t)`` is less than ``l``, as expected.
  
  >>> spring.force
  -k*(-l + sqrt(q(t)**2))
  
  Parameters
  ==========
  
  stiffness : Expr
      The spring constant.
  pathway : PathwayBase
      The pathway that the actuator follows. This must be an instance of a
      concrete subclass of ``PathwayBase``, e.g. ``LinearPathway``.
  equilibrium_length : Expr, optional
      The length at which the spring is in equilibrium, i.e. it produces no
      force. The default value is 0, i.e. the spring force is a linear
      function of the pathway's length with no constant offset.
  
  See Also
  ========
  
  ForceActuator: force-producing actuator (superclass of ``LinearSpring``).
  LinearPathway: straight-line pathway between a pair of points.
code: def equilibrium_length(self, equilibrium_length):
      if hasattr(self, "_equilibrium_length"):
          msg = (
              f"Can't set attribute `equilibrium_length` to "
              f"{repr(equilibrium_length)} as it is immutable."
          )
          raise AttributeError(msg)
      self._equilibrium_length = sympify(
          equilibrium_length, strict=True
      )
  
imports: from abc import ABC, abstractmethod
  from sympy import S, sympify
  from sympy.physics.mechanics.joint import PinJoint
  from sympy.physics.mechanics.loads import Torque
  from sympy.physics.mechanics.pathway import PathwayBase
  from sympy.physics.mechanics.rigidbody import RigidBody
  from sympy.physics.vector import ReferenceFrame, Vector
label_desc: Use image node_id 7 for calling the LinearSpring obj's underlying member method code with example usage: obj.equilibrium_length(equilibrium_length) without return types