explicit Euler methods : is there a way to correct the gain of energy

468 Views Asked by At

Is there a way to insert a correction term in order to counterbalance the gain of energy due to the explicit Euler method ?

In particular, let's assume I know the total energy $E_0$ of my system at time $t=0$ (due to the initial conditions). And the energy is defined locally at time $t$ on a grid which is of total size $N^2$ : $e(i,j,t)$. Would it make sense to correct at each iteration (time $t$): $e'(i,j,t)=e(i,j,t)-\frac{\sum_i e(i,j,t) -E_0}{N^2} $ ?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, you can use a symplectic Euler method to solve the Hamiltonian system $$ \dot{p} = - \nabla_q H(p,q), \quad \dot{q} = \nabla_p H(p,q).$$ One example of a symplectic Euler method is given by $$ p_{n+1} = p_n - h \nabla_qH(p_{n+1},q_n), \quad q_{n+1} = q_n + h \nabla_p H(p_{n+1},q_n).$$ Observe that we must first solve for $p_{n+1}$ before $q_{n+1}$ can be computed. This symplectic Euler method has order $1$. It preserves the total energy of a system which is $O(h)$ away from the system which you are trying to simulate, i.e., your total energy can fluctuate, but only a tiny bit and the error does not grow over time.

It is vital that you do not try to repair your simulation by adding or subtracting energy. How to best understand and remember this forever? Consider the inevitable rounding errors done during floating point calculations. Adjusting the total energy to "compensate" for rounding errors at the end of each iteration amounts to representing the errors as the result of an outside force acting on your real physical system. This is not acceptable, because there is no such force!

The explicit Euler method is "bad" for systems where the preservation of energy is important. The symplectic Euler method or a higher order symplectic method should be used instead.

A great reference on symplectic methods is the book by Hairer et al. "Geometric numerical integration". This is a graduate textbook which requires a solid background in mathematics, but it comes with some very fine examples and clear illustrations.