Group Abstract Group Abstract

Message Boards Message Boards

Empty Plot of NDSolve output

Posted 2 years ago

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!

POSTED BY: Emil Rosanowski
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard