Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • $\begingroup$ for large systems that's going to be slow. Think of all the processing that needs to be done. Could you show examples where the vector version does not work reliably? Possibly what you are referring to is the cause of evaluation semantics, or are there other issues? $\endgroup$ Commented Jul 26, 2013 at 7:06
  • 1
    $\begingroup$ @ruebenko another failure example is here. I just don't like to have to hack around such issues on a case-to-case basis. My approach can be used on a more routine basis. For large systems, I'd just pre-process the system some more before invoking NDSolve. $\endgroup$ Commented Jul 26, 2013 at 16:41
  • $\begingroup$ I am still not quite sure why you call this a hack - this is a consequence of the fact that Plus is Listable. $\endgroup$ Commented Aug 2, 2013 at 15:57
  • $\begingroup$ @ruebenko Actually, if I had to give the fundamental reason for these issues, I'd probably say it's the fact that NDSolve doesn't hold its first argument unevaluated. If it did, it could potentially analyze the structure of the equations beforehand and avoid treating Dot and similarly Cross as scalars in additions (which is caused by what you said). I refer to "hacking" because we have to hide the intended meaning of g in the original problem to "trick" the evaluator into holding the sum unevaluated. $\endgroup$ Commented Aug 2, 2013 at 16:55
  • $\begingroup$ So in this sense, my approach is more "honest" semantically. I do of course prefer the shortened notation without Array whenever it works, but if I ask a student to use it, I'd be very worried about encountering these evaluation order issues. Of course they all have a perfectly logical explanation, but it's a distraction from what I really want to achieve. $\endgroup$ Commented Aug 2, 2013 at 17:02