Share Your Experience: Take the 2024 Developer Survey

# Tag Info

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 ...
• 12.3k
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'...
• 12.3k
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 ...
• 16.5k
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 ...
• 12.3k

### 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 ...
• 12.3k
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 ...
• 2,022
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 ...
• 12.3k

### 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 ...
• 18.8k

### 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 ...
• 2,794

### 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 ...
• 2,546

### 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 ...
• 3,283
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 ...
• 206
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} &= ...
• 1,273
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 ...
• 12.3k

### 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 ...
• 10.3k
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 ...
• 12.3k
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 ...
• 6,149
Accepted

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^{... • 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 ... • 2,794 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-... • 16.5k 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: ... • 12.3k 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 ... • 16.5k 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 ... • 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 ... • 1,114 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 ... • 12.3k 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 ... • 12.3k 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–... • 1,114 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 ... • 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 (... • 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, ...
• 2,249

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