adaptive_trapzint.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:hw-1-patti102 作者: chapman-phys227-2016s 项目源码 文件源码
def test_adaptive_limits():
    """ensures that the n value given is sufficient for the curve function.
    This function has calculated n of 366 on the interval 0 to 2"""
    t = symbols('t')
    curve_func = t**2 + t + 1
    integ = integrate(curve_func, t)
    value = lambdify([t], integ)
    value = value(2)
    print value
    apt = abs(adaptive_trapzint(curve, 0, 2)[0]-value)<1E-5
    msg = "N is too small."
    assert apt, msg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号