Skip to content

Commit

Permalink
TB: added second order 2-stage additive RK method (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen authored Sep 7, 2024
1 parent 7bec9b1 commit 62aeebc
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions qmat/qcoeff/butcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ def orderEmbedded(self): return 3
def order(self): return 5


# -------------------------- Additive (IMEX) schemes --------------------------


@registerRK
class ARK548L2SAERK(RK):
"""
Expand Down Expand Up @@ -829,3 +832,36 @@ class ARK324L2SAESDIRK(ARK324L2SAERK):
A[3, 3] = 1767732205903./4055673282236.

CONV_TEST_NSTEPS = [120, 100, 80]


@registerRK
class ARK222EDIRK(RK):
"""
2nd-order 2-stage EDIRK scheme [Ascher 1997 sec 2.6]
Use as implicit part for ARK scheme in combination with ARK222ERK.
"""

gamma = (2 - np.sqrt(2)) / 2
delta = 1 - 1 / gamma / 2

c = np.array([0, gamma, 1])

A = np.array([[0, 0 , 0],
[0, gamma , 0],
[0, 1-gamma, gamma]])

b = A[-1, :]

@property
def order(self): return 2

@registerRK
class ARK222ERK(ARK222EDIRK):
"""
2nd-order 2-stage ERK scheme [Ascher 1997 sec 2.6]
Use as explicit part for ARK scheme in combination with ARK222EDIRK.
"""
A = np.array([[0, 0 , 0],
[ARK222EDIRK.gamma, 0 , 0],
[ARK222EDIRK.delta, 1-ARK222EDIRK.delta, 0]])
b = A[-1, :]

0 comments on commit 62aeebc

Please sign in to comment.