Experimental dynamics RK4 Butcher tableau typo
Created by: Matematija
Hi,
I was going through your new experimental ODE integrator code and I think I noticed a typo in one of the predefined Butcher tableaus for the RK4
solver. You have:
bt_rk4 = TableauRKExplicit(
order = (4,),
a = jnp.array([[0, 0, 0, 0],
[1/2, 0, 0, 0],
[0, 1/2, 0, 0],
[0, 0, 1, 1]], dtype=default_dtype),
b = jnp.array( [1/6, 1/3, 1/3, 1/6], dtype=default_dtype),
c = jnp.array( [0, 1/2, 1/2, 1], dtype=default_dtype),
c_error = None,
)
while I believe that the correct tableau should be
bt_rk4 = TableauRKExplicit(
order = (4,),
a = jnp.array([[0, 0, 0, 0],
[1/2, 0, 0, 0],
[0, 1/2, 0, 0],
[0, 0, 1, 0]], dtype=default_dtype),
b = jnp.array( [1/6, 1/3, 1/3, 1/6], dtype=default_dtype),
c = jnp.array( [0, 1/2, 1/2, 1], dtype=default_dtype),
c_error = None,
)
(Note the very last matrix element in the a
field should be 0, not 1, if I am reading the relevant Wikipedia page correctly.)
It should be a pretty easy thing to fix. :-)