# NDSolve in Mathematica 11 don't accept string as a function name?

NDSolve[{"a"''[t] + "a"[t] == 0, "a"'[0] == 0, "a"[0] == 1}, "a", {t, 0, 10}]


This code works in Mathematica 10 and below but in Mathematica 11, I got the error message:

NDSolve::dsfun: "a" cannot be used as a function.


Is this a bug or just the new limitation?

The reason I use string as function name is because it can avoid memory problem for using NDSolve in Module. See the question and answer here https://mathematica.stackexchange.com/a/78382/34148

• I never knew a function name can be string except now. But may be someone at WRI finally noticed this and decided it was bad idea and removed this hidden feature? I have no idea why any one would want to write code using strings for function names to start with, even if it possible, as it leads to convoluted code to say the least. But you are correct, I verified it worked on 10.4 and not on 11.3. May 3 '18 at 7:59
• Because I try to avoid the memory problem. See my new edited. May 3 '18 at 8:37
• @LouisYang This was never intended to work (at least starting from 10.0) - see my updated answer May 3 '18 at 9:13

### This is a bug in 10.0 (or earlier) up to 11.1 that has been resolved in 11.2

From the documentation of NDSolve::dsfun (this exists at least since 10.2):

This message is generated when a number or a string is used as the name of a function in DSolve or NDSolve.

So it appears as if this was never intended to work, and the oversight was finally fixed in 11.2.

In case you were not aware, some messages are documented on a separate page:

• I think the question was asking, why it worked before and not now. May 3 '18 at 8:10
• @Nasser Well, it answers the question whether it's a bug or not. Unfortunately, I don't have MMA 10 installed, so I can't tell how the documentation looks there May 3 '18 at 8:12
• in version 10.4, there is no error message and it works ok. So no message to trace as you show. May 3 '18 at 8:13
• @Nasser Ok, found an installation of MMA 10.0 - the message is already there with the same description, apparently the error just wasn't detected properly up to 11.1. - I've updated the answer accordingly May 3 '18 at 9:15
• OK, I thought this is the new feature introduced in MMA 9. Now, I will have to find another way to avoid memory leakage for NDSolve in function. May 3 '18 at 9:57