docstr: Test for mixed boundary conditions.
  
  Tests solving heat equation with the following boundary conditions:
  `u(x, t=1) = e * sin(x)`, `u_x(0, t) = e^t`, and
  `u(2 pi n + pi/2, t) = e^t`, where `n` is some integer.
  
  The exact solution `u(x, t=0) = e^t sin(x)`.
docstr_tok: ["Test","for","mixed","boundary","conditions",".","Tests","solving","heat","equation","with","the","following","boundary","conditions",":","`","u","(","x",",","t=1",")","=","e","*","sin","(","x",")","`",",","`","u_x","(","0",",","t",")","=","e^t","`",",","and","`","u","(","2","pi","n","+","pi\/2",",","t",")","=","e^t","`",",","where","`","n","`","is","some","integer",".","The","exact","solution","`","u","(","x",",","t=0",")","=","e^t","sin","(","x",")","`","."]
code: def testHeatEquation_WithMixedBoundaryConditions(self):
      """Test for mixed boundary conditions.
  
      Tests solving heat equation with the following boundary conditions:
      `u(x, t=1) = e * sin(x)`, `u_x(0, t) = e^t`, and
      `u(2 pi n + pi/2, t) = e^t`, where `n` is some integer.
  
      The exact solution `u(x, t=0) = e^t sin(x)`.
      """
  
      def final_cond_fn(x):
          return math.e * math.sin(x)
  
      def expected_result_fn(x):
          return tf.sin(x)
  
      @neumann
      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=[0],
          maximums=[10.5 * math.pi],
          sizes=[1000],
          dtype=np.float32,
      )
      self._testHeatEquation(
          grid,
          final_t=1,
          time_step=0.01,
          final_cond_fn=final_cond_fn,
          expected_result_fn=expected_result_fn,
          one_step_fn=crank_nicolson_step(),
          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 3 for calling the ParabolicEquationStepperTest obj's underlying member method code with example usage: obj.testHeatEquation_WithMixedBoundaryConditions() and returns: unknown, tf, unknown, tf