3

In this example

F = NDSolveValue[{Derivative[2, 0][f][x, y] == y^2*f[x, y],f[1, y] == 1, Derivative[1,0][f][1, y] == 1}, f, {x, 0, 1}, {y, 0, 1}] 

NDSolve evaluates to the correct solution, which can be confirmed by DSolve. I would like to know which numerical method was used.

I tried

F["Methods"]
(*{"Coordinates", "DerivativeOrder", "Domain", "ElementMesh", \
"Evaluate", "GetPolynomial", "Grid", "InterpolationMethod", \
"InterpolationOrder", "MethodInformation", "Methods", \
"OutputDimensions", "Periodicity", "PlottableQ", "Properties", \
"QuantityUnits", "Unpack", "ValuesOnGrid"}*)

Unfortunately F["MethodInformation"] doesn't evaluate.

Because F["ElementMesh"] gives None, I assume it's not a FEM-solver. I also tried Trace without success.

How can I get further information concerning "MethodInformation" used by NDSolve ?

MarcoB
  • 67,153
  • 18
  • 91
  • 189
Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55
  • In version 13.0 for Linux, with F["MethodInformation"], I get the error MethodInformation called with 0 arguments; 1 argument is expected., so it seems that, at least in that version, your syntax is wrong. – mattiav27 Feb 27 '24 at 10:19
  • @mattiav27 Thanks, same result in v12.2. All other options work, don't know how to find the correct syntax – Ulrich Neumann Feb 27 '24 at 10:25
  • 3
    trying this command := NDSolveValue[{Derivative[2, 0][f][x, y] == y^2*f[x, y], f[1, y] == 1, Derivative[1, 0][f][1, y] == 1}, f, {x, 0, 1}, {y, 0, 1}]; Select[Flatten[ Trace[command, TraceInternal -> True]], ! FreeQ[#, Method | NDSolveMethodData] &]saysNDSolve Newtonat the end. before it saidNDSolve LSODA` – Nasser Feb 27 '24 at 10:41
  • 1
    see https://mathematica.stackexchange.com/questions/145/how-to-find-out-which-method-mathematica-selected – Nasser Feb 27 '24 at 10:42
  • 1
    see https://mathematica.stackexchange.com/questions/183102/details-of-ndsolve-calling-lsoda for LSODA – Nasser Feb 27 '24 at 10:45
  • 1
    Note that "MethodMonitor" suggested by user21 in the above post, no longer seems to work. It is still mentioned though here https://reference.wolfram.com/language/tutorial/NDSolveDesign.html#1710185749 may be user21 could suggest better method to use these days. – Nasser Feb 27 '24 at 10:51
  • 2
    Notice that checking F won't help much here, because F is an InterpolatingFunction[…] which isn't necessarily generated by NDSolve, and info of NDSolve is just not there. (Of course, you can check ElementMesh to determine if FiniteElement method is used. ) – xzczd Feb 27 '24 at 10:53
  • @Nasser Thanks for your comments. Need some time to understand outpu of Trace – Ulrich Neumann Feb 27 '24 at 11:10

0 Answers0