next up previous
Next: Two dimensional trajectories Up: Equations of motion (2nd Previous: Exercise 1.5: Gravitational force

Exercise 1.6: Harmonic oscillator

The two coupled first order equations

\begin{displaymath}
\frac{dy}{dt}=p; \frac{dp}{dt}=-4\pi ^2 y
\end{displaymath}

define a harmonic oscillator with period $T=1$. Compute the position $y$ and momentum $p$ as a function of time using a generalization of the previous code. Plot the results for $y_0=1$ and $p_0$=0. Investigate the accuracy with which the system returns to the initial state at integral values of $t$.

Figure 2: Object in a two dimensional trajectory under the effect of gravitational and dragging forces
\begin{figure}\begin{center}
\epsfig{file=forces2.eps}\end{center}\end{figure}



Adrian E. Feiguin 2004-06-01