code: def scalar_potential_difference(field, coord_sys, point1, point2):
      """
      Returns the scalar potential difference between two points in a
      certain coordinate system, wrt a given field.
  
      If a scalar field is provided, its values at the two points are
      considered. If a conservative vector field is provided, the values
      of its scalar potential function at the two points are used.
  
      Returns (potential at point2) - (potential at point1)
  
      The position vectors of the two Points are calculated wrt the
      origin of the coordinate system provided.
  
      Parameters
      ==========
  
      field : Vector/Expr
          The field to calculate wrt
  
      coord_sys : CoordSys3D
          The coordinate system to do the calculations in
  
      point1 : Point
          The initial Point in given coordinate system
  
      position2 : Point
          The second Point in the given coordinate system
  
      Examples
      ========
  
      >>> from sympy.vector import CoordSys3D
      >>> from sympy.vector import scalar_potential_difference
      >>> R = CoordSys3D('R')
      >>> P = R.origin.locate_new('P', R.x*R.i + R.y*R.j + R.z*R.k)
      >>> vectfield = 4*R.x*R.y*R.i + 2*R.x**2*R.j
      >>> scalar_potential_difference(vectfield, R, R.origin, P)
      2*R.x**2*R.y
      >>> Q = R.origin.locate_new('O', 3*R.i + R.j + 2*R.k)
      >>> scalar_potential_difference(vectfield, R, P, Q)
      -2*R.x**2*R.y + 18
  
      """
  
      if not isinstance(coord_sys, CoordSys3D):
          raise TypeError("coord_sys must be a CoordSys3D")
      if isinstance(field, Vector):
          # Get the scalar potential function
          scalar_fn = scalar_potential(field, coord_sys)
      else:
          # Field is a scalar
          scalar_fn = field
      # Express positions in required coordinate system
      origin = coord_sys.origin
      position1 = express(
          point1.position_wrt(origin), coord_sys, variables=True
      )
      position2 = express(
          point2.position_wrt(origin), coord_sys, variables=True
      )
      # Get the two positions as substitution dicts for coordinate variables
      subs_dict1 = {}
      subs_dict2 = {}
      scalars = coord_sys.base_scalars()
      for i, x in enumerate(coord_sys.base_vectors()):
          subs_dict1[scalars[i]] = x.dot(position1)
          subs_dict2[scalars[i]] = x.dot(position2)
      return scalar_fn.subs(subs_dict2) - scalar_fn.subs(subs_dict1)
  
imports: from sympy.vector.coordsysrect import CoordSys3D
  from sympy.vector.deloperator import Del
  from sympy.vector.scalar import BaseScalar
  from sympy.vector.vector import Vector, BaseVector
  from sympy.vector.operators import gradient, curl, divergence
  from sympy.core.function import diff
  from sympy.core.singleton import S
  from sympy.integrals.integrals import integrate
  from sympy.simplify.simplify import simplify
  from sympy.core import sympify
  from sympy.vector.dyadic import Dyadic
label_desc: Use image node_id 7 for calling a global function with example usage: scalar_potential_difference(field, coord_sys, point1, point2) and returns: unknown