fhat. GitHub Workspace

Implicit midpoint

Structure-preserving steps for any Hamiltonian system, stiff or not.

errorO(h2)costnonlinear solve / stepsymplectic · reversible · implicit · A-stable

Also known as implicit midpoint rule

Placeholderv0.1.4Example

Use with your agent

Use the fhat method "implicit-midpoint" (https://fhat.dev/methods/implicit-midpoint/SKILL.md) for this problem. Check first whether it applies.

Placeholder (demo). Description only: there is no reference implementation or verification for this entry yet. It belongs to a demonstration set of textbook methods.

What it does

Uses the slope at the midpoint between the old and new state: yn+1=yn+h f(tn+h2,12(yn+yn+1))y_{n+1} = y_n + h\, f\big(t_n + \tfrac{h}{2}, \tfrac{1}{2}(y_n + y_{n+1})\big). Because yn+1y_{n+1} appears on both sides, each step solves a nonlinear equation (fixed-point iteration for non-stiff problems, Newton's method for stiff ones). The method is symplectic for every Hamiltonian, conserves all quadratic invariants exactly, and is A-stable.

When to use

  • Hamiltonian systems that are not separable, so explicit splitting methods such as Störmer-Verlet do not apply.
  • Problems where a quadratic invariant (angular momentum, a norm, a charge) must be conserved exactly.
  • Stiff oscillatory problems where an explicit method would need a tiny step but energy behaviour still matters.

When not to use (and what to use instead)

Situation Use instead
Separable Hamiltonian that is not stiff (you resolve the fastest motion) stormer-verlet (explicit, one force evaluation per step, no nonlinear solve)
Expensive forces stormer-verlet if the problem is not stiff; each implicit step needs several force evaluations
Stiff dissipative problem where fast modes should be damped backward-euler (L-stable); implicit midpoint does not damp them
General non-stiff ODE where accuracy matters more than structure dormand-prince-rk45

Key facts

Order 2, implicit, symplectic, time-reversible, A-stable but not L-stable. The cost per step depends on the nonlinear solver.

Sources

The methods shown are examples. More research methods are coming.