7

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.

Nasser
  • 143,286
  • 11
  • 154
  • 359

2 Answers2

6

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 (* {} *)

Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • DSolvenOrder1NonlinearODEs looks like a typo, but if so, WRI let it slide through. – Michael E2 Oct 11 '22 at 17:22
  • Compare with the numeric `ode1 = r''[x] + r[x](u'[x])^2 == 0 ode2 = u''[x]r[x] + 2r'[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}]`.

    – user64494 Oct 11 '22 at 17:31
1

This is fixed in V 13.2.1 as this screen shot shows

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359