Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16338

Re: delayed (numerical) matrix inversion in NDSolve?

From burgundianvolker@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: delayed (numerical) matrix inversion in NDSolve?
Date 2013-12-12 06:27 +0000
Message-ID <l8bkvm$65q$1@smc.vnet.net> (permalink)
References <l0u48g$bd5$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On Friday, September 13, 2013 1:28:00 PM UTC+9, vadim.o...@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.

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

delayed (numerical) matrix inversion in NDSolve? "vadim.oganesyan@gmail.com" <vadim.oganesyan@gmail.com> - 2013-09-13 04:28 +0000
  Re: delayed (numerical) matrix inversion in NDSolve? burgundianvolker@gmail.com - 2013-12-12 06:27 +0000

csiph-web