From 6fa426b9aa94115fe4bc7c60791daa9b31879843 Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:46:07 +0100 Subject: [PATCH 1/2] Added ARK443 method --- qmat/qcoeff/butcher.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/qmat/qcoeff/butcher.py b/qmat/qcoeff/butcher.py index 1c59db3..200c563 100644 --- a/qmat/qcoeff/butcher.py +++ b/qmat/qcoeff/butcher.py @@ -855,6 +855,7 @@ class ARK222EDIRK(RK): @property def order(self): return 2 + @registerRK class ARK222ERK(ARK222EDIRK): """ @@ -865,3 +866,39 @@ class ARK222ERK(ARK222EDIRK): [ARK222EDIRK.gamma, 0 , 0], [ARK222EDIRK.delta, 1-ARK222EDIRK.delta, 0]]) b = A[-1, :] + + +@registerRK +class ARK443ESDIRK(RK): + """ + 3rd-order 4-stage ESDIRK scheme [Ascher 1997 sec 2.8] + Use as implicit part for ARK scheme in combination with ARK443ERK. + """ + + c = np.array([0, 1/2, 2/3, 1/2, 1]) + + A = np.array([[0, 0 , 0 , 0 , 0 ], + [0, 1/2, 0 , 0 , 0 ], + [0, 1/6, 1/2, 0 , 0 ], + [0, -1/2, 1/2, 1/2, 0 ], + [0, 3/2, -3/2, 1/2, 1/2]]) + + + b = A[-1, :] + + @property + def order(self): return 3 + + +@registerRK +class ARK443ERK(ARK443ESDIRK): + """ + 3rd-order 4-stage ERK scheme [Ascher 1997 sec 2.8] + Use as explicit part for ARK scheme in combination with ARK443EDIRK. + """ + A = np.array([[ 0 , 0 , 0 , 0 , 0], + [ 1/2 , 0 , 0 , 0 , 0], + [11/18, 1/18, 0 , 0 , 0], + [ 5/6 , -5/6 , 1/2, 0 , 0], + [ 1/4 , 7/4 , 3/4, -7/4, 0]]) + b = A[-1, :] From eaf0ce63fc32f1392b88e75bba0ae7c8c16e378f Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:49:41 +0100 Subject: [PATCH 2/2] Fixed typo --- qmat/qcoeff/butcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmat/qcoeff/butcher.py b/qmat/qcoeff/butcher.py index 200c563..ad43bd8 100644 --- a/qmat/qcoeff/butcher.py +++ b/qmat/qcoeff/butcher.py @@ -894,7 +894,7 @@ def order(self): return 3 class ARK443ERK(ARK443ESDIRK): """ 3rd-order 4-stage ERK scheme [Ascher 1997 sec 2.8] - Use as explicit part for ARK scheme in combination with ARK443EDIRK. + Use as explicit part for ARK scheme in combination with ARK443ESDIRK. """ A = np.array([[ 0 , 0 , 0 , 0 , 0], [ 1/2 , 0 , 0 , 0 , 0],