I have a rather generic system of n first order ODE to solve, of the type
$v_i'[t] + \frac{A}{t}v_i[t] = \sum_jI_{ij}[v_i[t],v_j[t]]$, $I_{ij}=-I_{ji}$.
Depending on the form of interaction terms $I_{ij}$, some of the $v_i$'s may either decouple completely from the system or couple in such a way that an analytical solution is available for some of them.
My idea was first to search the system to find analytical solutions, and then run NDSolve only if necessary. For this I need DSolve to return some kind of error message if a solution is not found. However, as much as I can tell, it only returns the code unevaluated. Is there a way to get it to return some kind of detectable error message? Or is there a way to detect the unevaluated code, thus using it as the error message?
r + s == Unevaluated[r + s]
$\endgroup$FreeQ[]
to detect if there is still aDSolve[]
present in your output. $\endgroup$FreeQ[]
works just fine for what I need. $\endgroup$