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

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

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.

  • $\begingroup$ Surely the size of the derivative $u'$ must be measured relative to the function $u$? $\endgroup$ – Carl Christian Aug 17 '19 at 22:49
  • $\begingroup$ 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. $\endgroup$ – Chris Rackauckas Aug 17 '19 at 23:36
  • $\begingroup$ 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. $\endgroup$ – 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:

Slides Paper

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.