docstr: Test solving heat equation with various time marching schemes.
  
  Tests solving heat equation with the boundary conditions
  `u(x, t=1) = e * sin(x)`, `u(-2 pi n - pi / 2, t) = -e^t`, and
  `u(2 pi n + pi / 2, t) = -e^t` with some integer `n` for `u(x, t=0)`.
  
  The exact solution is `u(x, t=0) = sin(x)`.
  
  All time marching schemes should yield reasonable results given small enough
  time steps. First-order accurate schemes (explicit, implicit, weighted with
  theta != 0.5) require smaller time step than second-order accurate ones
  (Crank-Nicolson, Extrapolation).
  
  Args:
    one_step_fn: one_step_fn representing a time marching scheme to use.
    time_step: time step for given scheme.
docstr_tok: ["Test","solving","heat","equation","with","various","time","marching","schemes",".","Tests","solving","heat","equation","with","the","boundary","conditions","`","u","(","x",",","t=1",")","=","e","*","sin","(","x",")","`",",","`","u","(","-2","pi","n","-","pi","\/","2",",","t",")","=","-e^t","`",",","and","`","u","(","2","pi","n","+","pi","\/","2",",","t",")","=","-e^t","`","with","some","integer","`","n","`","for","`","u","(","x",",","t=0",")","`",".","The","exact","solution","is","`","u","(","x",",","t=0",")","=","sin","(","x",")","`",".","All","time","marching","schemes","should","yield","reasonable","results","given","small","enough","time","steps",".","First-order","accurate","schemes","(","explicit",",","implicit",",","weighted","with","theta","!","=","0.5",")","require","smaller","time","step","than","second-order","accurate","ones","(","Crank-Nicolson",",","Extrapolation",")",".","Args",":","one_step_fn",":","one_step_fn","representing","a","time","marching","scheme","to","use",".","time_step",":","time","step","for","given","scheme","."]
code: def testHeatEquationWithVariousSchemes(self, one_step_fn, time_step):
      """Test solving heat equation with various time marching schemes.
  
      Tests solving heat equation with the boundary conditions
      `u(x, t=1) = e * sin(x)`, `u(-2 pi n - pi / 2, t) = -e^t`, and
      `u(2 pi n + pi / 2, t) = -e^t` with some integer `n` for `u(x, t=0)`.
  
      The exact solution is `u(x, t=0) = sin(x)`.
  
      All time marching schemes should yield reasonable results given small enough
      time steps. First-order accurate schemes (explicit, implicit, weighted with
      theta != 0.5) require smaller time step than second-order accurate ones
      (Crank-Nicolson, Extrapolation).
  
      Args:
        one_step_fn: one_step_fn representing a time marching scheme to use.
        time_step: time step for given scheme.
      """
  
      def final_cond_fn(x):
          return math.e * math.sin(x)
  
      def expected_result_fn(x):
          return tf.sin(x)
  
      @dirichlet
      def lower_boundary_fn(t, x):
          del x
          return -tf.math.exp(t)
  
      @dirichlet
      def upper_boundary_fn(t, x):
          del x
          return tf.math.exp(t)
  
      grid = grids.uniform_grid(
          minimums=[-10.5 * math.pi],
          maximums=[10.5 * math.pi],
          sizes=[1000],
          dtype=np.float32,
      )
      self._testHeatEquation(
          grid=grid,
          final_t=1,
          time_step=time_step,
          final_cond_fn=final_cond_fn,
          expected_result_fn=expected_result_fn,
          one_step_fn=one_step_fn,
          lower_boundary_fn=lower_boundary_fn,
          upper_boundary_fn=upper_boundary_fn,
          error_tolerance=1e-3,
      )
  
imports: import math
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling the ParabolicEquationStepperTest obj's underlying member method code with example usage: obj.testHeatEquationWithVariousSchemes(one_step_fn, time_step) and returns: unknown, tf, unknown, tf