MathGroup Archive 2013

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

Search the Archive

Re: delayed (numerical) matrix inversion in NDSolve?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132115] Re: delayed (numerical) matrix inversion in NDSolve?
  • From: burgundianvolker at gmail.com
  • Date: Thu, 12 Dec 2013 01:28:00 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <l0u48g$bd5$1@smc.vnet.net>

On Friday, September 13, 2013 1:28:00 PM UTC+9, vadim.o... at gmail.com wrote:
> Hi,
>
>
>
> How do I get NDSolve to solve coupled ODE system in the form
>
>
>
> P[v].v'==Q[v]?
>
>
>
> P[v] and Q[v] contain all kinds of trig functions etc. but I am more or less guaranteed the existence of nice smooth solutions v, as well as 1/P for the problem at hand.
>
>
>
> As far as I can tell the difficulty is in the way NDSolve prepares the equations before iterating (using Solve, apparently?!?!): for small sizes <=4 NDSolve works without a hitch but for larger ones it hangs up. 
>
>
>
> I have tried asking it to solve v'==(P)^(-1)Q and use delayed inverse to try and force numerical evaluation of the right-hand-side (which is easy) but no luck.
>
>
>
> I gave up and hand-coded a simple RK4 and/or Euler and it worked without a hitch, so I am pretty sure the problem is in the NDSolve being stubborn on the initial step.
>
>
>
> thoughts? thanks,v

HI. I had the exact same problem. If the expressions are too difficult Mathematica can't solve them, because it tries to use Solve[] first. I found the answer in a book. Try setting the next within the NDSolve command:
NDSolve[eqns, u, {t, tmin, tmax}, SolveDelayed->True]

Just like that, Mathematica will first substitute numerically the values it has, and then try to integrate,which is what we do when we write our own integration methods. Hope this helps. it helped me. But this is not very well documented in the Mathematica help documents, unfortunately.




  • Prev by Date: Getting answer out of a ConditionalExpression[]
  • Next by Date: how can I solve my system of differential equations?
  • Previous by thread: Re: Getting answer out of a ConditionalExpression[]
  • Next by thread: how can I solve my system of differential equations?