In Hesthaven book (Nodal Discontinuous Galerkin Methods) he uses SSP Runge-Kutta time method which is explicit.
How can I change the explicit RK to an implicit one?
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It only takes a minute to sign up.Sign up to join this community
You cannot merely adjust an explicit RK scheme into an implicit one, implicit routines are much more involved because each intermediate slope can depend upon slopes 'in the future'. This introduces a (possibly nonlinear) system of equations that needs to be solved within each RK step. That is nowhere to be found in the explicit method you posted above.
If by 'adjustment' to this routine, you are willing to consider adding a solver for the resulting system of equations required by implicit RK methods, then I would say yes it's possible to adjust your routine. That being said, implicit methods are much more involved than explicit methods for this very reason, and I would caution you that it is not a small adjustment.
A good starting point would be looking at how stiff ODEs are solved. I would advise you to implement your own version of a simple implicit method to solve a test problem, and then see for yourself how the explicit method implementated by Hesthaven can be extended to be solved implicitly.
Edit: I found the textbooks by Hairer to be very helpful when I was learning about explicit and implicit RK methods:
Hairer, Solving Ordinary Differential Equations I and II
The first goes over explicit methods and the second goes over implicit ones - both contain examples to compare your own codes to.
Further, if you are want to see how I implemented a few explicit and implicit RK methods, take a look at my github project written in Fortran: github.com/cbcoutinho/generic_rk