Group Abstract Group Abstract

Message Boards Message Boards

NDSolve error: Encountered non-numerical value

Posted 16 hours ago

POSTED BY: Yumin Tian
2 Replies

Setting the 0 term to a very small nonzero number appears to work:

POSTED BY: David Trimas

Not a great error message for the situation, but I don't think y'[t] == -{1, 0} * y[t], which evaluates to y'[t] == {-y[t], 0}, can be satisfied by any y[t] because the dimensions are different. So there is an error, and one should get an error message.

That said, a message like NDSolve::ndfdmc (about dimensions) would seem more appropriate. The source of the problem of getting the right message might be that at t == 0, NDSolve[] expects y'[0] to have the same dimensions as y[0] == {1, 1}; instead, the ODE sets y'[0] == {-y[0], 0} == {{-1, -1}, 0}; and finally, Dimensions[{1, 1}] and Dimensions[{{-1, -1}, 0}] are both {2} — that is, the computed dimensions agree even though the expressions are not compatible.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard