def test_rk3(rk3):
""" Ensure that an RK3 time-stepping scheme is set up correctly. """
assert rk3.order == 3
# Stages of the RK scheme.
stage = Symbol('stage', integer=True)
old = IndexedBase('rkold')[stage]
new = IndexedBase('rknew')[stage]
coefficients = rk3.get_coefficients()
assert coefficients[old.base] == [Rational(1.0,4.0), Rational(3.0,20), Rational(3.0,5.0)]
assert coefficients[new.base] == [Rational(2,3), Rational(5,12), Rational(3,5)]
return
评论列表
文章目录