Artificial intelligent assistant

Numerically solve Lotka-Volterra equations using Euler-Cromer I am trying to solve this coupled pair of equations $$ {dx\over dt}=\alpha x - \beta xy,\\\ {dy\over dt}=\delta xy - \gamma y $$ using the numerical method Euler-Cromer. It doesn't matter which method, as long as it is symplectic. But I'm lost on how to use this method for a system that doesn't have a Hamiltonian (or does it?), at least isn't mechanical. Is it possible to solve this using Euler-Cromer? I am looking for something like a recurrence relation so that I can calculate each new value from the old. Best regards //

As $$ \frac{dx}{x}(δx−γ)=\frac{dy}{y}(α−βy) $$ there is indeed a first integral $$ F(x,y)=δx-γ\ln|x|+βy-α\ln|y| $$

Taking this as a Hamiltonian for a potentially different time scale results in the system \begin{align} \frac{dx}{ds}&=-F_y=\fracαy-β&&=\frac{αx-βxy}{xy}\\\ \frac{dy}{ds}&=~~~F_x=δ-\fracγx&&=\frac{δxy-γy}{xy}\\\ \end{align} so that for $xy>0$ the relation between the time scales is $\frac{dt}{ds}=\frac1{xy}$ To this Hamiltonian system you can apply the symplectic Euler method, which should yield orbits that are closer to closed than the simple application of Euler. With some more effort in the initial step one can easily modify this method to leapfrog Verlet, which has even better theoretical properties. To get not only the curve but the solution, you also need to integrate the equation for $t$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy bdf78bf8b8fa662c5420eb4070c656dd