def get_ltes_from_data(maints, mainys, lte_est): ltes = [] for ts, ys in zip(utils.partial_lists(maints, 6), utils.partial_lists(mainys, 6)): this_lte = lte_est(ts, ys) ltes.append(this_lte) return ltes
def check_dydt_calcs(dydt_calculator, order, dt, dydt_exact, y_exact): """Check that derivative approximations are roughly as accurate as expected for a few functions. """ ts = sp.arange(0, 0.5, dt) exact_ys = map(y_exact, ts) exact_dys = map(dydt_exact, ts, exact_ys) est_dys = map(dydt_calculator, utils.partial_lists(ts, 5), utils.partial_lists(exact_ys, 5)) utils.assert_list_almost_equal(est_dys, exact_dys[4:], 10*(dt**order))
def check_dydt_calcs(dydt_calculator, order, dt, dydt_exact, y_exact): """Check that derivative approximations are roughly as accurate as expected for a few functions. """ ts = sp.arange(0, 0.5, dt) exact_ys = map(y_exact, ts) exact_dys = map(dydt_exact, ts, exact_ys) est_dys = map(dydt_calculator, utils.partial_lists(ts, 5), utils.partial_lists(exact_ys, 5)) utils.assert_list_almost_equal(est_dys, exact_dys[4:], 10 * (dt**order))