Dsolve svars error: Equations may not give solutions for all "solve" variables - Mathematica Stack Exchange most recent 30 from mathematica.stackexchange.com 2019-09-18T14:51:17Z https://mathematica.stackexchange.com/feeds/question/112463 https://creativecommons.org/licenses/by-sa/4.0/rdf https://mathematica.stackexchange.com/q/112463 3 Dsolve svars error: Equations may not give solutions for all "solve" variables JAustin https://mathematica.stackexchange.com/users/34172 2016-04-12T19:34:55Z 2016-04-16T17:42:13Z <p>New to Mathematica, trying to solve a set of coupled differential equations related to a geodesics/Calculus of Variations problem. More specifically, I am trying to solve the two Euler-Lagrange equations minimizing the arc length of a curve along the unit sphere.</p> <p>\begin{align} \frac{\partial L}{\partial u} - \frac{d}{dt}\frac{\partial L}{\partial \dot{u}} = 0 \\[10pt] \frac{\partial L}{\partial v} - \frac{d}{dt}\frac{\partial L}{\partial \dot{v}} = 0 \end{align}</p> <p>where L is the Lagrangian of the arc-length functional for a curve along a sphere parameterized by $(u,v)$: </p> <p>\begin{align} L(\xi,\dot{\xi}) = \sqrt{\cos^2(v)\dot{u}^2 + 1} \end{align}</p> <p>The resulting differential equation is:</p> <pre><code>{(2 Cos[v[t]] Sin[v[t]] Derivative[u][t] Derivative[v][t])/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][t]^2] - ( Cos[v[t]]^2 (u^\[Prime]\[Prime])[t])/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][ t]^2] + (Cos[v[t]]^2 Derivative[u][ t] (-2 Cos[v[t]] Sin[v[t]] Derivative[u][t]^2 Derivative[ v][t] + 2 Cos[v[t]]^2 Derivative[u][t] ( u^\[Prime]\[Prime])[t]))/(2 (1 + Cos[v[t]]^2 Derivative[u][t]^2)^(3/2)) == 0, -((Cos[v[t]] Sin[v[t]] Derivative[u][t]^2)/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][t]^2]) == 0} </code></pre> <p>And the DSolve expression is:</p> <pre><code>DSolve[{(2 Cos[v[t]] Sin[v[t]] Derivative[u][t] Derivative[v][ t])/Sqrt[1 + Cos[v[t]]^2 Derivative[u][t]^2] - ( Cos[v[t]]^2 (u^\[Prime]\[Prime])[t])/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][ t]^2] + (Cos[v[t]]^2 Derivative[u][ t] (-2 Cos[v[t]] Sin[v[t]] Derivative[u][t]^2 Derivative[ 1][v][t] + 2 Cos[v[t]]^2 Derivative[u][t] (u^\[Prime]\[Prime])[ t]))/(2 (1 + Cos[v[t]]^2 Derivative[u][t]^2)^(3/2)) == 0, -((Cos[v[t]] Sin[v[t]] Derivative[u][t]^2)/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][t]^2]) == 0}, {v[t], u[t]}, t] </code></pre> <p>I seem to have two (possibly unsolvable) equations with two variables each defined by the parameter t. And yet Mathematica returns a <em>"Solve::svars: Equations may not give solutions for all "solve" variables"</em> error. The equation doesn't seem underspecified, and I'd expect an "equation cannot be solved with methods available to DSolve" error if it were simply unsolvable. Am I missing something? </p> <p>Thanks!</p> <p><a href="https://i.stack.imgur.com/b3DO8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b3DO8.png" alt="enter image description here"></a></p> https://mathematica.stackexchange.com/questions/112463/-/112472#112472 3 Answer by Michael E2 for Dsolve svars error: Equations may not give solutions for all "solve" variables Michael E2 https://mathematica.stackexchange.com/users/4999 2016-04-12T22:14:17Z 2016-04-16T17:42:13Z <p><code>DSolve</code> rewrites the system as a system of first order equations and then tries to <code>Solve</code> for the derivatives.</p> <p>One can see the <code>Solve</code> command <code>DSolve</code> calls by using <code>Trace</code> as follows:</p> <pre><code>Trace[ DSolve[{(2 Cos[v[t]] Sin[v[t]] Derivative[u][t] Derivative[v][ t])/Sqrt[ 1 + Cos[v[t]]^2 Derivative[u][t]^2] - (Cos[v[t]]^2 u''[t])/ Sqrt[1 + Cos[v[t]]^2 Derivative[u][t]^2] + (Cos[ v[t]]^2 Derivative[u][ t] (-2 Cos[v[t]] Sin[ v[t]] Derivative[u][t]^2 Derivative[v][t] + 2 Cos[v[t]]^2 Derivative[u][t] u''[t]))/(2 (1 + Cos[v[t]]^2 Derivative[u][t]^2)^(3/2)) == 0, -((Cos[v[t]] Sin[v[t]] Derivative[u][t]^2)/ Sqrt[1 + Cos[v[t]]^2 Derivative[u][t]^2]) == 0}, {v[t], u[t]}, t], _Solve, TraceInternal -&gt; True] </code></pre> <p>The <code>Solve</code> command is as follows (possibly with different local variables):</p> <pre><code>Solve[{-((Cos[v[t]]^2 Derivative[NDSolveu$1][t])/Sqrt[ 1 + Cos[v[t]]^2 NDSolveu$1[t]^2]) + ( 2 Cos[v[t]] Sin[v[t]] NDSolveu$1[t] Derivative[v][t])/Sqrt[ 1 + Cos[v[t]]^2 NDSolveu$1[ t]^2] + (Cos[v[t]]^2 NDSolveu$1[ t] (2 Cos[v[t]]^2 NDSolveu$1[t] Derivative[NDSolveu$1][ t] - 2 Cos[v[t]] Sin[v[t]] NDSolveu$1[t]^2 Derivative[ v][t]))/(2 (1 + Cos[v[t]]^2 NDSolveu$1[t]^2)^(3/2)) == 0, -((Cos[v[t]] Sin[v[t]] NDSolveu$1[t]^2)/Sqrt[ 1 + Cos[v[t]]^2 NDSolveu$1[t]^2]) == 0, Derivative[u][t] == NDSolveu$1[t]}, {Derivative[u][t], Derivative[NDSolveu$1][t], Derivative[v][t]}] </code></pre> <blockquote> <p>Solve::svars: Equations may not give solutions for all "solve" variables. >></p> </blockquote> <pre><code>(* {{Derivative[u][t] -&gt; NDSolveu$1[t], Derivative[NDSolve`u\$1][t] -&gt; 0}} *) </code></pre> <p>The solution returned is incomplete and unusable by <code>DSolve</code>, so <code>DSolve</code> quits. I suppose it would be nicer if it caught the error message and reissued a message more easily understood by the user.</p> <p>(The source of the problem seems to be the last equation in the OP's system, which generically implies <code>u'[t] == 0</code>. This in turn implies <code>u''[t] = 0</code>. By plugging these values into the system, one can see that <code>v[t]</code> can be any function as long as <code>u[t]</code> is constant.)</p>