# Empty Plot of NDSolve output

**URL:** <https://community.wolfram.com/t/empty-plot-of-ndsolve-output/21697>\
**Category:** Questions\
**Tags:** calculus, equation-solving, numerical-computation\
**Created:** [March 4, 2023, 3:56pm UTC](https://community.wolfram.com/t/empty-plot-of-ndsolve-output/21697 "2023-03-04T15:56:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s6emrosa](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s6emrosa](https://community.wolfram.com/u/s6emrosa)\
**Post date:** [March 4, 2023, 3:56pm UTC](https://community.wolfram.com/t/empty-plot-of-ndsolve-output/21697/1 "2023-03-04T15:56:01Z")

</div>

Hi all,  
I am quite new to Mathematica and have no idea what is wrong with my code. The code looks like the following:

```
m = 1
L = 1
a = Pi/4
o = 10
s = NDSolve[{m*r''[t] == -m*9.81*Cos[a]*Sin[a] + 
     L^2/(m*r[t]^3)*Power[Sin[a], 2], r[0] == 2, r'[0] == 0}, 
  r, {t, 0, o}]
n = NDSolve[{m*Evaluate[r[t] /. s]*p'[t] == L, p[0] == 0}, 
  p, {t, 0, o}]
ParametricPlot3D[{Evaluate[r[t] /. s]*Cos[Evaluate[p[t] /. n]], 
  Evaluate[r[t] /. s]*Sin[Evaluate[p[t] /. n]], 
  Evaluate[r[t] /. s]*Cot[a]}, {t, 0, o}, PlotRange -> Full]
Plot[Evaluate[r[t] /. s]*Cos[Evaluate[p[t] /. n]], {t, 0, o}, 
 PlotRange -> All]
Plot[Evaluate[r[t] /. s]*Sin[Evaluate[p[t] /. n]], {t, 0, o}, 
 PlotRange -> All]
Plot[Evaluate[r[t] /. s]*Cot[a], {t, 0, o}, PlotRange -> All]
Plot[Evaluate[r[t] /. s], {t, 0, o}, PlotRange -> All]
Plot[Evaluate[p[t] /. n], {t, 0, o}, PlotRange -> All]

```

The code solves my DGL and plots the result. The last two plot function show the parameters r and p. The three lines above show the components from the parametric plot. The plots look like expected, but when combining them, the parametric plot is empty. Does anyone know why?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [March 4, 2023, 8:29pm UTC](https://community.wolfram.com/t/empty-plot-of-ndsolve-output/21697/2 "2023-03-04T20:29:22Z")

</div>

Emil,

you are already almost there! The only problem is that here `NDSolve[]` gives `{{p -> InterpolatingFunction[...]}}`, i.e. a list of a list of a rule. If you use such a construct as a replacement rule you get again a list:

```
a /. {{a -> b}}
(* Out: {b} *)

```

and so you end up with `ParametricPlot3D[{{fx},{fy},{fz}}]`, but this does not work, you want instead  
`ParametricPlot3D[{fx,fy,fz}]`. So, what you can do is e.g. replacing `NDSolve[...]` with `NDSolve[...][[1, 1]]`.
