Author: Not specified Language: text
Description: Not specified Timestamp: 2017-09-19 11:43:21 +0000
View raw paste Reply
  1. w = 3; xo = 1; po = 0; T = 10;
  2. sol = NDSolve[{x'[t] == p[t], x[
  3. 0] == xo, p'[t] == -w^2x[t], p[0] == po}, {x, p}, {t, 0, T}];
  4. graph1 = Plot[Evaluate[{x[t], p[t]} /. sol], {t, 0, T}];
  5. graph2 = ParametricPlot[Evaluate[{x[t], p[t]} /. sol], {t, 0, T}];
  6. Show[GraphicsArray[{graph1, graph2}]]
View raw paste Reply