# Thread: Advance numerical solution of differential equations

1. ## Advance numerical solution of differential equations

Given the equations for the harmonic oscillator
$\frac{dy}{dz}=z, \frac{dz}{dt}= -y$

if the system is approximated by the symplectic Euler method, then it gives

$z_{n+1}= z_{n}-hy_{n}, \\ y_{n+1}= y_{n}+hz_{n+1}$

which shows that the circle $y^2_{n} + z^2_{n} = 1$ is mapped into an ellipse.
Deduce that to order $h^2$ the ellipse has the same enclosed area as the circle.

=> my attempt so far
in this case, area of ellipse = area of circle.

Truncation error from the symplectic euler method gives

$hT_{z}= h(z'+y) +O(h^2)$

$hT_{z}= O(h^2)$ since, $h(z'+y)$ goes to zero

$T_{z}= O(h)$

Similarly,

$hT_{y}= h(y'-z) +O(h^2)$

$hT_{y}= O(h^2)$ since, $h(y'-z)$ goes to zero

$T_{y}= O(h)$

Both have first order
did my answer satisfy the question?

2. ## Re: Advance numerical solution of differential equations

maybe this will help, maybe not. I confess I can't follow what you're doing and why.

if you look at your system you find you have a transition matrix

$T=\begin{bmatrix}1-h^2 & h \\ -h &1\end{bmatrix}$ such that

$\begin{bmatrix}y_{n+1} \\ z_{n+1}\end{bmatrix}=T \begin{bmatrix}y_n \\ z_n\end{bmatrix}$

When h is very close to 0 the trajectory is very close to a circle. As h increases the trajectory becomes an increasingly eccentric ellipse aligned with $y=z$.

The area of the circle $y_n^2+z_n^2=\pi$

The area of the ellipse generated by T is $\pi$ times the product of the eigenvalues of T.

You can compute these and show what the problem asks.

3. ## Re: Advance numerical solution of differential equations

correction to below

The area of the circle $y_n^2+z_n^2=1$ is $\pi$.

The reason the the area of the ellipse is the product of the eigenvalues times $\pi$ is that the eigenvalues are the lengths of the semi-major and semi-minor axes and their product times $\pi$ is the area of the ellipse.