docstr: Tests an equation with mixed terms against exact solution.
  
  Take the reference equation `v_{t} = v_{xx} + v_{yy}` and substitute
  `v(x, y, t) = u(x, 2y - x, t)`. This yields
  `u_{t} = u_{xx} + 5u_{zz} - 2u_{xz}`, where `z = 2y - x`.
  Having `u(x, z, t) = v(x, (x+z)/2, t)` where `v(x, y, t)` is the known
  solution of the reference equation, we derive the boundary conditions
  and the expected solution for `u(x, y, t)`.
docstr_tok: ["Tests","an","equation","with","mixed","terms","against","exact","solution",".","Take","the","reference","equation","`","v_","{","t","}","=","v_","{","xx","}","+","v_","{","yy","}","`","and","substitute","`","v","(","x",",","y",",","t",")","=","u","(","x",",","2y","-","x",",","t",")","`",".","This","yields","`","u_","{","t","}","=","u_","{","xx","}","+","5u_","{","zz","}","-","2u_","{","xz","}","`",",","where","`","z","=","2y","-","x","`",".","Having","`","u","(","x",",","z",",","t",")","=","v","(","x",",","(","x+z",")","\/2",",","t",")","`","where","`","v","(","x",",","y",",","t",")","`","is","the","known","solution","of","the","reference","equation",",","we","derive","the","boundary","conditions","and","the","expected","solution","for","`","u","(","x",",","y",",","t",")","`","."]
code: def testReferenceEquation_WithTransformationYieldingMixedTerm(self):
      """Tests an equation with mixed terms against exact solution.
  
      Take the reference equation `v_{t} = v_{xx} + v_{yy}` and substitute
      `v(x, y, t) = u(x, 2y - x, t)`. This yields
      `u_{t} = u_{xx} + 5u_{zz} - 2u_{xz}`, where `z = 2y - x`.
      Having `u(x, z, t) = v(x, (x+z)/2, t)` where `v(x, y, t)` is the known
      solution of the reference equation, we derive the boundary conditions
      and the expected solution for `u(x, y, t)`.
      """
      grid = grids.uniform_grid(
          minimums=[0, 0],
          maximums=[1, 1],
          sizes=[201, 251],
          dtype=tf.float32,
      )
  
      final_t = 0.1
      time_step = 0.002
  
      def second_order_coeff_fn(t, coord_grid):
          del t, coord_grid
          return [[-5, 1], [None, -1]]
  
      @dirichlet
      def boundary_lower_z(t, coord_grid):
          x = coord_grid[1]
          return _reference_pde_solution(
              x, t
          ) * _reference_pde_solution(x / 2, t)
  
      @dirichlet
      def boundary_upper_z(t, coord_grid):
          x = coord_grid[1]
          return _reference_pde_solution(
              x, t
          ) * _reference_pde_solution((x + 1) / 2, t)
  
      z_mesh, x_mesh = tf.meshgrid(grid[0], grid[1], indexing="ij")
      initial = _reference_pde_initial_cond(
          x_mesh
      ) * _reference_pde_initial_cond((x_mesh + z_mesh) / 2)
      expected = _reference_pde_solution(
          x_mesh, final_t
      ) * _reference_pde_solution((x_mesh + z_mesh) / 2, final_t)
  
      actual = fd_solvers.solve_forward(
          start_time=0,
          end_time=final_t,
          coord_grid=grid,
          values_grid=initial,
          time_step=time_step,
          second_order_coeff_fn=second_order_coeff_fn,
          boundary_conditions=[
              (boundary_lower_z, boundary_upper_z),
              (_zero_boundary, _zero_boundary),
          ],
      )[0]
  
      self.assertAllClose(expected, actual, atol=1e-3, rtol=1e-3)
  
imports: 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 22 for calling the MultidimParabolicEquationStepperTest obj's underlying member method code with example usage: obj.testReferenceEquation_WithTransformationYieldingMixedTerm() and returns: list, unknown, unknown