DSolve[eq13, q, {x, s}, GeneratedParameters -> B1]
The solution will yield a function so that the q in the derivative Derivative[2, 0][q][x, s] in eq13 will be replaced with the function. Then all works well.
Your original form results in a solution q[x, s] -> ..., which replaces only q[x, s] literally and does not replace its derivatives.
Hello, Mr. Rogers,
Using DSolve[eq13, q, {x, s}, GeneratedParameters → B1] will produce a pure function and the following calculation will be based on function.
But using DSolve[eq13, q[x,s], {x, s}, GeneratedParameters → B1] will produce an expression and the following calculation will be based on substitution.
Is it correct?
So if I redefine q[x_,s_] and it can work likewise.
I probably wouldn’t define the function q[x, s] because then q[x, s] can no longer be treated as an unknown in the differential equation or any associated expression one might have (e.g. energy or other derived quantities and invariants). That may not be inconvenient in your case, but I find it frequently is. Otherwise, there’s nothing wrong with defining q. I much more often prefer the solution in the form of the pure function substitution rule, which rules are naturally supported in WL. I’ve gotten used to expr /. sol, and expression rewriting is the basic operation in Mathematica.