docstr: Adjust the velocity to the new position
  
  The velocity is adjusted such that the following equation holds:
  
  .. math::
  
          \mathbf{v_{i,t}} = \mathbf{x_{i,t}} - \mathbf{x_{i,t-1}}
  
  .. note::
      This method should only be used in combination with a position handling
      operation.
docstr_tok: ["Adjust","the","velocity","to","the","new","position","The","velocity","is","adjusted","such","that","the","following","equation","holds",":","..","math",":",":","\\mathbf","{","v_","{","i",",","t","}","}","=","\\mathbf","{","x_","{","i",",","t","}","}","-","\\mathbf","{","x_","{","i",",","t-1","}","}","..","note",":",":","This","method","should","only","be","used","in","combination","with","a","position","handling","operation","."]
code: def adjust(self, velocity, clamp=None, **kwargs):
      r"""Adjust the velocity to the new position
  
      The velocity is adjusted such that the following equation holds:
  
      .. math::
  
              \mathbf{v_{i,t}} = \mathbf{x_{i,t}} - \mathbf{x_{i,t-1}}
  
      .. note::
          This method should only be used in combination with a position handling
          operation.
  
      """
      try:
          if self.memory is None:
              new_vel = velocity
              self.memory = kwargs["position"]
          else:
              new_vel = kwargs["position"] - self.memory
              self.memory = kwargs["position"]
              if clamp is not None:
                  new_vel = self.__apply_clamp(new_vel, clamp)
      except KeyError:
          self.rep.logger.exception("Keyword 'position' missing")
          raise
      else:
          return new_vel
  
imports: import inspect
  import logging
  import numpy
  import math
  from copy import copy
  from ..utils.reporter import Reporter
label_desc: Use image node_id 5 for calling the VelocityHandler obj's underlying member method code with example usage: obj.adjust(velocity, clamp) and returns: new_vel