Author: nickolai zavgorodnii Language: text
Description: Not specified Timestamp: 2017-09-19 11:41:51 +0000
View raw paste Reply
  1. In[7]:=
  2. w = 3; xo = 1; po = 0; T = 10;
  3. sol = NDSolve[{Derivative[1][x][
  4.        t] == p[t], x[0] == xo,
  5.      Derivative[1][p][t] ==
  6.       -(w^2*x[t]), p[0] == po},
  7.     {x, p}, {t, 0, T}];
  8.   graph1 = Plot[Evaluate[
  9.      {x[t], p[t]} /. sol],
  10.     {t, 0, T}];
  11. graph2 = ParametricPlot[
  12.     Evaluate[{x[t], p[t]} /. sol],
  13.     {t, 0, T}];
  14. Show[GraphicsArray[{graph1, graph2}]]
View raw paste Reply