7
$\begingroup$

Bug introduced in 13.1. and fixed in V 13.2.1


Submitted to WRI. CASE ID [CASE:4975479].


I was looking at this question.

In V 13.1 I get an internal error which the above question does not mention so I assume it is a version difference? I slightly changed the input to make it more clear:

ClearAll[r, x, u]
ode1 = r''[x] + r[x] * (u'[x])^2 == 0
ode2 = u''[x] * r[x] + 2 * r'[x] * u'[x] == 0
ic = {r[0] == 1, r'[0] == 0, u[0] == 0, u'[0] == 0}

And now

DSolve[{ode1, ode2, ic}, {r[x], u[x]}, x]

gives

Mathematica graphics

Why this error generated? Is this a bug? I see nothing wrong with the input. Does this happen on other versions/systems?

V 13.1 on windows 10.

$\endgroup$
5
  • 2
    $\begingroup$ Cannot reproduce it in version 13.0.1 for Linux x86 (64-bit) (January 29, 2022) $\endgroup$
    – mattiav27
    Commented Oct 11, 2022 at 8:46
  • 2
    $\begingroup$ In v12.0.0 Windows10 DSolve doesn't evaluate, perhaps because {ode1, ode2} /. x -> 0 /. (ic /. Equal -> Rule) gives {r''[0] == 0, u''[0] == 0} $\endgroup$ Commented Oct 11, 2022 at 9:48
  • 2
    $\begingroup$ Version 13.1 Windows 10 produces this error. As the same equations with NDSolve work, I think it is a bug. Please report it to [email protected] $\endgroup$ Commented Oct 11, 2022 at 11:33
  • 2
    $\begingroup$ This is a confirmed bug. Interestingly I encountered this bug about 3 months ago when solving almost the same problem (asked in Chinese community). $\endgroup$
    – xzczd
    Commented Oct 11, 2022 at 16:44
  • 2
    $\begingroup$ Fixed in 13.2.0. $\endgroup$ Commented Dec 19, 2022 at 0:00

2 Answers 2

6
$\begingroup$

It's because DSolve`DSolveFirstOrderODEsDump`DSolvenOrder1NonlinearODEs has not been updated to pass DSolve`DSolveParser[] complete option value data (with the new options like IncludeSingularSolutions).

As far as I can tell, DSolve proceeds merrily along despite the error. All the error does is set a non-True value to DSolve`$DSolveSingularSolutions.

Similar issue here with another internal function: Why is DSolve unable to solve this second order ode with initial conditions? Any workaround?

FWIW, here's a general solution that DSolve generates internally for r and u' (not u). But DSolve rejects it, it seems, even though one can solve for u from u'. The IVP cannot be solved, however.

sol = # /.
      r -> 
       Function[{x}, 
        Sqrt[-C[1]^2 + 4 x^2 C[2]^2 - 8 x C[2]^2 C[3] + 
         4 C[2]^2 C[3]^2]/(Sqrt[2] Sqrt[C[2]])] /.
     u -> (Derivative[-1][v][#] + C[4] &) /.
    v -> 
     Function[{x}, (
      2 C[1] C[2])/(-C[1]^2 + 4 x^2 C[2]^2 - 8 x C[2]^2 C[3] + 
       4 C[2]^2 C[3]^2)] &;

{ode1, ode2} // sol // Simplify
(*  {True, True}  *)

u[x] // sol // Simplify
(*
1/2 (2 C[4] - Log[C[1] + 2 C[2] (x - C[3])] + 
   Log[C[1] + 2 C[2] (-x + C[3])])
*)

{r[0] == 1, r'[0] == 0, u[0] == 0, u'[0] == 0} // sol // 
  Simplify // Solve
(*  {}  *)
$\endgroup$
2
  • $\begingroup$ DSolvenOrder1NonlinearODEs looks like a typo, but if so, WRI let it slide through. $\endgroup$
    – Michael E2
    Commented Oct 11, 2022 at 17:22
  • $\begingroup$ Compare with the numeric ode1 = r''[x] + r[x]*(u'[x])^2 == 0 ode2 = u''[x]*r[x] + 2*r'[x]*u'[x] == 0 ic = {r[0] == 1, r'[0] == 0, u[0] == 0, u'[0] == 0} sol = NDSolve[{ode1, ode2, ic}, {r[x], u[x]}, {x, 0, 1}]. $\endgroup$
    – user64494
    Commented Oct 11, 2022 at 17:31
1
$\begingroup$

This is fixed in V 13.2.1 as this screen shot shows

Mathematica graphics

$\endgroup$

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