8
$\begingroup$

When calling a Mathematica command which accepts a Method -> name option, I always thought that if the name given is not a valid method name, then the command does not evaluate; i.e., the command always checks if the Method given is supported.

For example, this works, since the Method is valid:

ode = t y''[t] + y'[t] + 2 y[t] == 0;
DSolve[ode, y[t], t, Method -> Automatic]

Mathematica graphics

But this will not work, since the Method name is wrong:

ode = t y''[t] + y'[t] + 2 y[t] == 0;
DSolve[ode, y[t], t, Method -> "MickyMouse"]

Mathematica graphics

So I was trying to find what Method can be used by AsymptoticDSolveValue, since it is not documented, and by chance I found it will accept any Method name I give it, and it still works.

ode = t y''[t] + y'[t] + 2 y[t] == 0;
ic = {y[0] -> C[1], y'[0] -> C[2]};
pt = 1;
AsymptoticDSolveValue[ode, y[t], {t, pt, 3}, Method -> Automatic]

Mathematica graphics

But this also works:

AsymptoticDSolveValue[ode, y[t], {t, pt, 3}, Method -> "MickyMouse"]

Mathematica graphics

Same answer as before. Since I am sure the MickyMouse method is not supported by AsymptoticDSolveValue, then it must be that not all commands do check the Method argument.

Is this buggy behaviour?

This makes one wonder if the Method name they supplied to a command was actually used, or was it ignored as in this example, and another method was used?

This is on 11.3, Windows 7.

$\endgroup$
  • $\begingroup$ @BobHanlon I see. I did not know this. This makes sense. You could post this as answer and will accept it. $\endgroup$ – Nasser Mar 16 '18 at 2:37
  • 1
    $\begingroup$ Options-checking is in general a headache. If there were any easy, built-in way to enforce OptionValue checks this type of thing would never come up. $\endgroup$ – b3m2a1 Mar 16 '18 at 2:58
10
$\begingroup$

I would expect a fully implemented/documented function to check the validity of the specified Method; however, since AsymptoticDSolveValue is marked as [EXPERIMENTAL] I would not assume that it is fully implemented/documented.

$\endgroup$
  • 2
    $\begingroup$ I haven't looked at the source code recently, but last I checked Automatic is currently the only implemented method. :) Which is why it is not documented, and for now basically ignored. $\endgroup$ – Itai Seggev Mar 16 '18 at 3:59
11
$\begingroup$

The other answer is completely correct (see my comment), but let me add some context. For algorthmic functions, it is generally the case that we validate the method options and issue messages/fail (sometimes a fallback is used). However, in "container" type functions, like Graphics/Graphics3D, we often don't validate them. This is because they may be used by some layers and not others (for example, in Graphics, the value of Method might only affect front end rendering, and it is the front end which must understand it). If they were validated, then every layer would have to know all the valid values, even if they were completely irrelevant.

$\endgroup$

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.