From a810d88ba4f98b20d48f824b02da6bbb9e410ef3 Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:39:45 +0200 Subject: [PATCH] TB: added ARK3(2) method (#9) * Added ARK3(2) method * Fixed typos --- qmat/qcoeff/butcher.py | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/qmat/qcoeff/butcher.py b/qmat/qcoeff/butcher.py index c1e3208..a2c3774 100644 --- a/qmat/qcoeff/butcher.py +++ b/qmat/qcoeff/butcher.py @@ -775,4 +775,57 @@ class ARK548L2SAERK2(ARK548L2SAESDIRK2): A[7, 4] = 4151782504231.0 / 36106512998704.0 A[7, 5] = 572599549169.0 / 6265429158920.0 A[7, 6] = -457874356192.0 / 11306498036315.0 - A[1, 0] = ARK548L2SAESDIRK2.c[1] \ No newline at end of file + A[1, 0] = ARK548L2SAESDIRK2.c[1] + + +@registerRK +class ARK324L2SAERK(RK): + """ + Explicit part of embedded additive Runge-Kutta pair of orders 3 and 2. See https://doi.org/10.1016/S0168-9274(02)00138-1 + """ + A = np.zeros((4, 4)) + A[1, 0] = 1767732205903./2027836641118. + A[2, 0] = 5535828885825./10492691773637. + A[2, 1] = 788022342437./10882634858940. + A[3, 0] = 6485989280629./16251701735622. + A[3, 1] = -4246266847089./9704473918619. + A[3, 2] = 10755448449292./10357097424841. + + b = np.zeros(4) + b[0] = 1471266399579./7840856788654. + b[1] = -4482444167858./7529755066697. + b[2] = 11266239266428./11593286722821. + b[3] = 1767732205903./4055673282236. + + b2 = np.zeros(4) + b2[0] = 2756255671327./12835298489170. + b2[1] = -10771552573575./22201958757719. + b2[2] = 9247589265047./10645013368117. + b2[3] = 2193209047091./5459859503100. + + c = np.zeros(4) + c[1] = 1767732205903./2027836641118. + c[2] = 3./5. + c[3] = 1. + + @property + def order(self): return 3 + + +@registerRK +class ARK324L2SAESDIRK(ARK324L2SAERK): + """ + Implicit part of embedded additive Runge-Kutta pair of orders 3 and 2. See https://doi.org/10.1016/S0168-9274(02)00138-1 + """ + A = np.zeros((4, 4), dtype=float) + A[1, 0] = 1767732205903./4055673282236. + A[1, 1] = 1767732205903./4055673282236. + A[2, 0] = 2746238789719./10658868560708. + A[2, 1] = -640167445237./6845629431997. + A[2, 2] = 1767732205903./4055673282236. + A[3, 0] = 1471266399579./7840856788654. + A[3, 1] = -4482444167858./7529755066697. + A[3, 2] = 11266239266428./11593286722821. + A[3, 3] = 1767732205903./4055673282236. + + CONV_TEST_NSTEPS = [120, 100, 80]