# Verifying convergence of a stationary solution to a PDE with the Runge-Kutta method

I am numerically solving a nonlinear wave PDE using the Runge-Kutta method, and I know the solution I am looking for is constant in time, but I do not know the solution. What is a good way of verifying I converged into the right solution?

Additional information: I know this solution is the only stable solution

• It would add significant value to your question if you included the PDE in question. – Carl Christian Aug 17 '19 at 22:50

## 2 Answers

When you discretize the PDE from $$u_t = \ldots$$ you get an ODE $$\frac{du}{dt} = \ldots$$. The PDE reaches a steady state when $$\frac{du}{dt}$$ is sufficiently, small, so just solve until the right-hand side of the ODE below some tolerance.

• Surely the size of the derivative $u'$ must be measured relative to the function $u$? – Carl Christian Aug 17 '19 at 22:49
• Yes, make it based on an absolute and relative tolerance. The calculation in DifferentialEquations.jl's TerminateSteadyState can be found here. The same is used in the DynamicSS solver. – Chris Rackauckas Aug 17 '19 at 23:36
• It would improve your answer to include the relevant inequality. Be wary of the test $d>\tau$. When a floating point exception causes $d$ to be computed as not a number, then test returns false. – Carl Christian Aug 18 '19 at 8:48

If you start with a PDE of the form $$u_t = F(u), \ u(0) = u_0$$ with $$u$$ taking values in some function space, then solution to the steady state problem corresponds with solutions to $$F(u)=0.$$ In most cases, $$F$$ contains nonlinearities, differential operators, boundary conditions, etc. when discretized to form a system of ODEs for which you can use Runge-Kutta or some other integrator.

Unless you did something really bad, your solution should converge to the stable steady state solution, but here is how you can check that. If you were to just solve $$F(u)=0$$ (in the discretized setting), you would typically use Newton's method or some variant. However, this does not come with any guarantee of stability of the solution $$u^*$$. However, there is a modification of Newton's method that is guaranteed to converge only to stable solutions of the system $$u_t = F(u)$$, or $$u_t=-F(u)$$, depending on where you read it.

This method is known as pseudo-transient continuation ($$\Psi$$TC). It works similarly to the other answer in that it essentially runs a time integrator until the solution update is under some low tolerance, but this method combined this with Newton's Method to converge quadratically once you get close to the stable steady state solution.

Here are some resources:

edit: This is equivalent to a type of Rosenbrock integrator, which is used in the Julia tools mentioned in the comments of the other answer.