I was just doing some practice questions for a test, but have been stumped by the following for the past couple of hours.
I'm given a system such that: $$\frac{du}{dt} = v ~ ~ \& ~ ~ \frac{dv}{dt} = -f(u)$$
with Hamiltonian $$H = \frac{1}{2} \left(\frac{du}{dt}\right)^2 + \int f du.$$
I have to show that using the forward Euler method leads to a global error for $H$ that grows like $nh^2$ for step size $h$ and number of steps $n$.
I know that the global error can be calculated via $ \epsilon = |U^n - U(T)|$ but I'm not sure how to apply it in this case.
Thanks for any help!
EDIT: So if I understand correct, I have to calculate $|H_{n+1}-H_n| $