3
$\begingroup$

I want to get a solution to an ordinary differential equation with imposed initial conditions. I'm confused about why my following code doesn't work:

Remove["Global`*"]

eqn = {x g - x v[x] v'[x] - v[x]^2 == 0};
inicond = {v[0] == 0, v'[0] == 0};
eqnlist = Join[eqn, inicond];

DSolve[eqnlist, v[x], x]
{}

Can anyone help me?

$\endgroup$
5
  • $\begingroup$ Sixth question and you still haven't noticed there are code formatting guidelines ? .. $\endgroup$
    – Sektor
    Commented Apr 6, 2014 at 20:34
  • $\begingroup$ @Sektor I know the guidelines, but it seems hard to find the resources to learn the code as you edited. $\endgroup$
    – Lawerance
    Commented Apr 6, 2014 at 21:25
  • $\begingroup$ here $\endgroup$
    – Sektor
    Commented Apr 6, 2014 at 21:28
  • $\begingroup$ @Sektor Do you know what kind of language is this? I am going to find some youtube tutorials of it. $\endgroup$
    – Lawerance
    Commented Apr 6, 2014 at 21:31
  • $\begingroup$ @Lawerance Regarding the formatting, "Markdown" is the name/keyword you would like to feed to search engine. $\endgroup$
    – Silvia
    Commented Aug 18, 2014 at 14:15

1 Answer 1

7
$\begingroup$

Overdetermined systems of differential equations can have any solutions only if they satisfy certain compatibility conditions, therefore in general one shouldn't expect that any solutions necessarily exist. For differential equations of the first order one can impose initial conditions in the form of values of unknown functions (at certain points for ODEs) but on the other hand for certain initial conditions there are no solutions and this is the case we encounter here.
However we can solve the equation without any initial conditions:

DSolve[{g x - v[x]^2 - x v[x] v'[x] == 0}, v[x], x]
{{v[x] -> -(Sqrt[ 2 g x^3 + 3 C[1]]/(Sqrt[3] x))}, 
 {v[x] -> Sqrt[ 2 g x^3 + 3 C[1]]/(Sqrt[3] x)}}

We can see two families of symbolic solutions which immediately show why we cannot impose the condition for x == 0, e.g. v[0] == 0, nonetheless we can impose e.g. v[1] == c, and now treating c and g as variables determining different solutions we'll take a closer look:

dsol[c_, g_] = v[x] /. DSolve[{g x - v[x]^2 - x v[x] v'[x] == 0, v[1] == c}, v[x], x]
 { -(Sqrt[ 3 c^2 - 2 g + 2 g x^3]/(Sqrt[3] x)), 
     Sqrt[ 3 c^2 - 2 g + 2 g x^3]/(Sqrt[3] x)}

plotting them by choosing various arguments of c and g, e.g.

GraphicsColumn[ 
  Plot[ #, {x, -4, 4}, Evaluated -> True, PlotStyle -> Thick, ImageSize -> 600, 
        AspectRatio -> Automatic, PlotLegends -> "Expressions",
        PlotRange -> {{-4, 4}, {-4, 4}}] & /@ { 
    Table[ dsol[1, g],    {g, {-2, 0, 2}}], 
    Table[ dsol[c, -1/2], {c, {-2, 0, 2}}] }]

enter image description here

We can see that some solutions can be continued in the complex plane after reaching appropriate values e.g. Sqrt[ 13 - x^3]/( Sqrt[3] x) becomes complex when x exceeds 13^(1/3).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.