1
$\begingroup$

I try to numerically solve a first order system of linear ODE's with quite complicated time-dependent coefficients. When I use NDSolve, I get an error

NDSolve::ntdv: Cannot solve to find an explicit formula for the derivatives. Consider using the option Method->{"EquationSimplification"->"Residual"}

But when I use this method, evaluation becomes extremely long (actually, I still have no result, even now it's calculating...). Is there any way, to make it faster or I just have to wait?

I'd like to add that the proposed method (Residual simplification) doesn't work, because i work with complex functions.

$\endgroup$
  • 3
    $\begingroup$ Problems with code generally require the code for help. -- Have you tried solving for the derivatives yourself (e.g. using Solve[])? $\endgroup$ – Michael E2 Nov 5 '16 at 21:21
  • $\begingroup$ Actually, code won't help you. My system of ODE looks like a'[t]==K[t]*a[t], (plus initial conditions, of course) where K[t] is a matrix (12x12) with very long formulas. And it is already solved for the derivatives. $\endgroup$ – Andrew Nov 6 '16 at 0:22
  • $\begingroup$ Do you mean a'[t] == K[t]*a[t] or a'[t] == K[t].a[t]? $\endgroup$ – Michael E2 Nov 6 '16 at 0:29
  • $\begingroup$ Of course a'[t] == K[t].a[t] $\endgroup$ – Andrew Nov 6 '16 at 0:41
  • 3
    $\begingroup$ I didn't actually think it would help. I meant to show that without your code, or further hints about it, there doesn't seem to be anything that can be done. -- For instance, I don't think you can get the error you get with the set-up you describe. So there's something unusual, probably in K[t] unless there's an error in your code. At least that's my thinking at present. $\endgroup$ – Michael E2 Nov 6 '16 at 2:01
4
$\begingroup$

I found a solution of an error:

Method->{"EquationSimplification"->"Solve"}

This one helped me.

$\endgroup$
  • $\begingroup$ This does seem to work. This is suggested in Mathematica 9, which also gives more useful error: The time constraint of 1.` seconds was exceeded trying to solve for derivatives, so the system will be treated as a system of differential-algebraic equations. You can use Method->{"EquationSimplification"->"Solve"} to have the system solved as ordinary differential equations. $\endgroup$ – Ruslan Nov 17 '16 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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