2
$\begingroup$

I was trying to solve this non-linear first ODE

Clear["Global`*"]
eqns = {a*Derivative[1][y][x]^2 - b*Derivative[1][y][x]*Sqrt[3*Derivative[1][y][x]^2 - f*y[x]^2 + 3] - a*f*y[x]^2 + (a - 2/3) == 0, y[1] == y0}
sol = ParametricNDSolve[eqns, {y}, {x, 0, 10}, {a, b, f, y0}, 
   WorkingPrecision -> 20]; 
Manipulate[Plot[Evaluate[y[a, b, f, y0][x] /. sol], {x, 0, 10},PlotStyle -> Red], {{a, 1}, 0, 2, 0.2, Appearance -> "Labeled"},{{b, 0.3}, .1, 1, 0.1, Appearance -> "Labeled"}, {{f, 1}, 1, 100, 5, Appearance -> "Labeled"}, {{y0, 1}, 1, 10, 1, Appearance -> "Labeled"}]

I don't know why what is wrong here. Also I don't think so it has an analytical solution.

$\endgroup$
8
  • $\begingroup$ There seems to be nothing wrong with your code. It works on my machine. What problems do you have specifically? $\endgroup$
    – MarcoB
    Dec 21 '21 at 16:19
  • $\begingroup$ I don't think so it has an analytical solution V13 DSolve gives answer in terms of integrals. If you have specific values for f and a may be it can evaluate these integrals. $\endgroup$
    – Nasser
    Dec 21 '21 at 16:19
  • $\begingroup$ Try with a new kernel. $\endgroup$ Dec 21 '21 at 16:19
  • 2
    $\begingroup$ The integrals are hard to solve analytically. But it does give solutions in terms of them. So this become an integration problem really. You can try plugging in some values for a,b,f and see if you can get explicit solution. May be for some values these integrals can be solved. I do not know. use Manipulate to try different values? $\endgroup$
    – Nasser
    Dec 21 '21 at 16:34
  • 1
    $\begingroup$ DSolve[] produces something akin to a hyperelliptic integral, which do not have closed forms known to Mathematica in general. That those also need to be inverted afterwards (note the use of InverseFunction[]) does not help matters. $\endgroup$ Dec 21 '21 at 16:41
4
$\begingroup$

The Manipulate controls provide machine precision parameters, the precision should be increased consistent with the precision used in the ParametricNDSolve before their use.

Also, depending on the parameter values, a different plot type may be more appropriate.

Clear["Global`*"]
eqns = {a*Derivative[1][y][x]^2 - 
     b*Derivative[1][y][x]*Sqrt[3*Derivative[1][y][x]^2 - f*y[x]^2 + 3] - 
     a*f*y[x]^2 + (a - 2/3) == 0, y[1] == y0};

sol = ParametricNDSolve[eqns, y, {x, 0, 10}, {a, b, f, y0}, 
   WorkingPrecision -> 20];

Manipulate[
 plt[
  Evaluate[(y @@ SetPrecision[{a, b, f, y0}, 20])[x] /. sol],
  {x, 0, 10},
  PlotStyle -> Red,
  WorkingPrecision -> 20],
 {{a, 1}, 0, 2, 0.2, Appearance -> "Labeled"},
 {{b, 0.3}, .1, 1, 0.1, Appearance -> "Labeled"},
 {{f, 1}, 1, 100, 5, Appearance -> "Labeled"},
 {{y0, 1}, 1, 10, 1, Appearance -> "Labeled"},
 Delimiter,
 {{plt, Plot, "Plot Type"},
  {Plot, LogLinearPlot, LogLogPlot}}]

enter image description here

$\endgroup$

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