2

There are some differential equations.

$r''+r\theta'^{2}=0$

$r\theta''+2r'\theta'=0$

And $r=r(x)$ and $\theta=\theta(x)$.

And I want to get the $r(\theta)$.

I tried to solve the $r(x)$ and $\theta (x)$ first.

And use $r(x)$ and $\theta (x)$ to get the $r(\theta)$ like this.

But Mathematica can't solve this differential equations.

DSolve[{r''[x] + r [x]*(t'[x])^2 == 0, 
  t''[x]*r[x] + 2 r'[x]*t'[x] == 0, r[0] == r0, t[0] == 0, 
  r'[0] == 0}, {r, t}, x]

Is there any other method to solve this problem?

bbgodfrey
  • 61,439
  • 17
  • 89
  • 156
qsa
  • 23
  • 3
  • Is this your classmate?: https://tieba.baidu.com/p/7874713620 – xzczd Oct 11 '22 at 16:46
  • If you're trying to solve Newton's Second Law in plane polar coordinates in the absence of a force, then the first equation should be $r'' \color{red}{-} r\theta'^{2}=0$. – Michael Seifert Oct 11 '22 at 18:24
  • @xzczd I don't think the same. – qsa Oct 12 '22 at 07:15
  • @MichaelSeifert If $r'' \color{red}{-} r\theta'^{2}=0$, the problem is typical and the solution is like this. But unfortunately,I met a problem with $r'' \color{red}{+} r\theta'^{2}=0$ – qsa Oct 12 '22 at 07:21
  • Fair enough! It just seemed like a plausible mistake and I figured I'd check whether it was an error or not. – Michael Seifert Oct 12 '22 at 11:59
  • @xzczd With Mathematica 13.1.0 for Microsoft Windows (64-bit) (June 16, 2022), I receive the error message Part::partw when attempting to execute the code in the question. Do others have the same experience? – bbgodfrey Oct 12 '22 at 19:34
  • 2
    @bbgodfrey Nasser has asked a separate question for this issue: https://mathematica.stackexchange.com/q/274571/1871 :) – xzczd Oct 13 '22 at 00:29
  • @xzczd Thanks for the info. – bbgodfrey Oct 13 '22 at 00:46

2 Answers2

2
  • plot the graph.

The parametric curves by {r[s], θ[s]} indicate that maybe we need to consider {θ[s],r[s]},that is θ respect to r. The second picture is the polar parametric curves.

Clear[sol];
sol = NDSolve[{r''[s] + r[s]*θ'[s]^2 == 0, 
   r[s]*θ''[s] + 2 r'[s]*θ'[s] == 0, θ[0] == 
    0, θ'[0] == 1, r'[0] == 0, 
   r[0] == 2}, {r, θ}, {s, -.99, .99}]
ParametricPlot[{r[s], θ[s]} /. sol[[1]], {s, -.99, .99}]
ParametricPlot[
 r[s]*{Cos@θ[s], Sin@θ[s]} /. sol[[1]], {s, -0.99, .99},
  PlotRange -> All]

enter image description here

enter image description here

  • Simplify the equations.
D[r[s]^2*θ'[s], s] == 
 r[s] (r[s]*θ''[s] + 2 r'[s]*θ'[s])
(* True *)

It means that

D[r[s]^2*θ'[s], s]==0

r[s]^2*θ'[s] is a constant.

Substitude θ'[s]=const/r[s]^2 to r''[s] + r[s]*θ'[s]^2 == 0 we can get a solvable differential equations.

cvgmt
  • 72,231
  • 4
  • 75
  • 133
  • 1
    This solution highly depends on manual analysis. (To be precise, Mathematica contributes almost nothing in eliminating s… ) Does there exist a more systematic process to eliminate s that can be programmed? That's something I failed to find in past 4 months… – xzczd Oct 11 '22 at 17:06
2

As noted by Nasser and Michael E2 in question 274571, a bug in DSolve prevents it from evaluating the code given in the question above. However, the bug can be circumvented by replacing t'[x] by z[x].

s1 = Simplify[
    DSolve[{r''[x] + r[x]*(z[x])^2 == 0, z'[x]*r[x] + 2 r'[x]*z[x] == 0,
        r[0] == r0, r'[0] == 0}, {r[x], z[x]}, x] /. C[2] -> -C[2], 
    C[2] > 0 && r0^2 - 2 x^2 C[2] > 0]
(* {{r[x] -> -Sqrt[r0^2 - 2 x^2 C[2]], z[x] -> (Sqrt[2] r0 Sqrt[C[2]])/((r0^2 - 2 x^2 C[2])}, 
    {r[x] -> -Sqrt[r0^2 - 2 x^2 C[2]], z[x] -> -((Sqrt[2] r0 Sqrt[C[2]])/(r0^2 - 2 x^2 C[2]))}, 
    {r[x] -> Sqrt[r0^2 - 2 x^2 C[2]], z[x] -> (Sqrt[2] r0 Sqrt[C[2]])/(r0^2 - 2 x^2 C[2])}, 
    {r[x] -> Sqrt[r0^2 - 2 x^2 C[2]], z[x] -> -((Sqrt[2] r0 Sqrt[C[2]])/(r0^2 - 2 x^2 C[2]))}} *)

Then, t[x] can be obtained as the integral of z[x]. Consider, for instance, the third solution just given.

s2 = Integrate[s1[[3, 2, 2]], x] // Simplify
(* ArcTanh[(Sqrt[2] x Sqrt[C[2]])/r0] *)

Then solve this expression for x and insert it into the expression for r[x].

Reduce[t == s2 && C[2] > 0, x, Reals] // Last
Simplify[s1[[3, 1, 2]] /. (% /. Equal -> Rule), r0 > 0]
(* x == (r0 Tanh[t])/(Sqrt[2] Sqrt[C[2]]) *)
(* r0 Sqrt[Sech[t]^2] *)

So, r = r0 at t = 0, as desired, and decreases to zero as t approaches infinity. For completeness, a plot of {r[x], t[x]} for the case just described is

Plot[Evaluate[{s1[[3, 1, 2]], s2} /. {r0 -> 2, C[2] -> 2}], {x, 0, 1},
    PlotRange -> {0, 4}, AxesLabel -> {x, "r,t"}, ImageSize -> Large, 
    LabelStyle -> {15, Bold, Black}]

enter image description here

The same plot can be obtained from numerical integration of the ODEs.

NDSolveValue[{r''[x] + r[x]*t'[x]^2 == 0, 
    r[x]*t''[x] + 2 r'[x]*t'[x] == 0, t[0] == 0, t'[0] == 1, 
    r'[0] == 0, r[0] == 2}, {r[x], t[x]}, {x, 0, .9999}];
Plot[%, {x, 0, .9999}, PlotRange -> {0, 4}, PlotRange -> {0, 4}, 
    AxesLabel -> {x, "r,t"}, ImageSize -> Large, LabelStyle -> {15, Bold, Black}]
bbgodfrey
  • 61,439
  • 17
  • 89
  • 156