parameters: (x, zlay=25, v1=1000, v2=3000)
return_statement: return np.minimum(tdirect, trefrac)
docstring: Analytical solution for 2 layer case.
docstring_summary: Analytical solution for 2 layer case.
docstring_tokens: Analytical solution for 2 layer case .
function: def analyticalSolution2Layer(x, zlay=25, v1=1000, v2=3000):
      """Analytical solution for 2 layer case."""
      tdirect = np.abs(x) / v1  # direct wave
      alfa = asin(v1 / v2)  # critically refracted wave angle
      xreflec = tan(alfa) * zlay * 2.  # first critically refracted
      trefrac = (x - xreflec) / v2 + xreflec * v2 / v1**2
      return np.minimum(tdirect, trefrac)
function_tokens: def analyticalSolution2Layer ( x , zlay = 25 , v1 = 1000 , v2 = 3000 ) : tdirect = np . abs ( x ) / v1 # direct wave alfa = asin ( v1 / v2 ) # critically refracted wave angle xreflec = tan ( alfa ) * zlay * 2. # first critically refracted trefrac = ( x - xreflec ) / v2 + xreflec * v2 / v1 ** 2 return np . minimum ( tdirect , trefrac )