Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15430 > unrolled thread
| Started by | "vadim.oganesyan@gmail.com" <vadim.oganesyan@gmail.com> |
|---|---|
| First post | 2013-09-13 04:28 +0000 |
| Last post | 2013-12-12 06:27 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | "vadim.oganesyan@gmail.com" <vadim.oganesyan@gmail.com> |
|---|---|
| Date | 2013-09-13 04:28 +0000 |
| Subject | delayed (numerical) matrix inversion in NDSolve? |
| Message-ID | <l0u48g$bd5$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | burgundianvolker@gmail.com |
|---|---|
| Date | 2013-12-12 06:27 +0000 |
| Message-ID | <l8bkvm$65q$1@smc.vnet.net> |
| In reply to | #15430 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web