Slexy.org is shutting down and stopped accepting new Pastes on May 4th, 2021.
Existing Pastes will stop being available on or after May 10th, 2021.
Author: Not specified Language: text
Description: Not specified Timestamp: 2017-09-19 11:33:52 +0000
View raw paste Reply
  1. w = 3; xo = 1; po = 0; T = 10;
  2.   sol = NDSolve[{Derivative[1][x][t] ==
  3.       p[t], x[0] == xo,
  4.      Derivative[1][p][t] == (-w^2)*x[t] -
  5.        0.1*p[t], p[0] == po}, {x, p},
  6.     {t, 0, T}];
  7. graph1 = Plot[Evaluate[{x[t], p[t]} /.
  8.       sol], {t, 0, T}];
  9. graph2 = ParametricPlot[Evaluate[
  10.      {x[t], p[t]} /. sol], {t, 0, T}];
  11. Show[GraphicsArray[{graph1, graph2}]]
View raw paste Reply