Skip to main content
91 votes
Accepted

What does "symplectic" mean in reference to numerical integrators, and does SciPy's odeint use them?

Let me start off with corrections. No, odeint doesn't have any symplectic integrators. No, symplectic integration doesn't mean conservation of energy. What does ...
Chris Rackauckas's user avatar
22 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
21 votes
Accepted

What is the state of the art in solving stiff initial value problems?

So there is a ton to say about this, and we will actually be putting a paper out that tries to summarize it a bit, but let me narrow it down to something that can be put into a quick StackOverflow ...
Chris Rackauckas's user avatar
20 votes

What does "symplectic" mean in reference to numerical integrators, and does SciPy's odeint use them?

To complement Chris Rackauckas answer, to state some of the mathematical nonsense as well as some stuff you almost certainly know, a dynamical system is Hamiltonian if there is a description with ...
origimbo's user avatar
  • 2,269
18 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
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
16 votes

Why does the numerical solution of an ODE move away from an unstable equilibrium?

Note that $\pi/2$ is represented in double precision format in a way that is not exactly equal to $\pi/2$. It's only accurate to about 15 digits. Thus you're starting every so slightly away from the ...
Brian Borchers's user avatar
15 votes
Accepted

Why does the numerical solution of an ODE move away from an unstable equilibrium?

I think the two main points have already been made by Brian and Ertxiem: your initial value is an unstable equilibrium and the fact that your numerical computations are never really exact provides the ...
Daniel's user avatar
  • 1,273
14 votes

Options for solving ODE systems on GPUs?

DifferentialEquations.jl library is a library for a high level language (Julia) which has tools for automatically transforming the ODE system to an optimized version for parallel solution on GPUs. ...
Chris Rackauckas's user avatar
14 votes
Accepted

Are stiffness and instability equivalent?

There are non-stiff problems which are unconditionally unstable with some explicit methods, and conversely there are stiff problems which can be stable with explicit methods. Consider the oscillating ...
helloworld922'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
Accepted

Comparing Algorithmic complexity, ODE Solvers (Big O)

odeint from the SciPy library defaults to the lsoda integrator described here. However, any simple description of asymptotic ...
Chris Rackauckas's user avatar
13 votes
Accepted

Why is the central difference method dispersing my solution?

I'll write the equation short as $$\ddot x(t)+c\dot x(t)=a(t,x(t))$$ to separate the "easy" linear parts from the non-linear and forcing terms. On the first method The claimed order of the ...
Lutz Lehmann's user avatar
  • 6,159
12 votes

What is “tolerance” in ODE45 in Matlab?

And, it is my understanding that the 4 and the 5 are for the order of the global and local error, respectively. Your understanding is wrong. The local error of a Runge–Kutta method of order $n$ is ...
Wrzlprmft's user avatar
  • 2,147
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
10 votes
Accepted

Going back in time in an initial value problem

This is technically still an IVP if you do an appropriate change of variables. Given your time is between $t \in [t^*, 0]$, make a new time variable $\tau = -t$ so that $\tau \in [0, -t^*]$ and you ...
spektr's user avatar
  • 4,338
10 votes
Accepted

Time integration of first-order ODE with higher-order information

Not too surprisingly, it is referred to as a "Taylor series method." The drawback is that, in general, it may not be easy to compute the derivatives of $F$, particularly as you add more ...
Bill Greene's user avatar
  • 6,329
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
Accepted

Choice between DAE or ODE formulation for chemical systems

The trade-off is generally this: ODEs are numerically a lot of easier to solve than DAEs, in particular if the algebraic constraint is nonlinear (yours is linear). So that argues for the ODE ...
Wolfgang Bangerth's user avatar
9 votes
Accepted

Why do different ODE solvers give very different solutions to this problem?

In general, if you apply two numerical methods to the same problem and get different answers, there are four possible reasons: One or both of the implementations has a bug. This is especially likely ...
David Ketcheson's user avatar
8 votes
Accepted

ODE45: doubts about the result. Correct or not?

I ran your same code in Python ...
nicoguaro's user avatar
  • 8,622
8 votes
Accepted

Why does LSODA fail to integrate the logistic function?

When you use $r=5$, the initial condition is $$ x(-10) \approx e^{-50} \approx 1.9\times 10^{-22}. $$ This is much smaller than the machine epsilon, $2\times 10^{-16}$, and it is very likely that ...
Kirill's user avatar
  • 11.5k
8 votes

Will the numerical solving of the differential equation be wrong if I take the step too small?

Using too small of a timestep can lead to accuracy issues due to finite precision. Since you can use derivative approximations to derive time integration schemes, it is fair to look at how derivative ...
spektr's user avatar
  • 4,338
8 votes

ODE $x''(t)+\eta x'(t)+x(t)=0$ with the $\eta$ extremely small

The problem you have is what is called "stiff": it has two time scales, namely one for the oscillation (which is ${\cal O}(1)$) and one for the damping (which is ${\cal O}(\eta^{-1})$). If $\eta$ is ...
Wolfgang Bangerth'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,199
8 votes
Accepted

How do people know the classic Lorenz attractor is actually deterministically chaotic at infinite time?

If I am remembering correctly, periodic orbits are known to be dense and countable in the Lorenz attractor, but are also known to be unstable (The first return map has $|F'| >1$ everywhere). A ...
whpowell96's user avatar
  • 3,101
7 votes

ODE $x''(t)+\eta x'(t)+x(t)=0$ with the $\eta$ extremely small

Let us write the equation in state-space form \begin{equation} \frac{d}{dt}\begin{bmatrix}x_{1}(t)\\ x_{2}(t) \end{bmatrix}+\begin{bmatrix}\eta/2 & -\omega\\ \omega & \eta/2 \end{bmatrix}\...
Richard Zhang's user avatar

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