Skip to main content
Share Your Experience: Take the 2024 Developer Survey
44 votes
Accepted

BDF vs implicit Runge Kutta time stepping

Yes, there aren't too many resources on this for some reason. For a very long time, the standard goto was "just use BDF methods". This mantra was set in stone for few historical reasons: for ...
Chris Rackauckas's user avatar
43 votes
Accepted

Which Runge-Kutta method is more accurate: Dormand-Prince or Cash-Karp?

Since I just finished optimizing a lot of them in software, DifferentialEquations.jl, I decided to just lay out a comparison of the main Order 4/5 methods. The Fehlberg method was left out because it'...
Chris Rackauckas's user avatar
21 votes
Accepted

Why are higher-order Runge–Kutta methods not used more often?

There are thousands of papers and hundreds of codes out there using Runge-Kutta methods of fifth order or higher. Note that the most commonly used explicit integrator in MATLAB is ODE45, which ...
David Ketcheson's user avatar
18 votes
Accepted

Why is RK45 used as the "default" method for non-stiff ODEs rather than a multistep one?

First, let's establish that they are a good choice. The SciMLBenchmarks are probably the most comprehensive that there are as of right now for modern methods. This uses the vast number of methods ...
Chris Rackauckas's user avatar
17 votes

Why are higher-order Runge–Kutta methods not used more often?

The Benchmark Setup In the Julia software DifferentialEquations.jl we implemented plenty of higher order methods, including the Feagin methods. You can see it in our list of methods, and then there ...
Chris Rackauckas's user avatar
15 votes
Accepted

Why is leapfrog integration symplectic and RK4 not, if the latter is more accurate?

TL;DR: It depends on what kind of accuracy you need. Energy conservation does not automatically equal accuracy. Suppose, you want to simulate the solar system, and you are using a solver that – to ...
Wrzlprmft's user avatar
  • 2,022
14 votes
Accepted

Easily understandable argument that normal Runge–Kutta methods cannot be generalised to SDEs?

Let's take a stochastic differential equation: $$ X_t = f(t,X_t)dt + g(t,X_t)dW_t $$ Here's a few different arguments which lead to intuitive understandings of why the mathematics behind the higher ...
Chris Rackauckas's user avatar
13 votes

Why are higher-order Runge–Kutta methods not used more often?

As long as you're using standard double precision floating point arithmetic, very high order methods aren't needed to get a solution with high accuracy in a reasonable number of steps. In practice I ...
Brian Borchers's user avatar
13 votes

Energy conservation in RK4 integration scheme in C++

RK4 is not symplectic so it has no guarantee of energy conservation. Especially when solving an N-body problem where two bodies pass by close to each other the energy conservation can be violated ...
helloworld922's user avatar
12 votes

Runge-Kutta in the presence of an attractor

The problem you are encountering is likely not a consequence of your choice of algorithm, but in fact a consequence of the resulting dynamical system after applying time reversal. Per the definition ...
whpowell96's user avatar
  • 2,546
10 votes

Do there exist low-storage Runge–Kutta methods with an order larger than four?

This area has been fairly well researched, you may check e.g. Ketcheson's review of such methods: https://doi.org/10.1016/j.jcp.2009.11.006 which does contain some low-storage Runge-Kutta methods ...
Reid.Atcheson's user avatar
9 votes
Accepted

4th order Runge-Kutta for $y' = y$

The answer is quite simple. You are already comparing apples and oranges in the first equation. Garbage in, garbage out. The equation $y'=y$ if written properly is $$dy/dx=y.$$ Do you see it now? To ...
Kartik's user avatar
  • 206
9 votes
Accepted

Is there any explicit symplectic Runge-Kutta method?

There are explicit, symplectic methods for certain types of Hamiltonian problems. For example, the symplectic Euler method \begin{align} p_{n+1} &= p_n - h H_q(p_{n+1}, q_n) \\ q_{n+1} &= ...
Daniel's user avatar
  • 1,273
9 votes
Accepted

Special-case Runge-Kutta methods to exploit structure in linear ODE?

There are many kinds of RK methods that have extensions to exploit linearity. They all use some form of exponential or Lie Group idea (again exponential) to do so. Thus they generally do some form of ...
Chris Rackauckas's user avatar
9 votes

What is the advantage of using a particular RK Scheme?

You're looking only at the errors themselves and not other properties of the solution. There are sometimes good cases to consider lower-order schemes because they better preserve important ...
Daniel Shapero's user avatar
8 votes
Accepted

How well do explicit Runge-Kutta "tableau" methods compare to the state of the art ODE solvers and when do they fail?

I think the confusion here is what exactly is a "tableau method" since it's used in our docs in a very specific way. A "tableau method" in DifferentialEquations.jl parlance is a method which is ...
Chris Rackauckas's user avatar
8 votes
Accepted

Is there a database/website with Butcher tableaus?

The three best sources of Butcher tableaus are, according to me, the reference books Numerical Methods for Ordinary Differential Equations, 3rd ed., J.C. Butcher, Solving Ordinary Differential ...
GertVdE's user avatar
  • 6,149
8 votes
Accepted

Motion of the particle trapped in potential

Your time step is far too large. Just looking at the first stage, you have $\dot{p}\approx10^{-12}$, so for the next stage, you will have something like $\dot{q} \approx h\dot{p}/m \approx 10^{-1}(10^{...
whpowell96's user avatar
  • 2,546
8 votes
Accepted

What is the advantage of using a particular RK Scheme?

There are lots of different properties which can be found in different time stepping schemes of the same order of accuracy: Different stability properties. While it may not appear that way with the ...
helloworld922's user avatar
7 votes

Do there exist low-storage Runge–Kutta methods with an order larger than four?

Another good starting point is the excellent paper of Kennedy, Carpenter, & Lewis (KCL2000): https://doi.org/10.1016/S0168-9274(99)00141-5 My own paper focuses more on the mechanics of low-...
David Ketcheson's user avatar
7 votes
Accepted

The Formula of Explicit Runge-Kutta Fourteen order

The 14th order methods due to Feagin can be found in DifferentialEquations.jl. An example using them with 128-bit floating point arithmetic is as follows: ...
Chris Rackauckas's user avatar
7 votes
Accepted

Solving ODEs with nonlinear constraints

As @WolfgangBangerth already commented, this is usually referred to as a differential algebraic equation (DAE). These have their own challenges and there are special numerical methods for them. In ...
David Ketcheson's user avatar
7 votes

Energy conservation in RK4 integration scheme in C++

Main error As I pointed out in the previous questions of this series RK4 integration of the three-bodies problem with C++ the primary problem is that the methods are not implemented correctly. The ...
Lutz Lehmann's user avatar
  • 6,109
7 votes
Accepted

Does this second-order implicit Runge-Kutta method have a name?

As Wolfgang stated in the comments, this is not a traditional RK due to the inconsistent time evaluations within a stage. At first it would seem it can't even be cast as an additive RK since terms ...
Steven Roberts's user avatar
6 votes

Constructing explicit Runge Kutta methods of order 9 and higher

@DavidKetcheson's answer hits the big points: you can always construct methods of high enough order using extrapolation, that's a very pessimistic bound and you can always do a whole lot better, all ...
Chris Rackauckas's user avatar
6 votes

Looking for Runge-Kutta 8th order in C/C++

summarizing some points: If it's a long-term integration of a non-dissapative model, a symplectic integrator is what you're looking for. Otherwise, since it's an equation of motion, Runge-Kutta ...
Chris Rackauckas's user avatar
6 votes
Accepted

Type of Rosenbrock method by its coefficients

A search for the specific coefficients listed led me to the method ROS3PRL from J. Sieber, Konvergenzanalyse und Numerische Tests für die Prothero–Robinson–...
Steven Roberts's user avatar
5 votes

Runge Kutta solution blows up for a first order ODE with very large coefficients

Though the following will not necessarily solve your problem, it is highly recommended to implement the ode dimensionless such that all relevant quantities are around 1 to stabilize solvers. The ...
Bort's user avatar
  • 1,285
5 votes
Accepted

Developping PDE with Python symbolically and numericaly

But how do you numerically (Runge-Kutta or whatever) solve the objects coming out of SymPy? That depends a lot on your specific problem and what level of optimization you need. Most ODE solvers (...
Wrzlprmft's user avatar
  • 2,022
5 votes
Accepted

Euler Method Instability. Why?

If we take your ODE, $$\frac{dy}{dx}=-\frac{x^2}{y},$$ multiply both sides by $y$ and integrate up, we see that the solutions look like $$ y^2 = C-\frac{2}{3} x^3. $$ Taking your initial condition, ...
origimbo's user avatar
  • 2,249

Only top scored, non community-wiki answers of a minimum length are eligible