def test_solve_variable_trajectory():
 (t0, k0, tol) = (0, np.array([5.0]), 0.001)
 results = _compute_variable_length_solns(model, t0, k0, g=_termination_condition, tol=tol)
 for (integrator, numeric_solution) in results.items():
  ti = numeric_solution[:, 0]
  analytic_solution = solow_analytic_solution(ti, k0, *valid_params)
  np.testing.assert_allclose(numeric_solution, analytic_solution)
  diff = (numeric_solution[((-1), 1)] - solow_steady_state(*valid_params))
  nose.tools.assert_less_equal(diff, tol)

def test_solve_variable_trajectory ( ) : ( t0 , k0 , tol ) = ( 0 , np . array ( [ 5.0 ] ) , 0.001 ) results = _compute_variable_length_solns ( model , t0 , k0 , g = _termination_condition , tol = tol ) for ( integrator , numeric_solution ) in results . items ( ) : ti = numeric_solution [ : , 0 ] analytic_solution = solow_analytic_solution ( ti , k0 , * valid_params ) np . testing . assert_allclose ( numeric_solution , analytic_solution ) diff = ( numeric_solution [ ( ( - 1 ) , 1 ) ] - solow_steady_state ( * valid_params ) ) nose . tools . assert_less_equal ( diff , tol )
testing computation of variable length solution trajectory .