9
$\begingroup$
  • I notice that off all the Method options available for NDSolve[...], LSODA is invoked quite automatically for stiff equations when Method -> Automatic. Is there a way to set the Method -> LSODA? I ask because as LSODA switches between Adams' and Gear's method, it should have sub-options to it that I could set (like order etc.)?

  • Under tutorial/NDSolveStiffnessSwitching I encountered Needs["DifferentialEquations`NDSolveProblems"]. What other example problems are available and where can I find documentation on them?


Edit (03/24/2011):

In light of comments made to this post, I'd also refer readers to page 409 of "The Mathematica Guidebook for Numerics". Springer has this book online and can be found here.

$\endgroup$

2 Answers 2

12
$\begingroup$

If you load the package using Needs as shown in the Tutorial and then evaluate $NDSolveProblems you will list a list of names of all the problems included in the package.

I think I can now also answer the first part of the question. The method has to be called as

NDSolve`LSODA

rather than LSODA (for some reason it is in the NDSolve` context, which suggests that it is not intended for "ordinary users"). To see its options, just evaluate

?NDSolve`LSODA

The whole issue of these "hidden contexts" in Mathematica could be the topic of an interesting discussion ;-)

$\endgroup$
7
  • $\begingroup$ ?NDSolveLSODA gives me: Options[NDSolveLSODA]={LinearSolveMethod->Automatic,MaxDifferenceOrder->12} This is rather useful. However, what does NDSolve`LSODA do? Did it load the LSODA method for use? $\endgroup$
    – dearN
    Commented Mar 24, 2012 at 15:49
  • $\begingroup$ It is itself the name of a method for NDSolve, that is, you use it by evaluating NDSolve[eqn,Method->NDSolve`LSODA]. Whether it will do any good depends of course on eqn. $\endgroup$ Commented Mar 24, 2012 at 16:16
  • $\begingroup$ Perhaps it's worth mentioning that the symbol NDSolve`LSODA does not get loaded (and thus cannot be queried) until NDSolve[] is used at least once. $\endgroup$
    – Szabolcs
    Commented Mar 24, 2012 at 16:17
  • $\begingroup$ A bit of spelunking shows that NDSolve`LSODA is defined like this: pastebin.com/0nayVBHP This confirm what @Andrzej said that it is just a method identifier. You can learn about how methods work here (I didn't have time to read this, but it seems like a relevant resource). $\endgroup$
    – Szabolcs
    Commented Mar 24, 2012 at 16:23
  • 1
    $\begingroup$ More precisely: it can be used as NDSolve`LSODA even the first time but once NDSolve is used, you can call it just LSODA. $\endgroup$ Commented Mar 24, 2012 at 16:25
5
$\begingroup$

Does NDSolve[eqn, opts, Method->LSODA] not work? It should, according to this.

The problems seem to be at

FileNameJoin[{$InstallationDirectory, "AddOns", "ExtraPackages", 
  "DifferentialEquations", "NDSolveProblems.m"}]
$\endgroup$
2
  • $\begingroup$ I appreciate the link to the pdf. Thanks! $\endgroup$
    – dearN
    Commented Mar 22, 2012 at 22:47
  • $\begingroup$ @acl the linked file does not exist anymore... could you update it, please? $\endgroup$
    – Nobody
    Commented Nov 29, 2021 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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