74 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 ...
user avatar
41 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 ...
user avatar
19 votes
Accepted

Why are Runge-Kutta and Euler's method so different?

First thing, you could have mentioned, what RK method you have used. Here is a brief introduction to RK methods and Euler method, working, there merits and demerits. Euler method Euler's method is ...
user avatar
17 votes
Accepted

Is it well known that some optimization problems are equivalent to time-stepping?

As Jed Brown mentioned, the connection between gradient descent in nonlinear optimization and time stepping of dynamical systems is rediscovered with some frequency (understandably, since it's a very ...
user avatar
17 votes
Accepted

How to formulate lumped mass matrix in FEM

I do not think that there is a definite answer to this, because it might change from one topic to other (and also depends on the type of elements you are using). There are some recent papers talking ...
user avatar
  • 7,902
17 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 ...
user avatar
  • 2,189
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 ...
user avatar
  • 1,784
13 votes
Accepted

Non-conservative implementation implicit Euler

This might seem extreme, but this can be analysed exactly. Take the system $$ \dot x_1 = x_2, \qquad \dot x_2=-x_1, \qquad x_1(0) = 1, \qquad x_2(0)=0. $$ Let $X=(x_1,x_2)$ be the state vector, $\...
user avatar
  • 11.4k
13 votes

Is it well known that some optimization problems are equivalent to time-stepping?

While I haven't seen the exact formulation that you have written down here, I keep seeing talks in which people "rediscover" a connection to integrating some transient system, and proceed to write ...
user avatar
  • 25.2k
11 votes

Why do planets move at the wrong speed in my solar system model?

This is expected behavior with the Verlet algorithm. It is a symplectic integrator, which means that it will preserve quadratic invariants to within roundoff error -- thus the form planetary orbits ...
user avatar
10 votes
Accepted

Which numerical methods preserve time reversal symmetry?

What one usually wants in this situation is to preserve a discrete analog of time symmetry: namely, if the time discretization is applied to solve first forward and then backward in time, the initial ...
user avatar
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 ...
user avatar
9 votes

Test of 3rd-order vs 4th-order symplectic integrator with strange result

Following Kirill's suggestion, I ran the test with $N$ from a list of roughly geometrically increasing values, and for each $N$ computed the error as $$\epsilon(N) = \|\tilde z(2\pi) - \tilde z(0)\|_2 ...
user avatar
  • 393
8 votes

Why are Runge-Kutta and Euler's method so different?

The Euler method does not take into account the curvature of the solution, so it tends to give different results depending on the step size. RK, depending on the order, takes into account the ...
user avatar
  • 233
8 votes
Accepted

Computational time not proportional to integration interval in ODE-solver?

Substantially edited, since the original poster changed his equation... In general, the MATLAB (and Octave) ODE solvers dynamically adjust the step size as needed to maintain an accurate solution. ...
user avatar
7 votes
Accepted

Numerical integration of non-uniform acceleration samples

I think it may be more useful to think of this is as numerical integration of a series of data points rather than as the solution of an ODE. Adams-Bashforth could work as suggested by @Omnomnomnom, ...
user avatar
7 votes
Accepted

Newton iteration applied to nonlinear PDE

It's a bit easier to see if you write your equation in the a semi-discretised system of the form $u^{\prime}(t) = F(u(t))$ and with the application of the $\theta$-method and approximating $u^{\prime}(...
user avatar
  • 5,249
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-...
user avatar
6 votes

Dual time stepping for fluid dynamics

I believe you're switching around the definitions of "inner" and "outer" stepping (this nomenclature gets worse in segregated schemes where you have at least 3 separate iterative schemes going on.) ...
user avatar
  • 2,203
6 votes
Accepted

How does the L-stability or A-stability of a scheme relate to its ability to preserve a quadratic invariant?

In a certain sense, @Geoff Oxberry is correct in saying that stability and preservation of quadratic invariants are not directly related. For instance, there exist explicit methods that will preserve ...
user avatar
6 votes

Space-time finite element discretization for time-dependent PDEs

Full space-time discretization of time-dependent partial differential equations is indeed a thing. If you use a structured mesh in time (in the sense that the time discretization does not depend on ...
user avatar
6 votes
Accepted

Solve an ODE with positivity-preserving property unconditionally

The two properties are usually called positivity-preserving and monotonicity-preserving (makes it easier to find this question). Looking at http://www.ams.org/journals/mcom/2006-75-254/S0025-5718-05-...
user avatar
  • 11.4k
6 votes
Accepted

The velocity Verlet method and variable time steps

The second formula is just the velocity verlet, and it's correct but if you adapt time steps then it's not symplectic. In a separate answer I describe in quite detail that symplecticness is a global ...
user avatar
5 votes

Initial Value Problem using Finite Element

There are several equivalent ways of implementing Dirichlet boundary conditions with the finite element method. I'll give a brief overview, but you'll probably need more details, which can be found in ...
user avatar
5 votes

How does the L-stability or A-stability of a scheme relate to its ability to preserve a quadratic invariant?

Stability and preservation of invariants are unrelated. Hairer does a nice job of proving how various methods preserve different kinds of invariants in his book Geometric Integration. Chapter III is ...
user avatar
5 votes
Accepted

RATTLE numerical integrator example

The following snippet of code is an implementation of RATTLE on a system with the constraint $g(x, y) = K x^2 + y^2 - 1 = 0$. ...
user avatar
5 votes

Why are Runge-Kutta and Euler's method so different?

Forgive me for adding a me-too answer, but I just couldn't resist including this page from Press, et al: "Numerical Recipes in C":
user avatar
5 votes
Accepted

Fourth order IMEX Runge-Kutta method

I think the work of Kennedy and Carpenter (mentioned already by @GoHokies) is still the definitive study on this topic. The journal paper can be found here; for some reason Google Scholar only ...
user avatar
5 votes

Comparison of velocity Verlet and leapfrog algorithms

The shortest answer is that the Verlet / Leapfrog methods are symplectic and time reversible, and these are desirable numerical properties that reflect the physical reality of certain simulation ...
user avatar
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 (...
user avatar
  • 1,784

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