0
$\begingroup$

Which of ode23, 45, 15s, 15i in matlab are dissipative or anti-dissipative for conservative ODEs?

Do they STAY dissipative or anti-dissipative for ALL conservative ODEs nor not? If not, what about for a simple harmonic oscillator?

$\endgroup$
4
  • 3
    $\begingroup$ To get a correct answer, you need to say more about the kind of functional you want to conserve. Most importantly, is is a linear, quadratic, or other type of function of the dependent variable(s)? $\endgroup$ Feb 11 at 7:33
  • 2
    $\begingroup$ Closely related: scicomp.stackexchange.com/questions/37326/… $\endgroup$ Feb 11 at 7:35
  • $\begingroup$ what about for a simple harmonic oscillator $\endgroup$
    – feynman
    Feb 12 at 2:58
  • $\begingroup$ Please edit your question; don't use the comment section for changes to the question. $\endgroup$ Feb 12 at 4:49

1 Answer 1

2
$\begingroup$

None of those ODE solvers are conservative*. For a conservative integrator you typically need a symplectic integrator. There are implementations of various symplectic integrators on Matlab file exchange. I have not tried these personally, though they do claim to be able to solve both separable and nonseparable Hamiltonian systems.

*Note: even though the classical ODE solvers aren't conservative, how badly they violate convergence properties usually decreases as you reduce the timestep, and often times the non-conservative solution is acceptable. Similarly, symplectic integrators aren't "error" free despite having "perfect" conservation properties. The error just shows up somewhere else.

$\endgroup$
7
  • 2
    $\begingroup$ Additional note: Symplectic integrators only have nearly perfect conservation if the solution stays away from singularities of the Hamiltonian (if it has such as in n-body gravity simulations, or the double pendulum), and if the time step is fixed. // The controlling quantity of the library function are the error tolerances. The time step is variable, so that approximately every method step contributes to the global error in proportion to the time step, or in other words, so that the error density is about constant. $\endgroup$ Feb 11 at 12:56
  • 2
    $\begingroup$ true, and in practice if you use a high order non-symplectic integrator correctly the lack of conservation is typically relatively small. $\endgroup$ Feb 11 at 14:35
  • 1
    $\begingroup$ Yes, using a fixed, and thus often very small timestep quickly gets impractical. This is more a problem in hierarchical systems like stellar simulations and less in more homogeneous systems like molecular dynamics. $\endgroup$ Feb 11 at 15:05
  • $\begingroup$ @LutzLehmann may I ask what singularities of the Hamiltonian are? $\endgroup$
    – feynman
    Feb 12 at 2:54
  • 1
    $\begingroup$ @feynman : Points/states/constellations where the Hamiltonian has a pole. Usually because of division-by-zero, for instance, if a distance in the gravity or Coulomb potential goes to zero. $\endgroup$ Feb 12 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.