Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NDSolve and DAEs

  • To: mathgroup at
  • Subject: [mg124608] Re: NDSolve and DAEs
  • From: danl at
  • Date: Thu, 26 Jan 2012 03:29:14 -0500 (EST)
  • Delivered-to:
  • References: <jforak$5v4$>
  • Reply-to: comp.soft-sys.math.mathematica at

What you show is not a DAE. Even if you correctly state the invariant as x3[t]^2 + x4[t]^2, it can still be regarded as an ODE system because it is fully determined by the DEs and ICs. So you can solve it directly via

sol = NDSolve[
  Join[eqns, ics], {x1[t], x2[t], x3[t], x4[t]}, {t, 0, 16}]

That said, when an invariant exists it does make sense to have NDSolve enforce it. Otherwise one can get drift off the invariant manifold. This enforcing can be done via the Projection method.

solP = NDSolve[
  Join[eqns, ics], {x1[t], x2[t], x3[t], x4[t]}, {t, 0, 16}, 
  Method -> {Projection, "Invariants" -> x3[t]^2 + x4[t]^2}]

For further detail you might check Help > DocumentationCenter >

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: Automatically colred and indexed custom locators
  • Next by Date: Re: Puzzled by Sum
  • Previous by thread: Re: NDSolve and DAEs
  • Next by thread: Re: NDSolve and DAEs