class_docstr: Body is a common representation of either a RigidBody or a Particle SymPy
  object depending on what is passed in during initialization. If a mass is
  passed in and central_inertia is left as None, the Particle object is
  created. Otherwise a RigidBody object will be created.
  
  Explanation
  ===========
  
  The attributes that Body possesses will be the same as a Particle instance
  or a Rigid Body instance depending on which was created. Additional
  attributes are listed below.
  
  Attributes
  ==========
  
  name : string
      The body's name
  masscenter : Point
      The point which represents the center of mass of the rigid body
  frame : ReferenceFrame
      The reference frame which the body is fixed in
  mass : Sympifyable
      The body's mass
  inertia : (Dyadic, Point)
      The body's inertia around its center of mass. This attribute is specific
      to the rigid body form of Body and is left undefined for the Particle
      form
  loads : iterable
      This list contains information on the different loads acting on the
      Body. Forces are listed as a (point, vector) tuple and torques are
      listed as (reference frame, vector) tuples.
  
  Parameters
  ==========
  
  name : String
      Defines the name of the body. It is used as the base for defining
      body specific properties.
  masscenter : Point, optional
      A point that represents the center of mass of the body or particle.
      If no point is given, a point is generated.
  mass : Sympifyable, optional
      A Sympifyable object which represents the mass of the body. If no
      mass is passed, one is generated.
  frame : ReferenceFrame, optional
      The ReferenceFrame that represents the reference frame of the body.
      If no frame is given, a frame is generated.
  central_inertia : Dyadic, optional
      Central inertia dyadic of the body. If none is passed while creating
      RigidBody, a default inertia is generated.
  
  Examples
  ========
  
  Default behaviour. This results in the creation of a RigidBody object for
  which the mass, mass center, frame and inertia attributes are given default
  values. ::
  
      >>> from sympy.physics.mechanics import Body
      >>> body = Body('name_of_body')
  
  This next example demonstrates the code required to specify all of the
  values of the Body object. Note this will also create a RigidBody version of
  the Body object. ::
  
      >>> from sympy import Symbol
      >>> from sympy.physics.mechanics import ReferenceFrame, Point, inertia
      >>> from sympy.physics.mechanics import Body
      >>> mass = Symbol('mass')
      >>> masscenter = Point('masscenter')
      >>> frame = ReferenceFrame('frame')
      >>> ixx = Symbol('ixx')
      >>> body_inertia = inertia(frame, ixx, 0, 0)
      >>> body = Body('name_of_body', masscenter, mass, frame, body_inertia)
  
  The minimal code required to create a Particle version of the Body object
  involves simply passing in a name and a mass. ::
  
      >>> from sympy import Symbol
      >>> from sympy.physics.mechanics import Body
      >>> mass = Symbol('mass')
      >>> body = Body('name_of_body', mass=mass)
  
  The Particle version of the Body object can also receive a masscenter point
  and a reference frame, just not an inertia.
docstr: Add torque to the body(s).
  
  Explanation
  ===========
  
  Applies the torque on self or equal and opposite torques on
  self and other body if both are given.
  The torque applied on other body is taken opposite of self,
  i.e, -torque.
  
  Parameters
  ==========
  
  torque: Vector
      The torque to be applied.
  reaction_body: Body, optional
      Second body on which equal and opposite torque
      is to be applied.
  
  Example
  =======
  
  >>> from sympy import symbols
  >>> from sympy.physics.mechanics import Body, dynamicsymbols
  >>> t = symbols('t')
  >>> B = Body('B')
  >>> torque1 = t*B.z
  >>> B.apply_torque(torque1)
  >>> B.loads
  [(B_frame, t*B_frame.z)]
  
  We can also remove some part of torque from the body by
  adding the opposite torque to the body.
  
  >>> t1, t2 = dynamicsymbols('t1 t2')
  >>> B.apply_torque(t1*B.x + t2*B.y)
  >>> B.loads
  [(B_frame, t1(t)*B_frame.x + t2(t)*B_frame.y + t*B_frame.z)]
  
  Let's remove t1 from Body B.
  
  >>> B.apply_torque(-t1*B.x)
  >>> B.loads
  [(B_frame, t2(t)*B_frame.y + t*B_frame.z)]
  
  To further demonstrate the use, let us consider two bodies such that
  a torque `T` is acting on one body, and `-T` on the other.
  
  >>> from sympy.physics.mechanics import Body, dynamicsymbols
  >>> N = Body('N') #Newtonion frame
  >>> B1 = Body('B1')
  >>> B2 = Body('B2')
  >>> v = dynamicsymbols('v')
  >>> T = v*N.y #Torque
  
  Now let's apply equal and opposite torque to the bodies.
  
  >>> B1.apply_torque(T, B2)
  
  We can check the loads (torques) applied to bodies now.
  
  >>> B1.loads
  [(B1_frame, v(t)*N_frame.y)]
  >>> B2.loads
  [(B2_frame, - v(t)*N_frame.y)]
  
  Notes
  =====
  
  If a new torque is applied on body which already has some torque applied on it,
  then the new torque is added to the previous torque about the body's frame.
docstr_tok: ["Add","torque","to","the","body","(","s",")",".","Explanation","===========","Applies","the","torque","on","self","or","equal","and","opposite","torques","on","self","and","other","body","if","both","are","given",".","The","torque","applied","on","other","body","is","taken","opposite","of","self",",","i.e",",","-torque",".","Parameters","==========","torque",":","Vector","The","torque","to","be","applied",".","reaction_body",":","Body",",","optional","Second","body","on","which","equal","and","opposite","torque","is","to","be","applied",".","Example","=======",">",">",">","from","sympy","import","symbols",">",">",">","from","sympy.physics.mechanics","import","Body",",","dynamicsymbols",">",">",">","t","=","symbols","(","'t","'",")",">",">",">","B","=","Body","(","'","B","'",")",">",">",">","torque1","=","t","*","B.z",">",">",">","B.apply_torque","(","torque1",")",">",">",">","B.loads","[","(","B_frame",",","t","*","B_frame.z",")","]","We","can","also","remove","some","part","of","torque","from","the","body","by","adding","the","opposite","torque","to","the","body",".",">",">",">","t1",",","t2","=","dynamicsymbols","(","'t1","t2","'",")",">",">",">","B.apply_torque","(","t1","*","B.x","+","t2","*","B.y",")",">",">",">","B.loads","[","(","B_frame",",","t1","(","t",")","*","B_frame.x","+","t2","(","t",")","*","B_frame.y","+","t","*","B_frame.z",")","]","Let","'s","remove","t1","from","Body","B",".",">",">",">","B.apply_torque","(","-t1","*","B.x",")",">",">",">","B.loads","[","(","B_frame",",","t2","(","t",")","*","B_frame.y","+","t","*","B_frame.z",")","]","To","further","demonstrate","the","use",",","let","us","consider","two","bodies","such","that","a","torque","`","T","`","is","acting","on","one","body",",","and","`","-T","`","on","the","other",".",">",">",">","from","sympy.physics.mechanics","import","Body",",","dynamicsymbols",">",">",">","N","=","Body","(","'N","'",")","#","Newtonion","frame",">",">",">","B1","=","Body","(","'B1","'",")",">",">",">","B2","=","Body","(","'B2","'",")",">",">",">","v","=","dynamicsymbols","(","'","v","'",")",">",">",">","T","=","v","*","N.y","#","Torque","Now","let","'s","apply","equal","and","opposite","torque","to","the","bodies",".",">",">",">","B1.apply_torque","(","T",",","B2",")","We","can","check","the","loads","(","torques",")","applied","to","bodies","now",".",">",">",">","B1.loads","[","(","B1_frame",",","v","(","t",")","*","N_frame.y",")","]",">",">",">","B2.loads","[","(","B2_frame",",","-","v","(","t",")","*","N_frame.y",")","]","Notes","=====","If","a","new","torque","is","applied","on","body","which","already","has","some","torque","applied","on","it",",","then","the","new","torque","is","added","to","the","previous","torque","about","the","body","'s","frame","."]
code: def apply_torque(self, torque, reaction_body=None):
      """Add torque to the body(s).
  
      Explanation
      ===========
  
      Applies the torque on self or equal and opposite torques on
      self and other body if both are given.
      The torque applied on other body is taken opposite of self,
      i.e, -torque.
  
      Parameters
      ==========
  
      torque: Vector
          The torque to be applied.
      reaction_body: Body, optional
          Second body on which equal and opposite torque
          is to be applied.
  
      Example
      =======
  
      >>> from sympy import symbols
      >>> from sympy.physics.mechanics import Body, dynamicsymbols
      >>> t = symbols('t')
      >>> B = Body('B')
      >>> torque1 = t*B.z
      >>> B.apply_torque(torque1)
      >>> B.loads
      [(B_frame, t*B_frame.z)]
  
      We can also remove some part of torque from the body by
      adding the opposite torque to the body.
  
      >>> t1, t2 = dynamicsymbols('t1 t2')
      >>> B.apply_torque(t1*B.x + t2*B.y)
      >>> B.loads
      [(B_frame, t1(t)*B_frame.x + t2(t)*B_frame.y + t*B_frame.z)]
  
      Let's remove t1 from Body B.
  
      >>> B.apply_torque(-t1*B.x)
      >>> B.loads
      [(B_frame, t2(t)*B_frame.y + t*B_frame.z)]
  
      To further demonstrate the use, let us consider two bodies such that
      a torque `T` is acting on one body, and `-T` on the other.
  
      >>> from sympy.physics.mechanics import Body, dynamicsymbols
      >>> N = Body('N') #Newtonion frame
      >>> B1 = Body('B1')
      >>> B2 = Body('B2')
      >>> v = dynamicsymbols('v')
      >>> T = v*N.y #Torque
  
      Now let's apply equal and opposite torque to the bodies.
  
      >>> B1.apply_torque(T, B2)
  
      We can check the loads (torques) applied to bodies now.
  
      >>> B1.loads
      [(B1_frame, v(t)*N_frame.y)]
      >>> B2.loads
      [(B2_frame, - v(t)*N_frame.y)]
  
      Notes
      =====
  
      If a new torque is applied on body which already has some torque applied on it,
      then the new torque is added to the previous torque about the body's frame.
  
      """
  
      if not isinstance(torque, Vector):
          raise TypeError("A Vector must be supplied to add torque.")
  
      if reaction_body is not None:
          reaction_body.apply_torque(-torque)
  
      for load in self._loads:
          if self.frame in load:
              torque += load[1]
              self._loads.remove(load)
              break
      self._loads.append((self.frame, torque))
  
imports: from sympy import Symbol
  from sympy.physics.vector import Point, Vector, ReferenceFrame, Dyadic
  from sympy.physics.mechanics import RigidBody, Particle, Inertia
  from sympy.physics.mechanics.body_base import BodyBase
label_desc: Use image node_id 12 for calling the Body obj's underlying member method code with example usage: obj.apply_torque(torque, reaction_body) without return types