MATLAB Implementation of AVI
I work with AVI in my research so I have included a MATLAB implementation of AVI for the 1-D harmonic oscillator. The code will solve the equation a + gamma * v + (k1 + k2 + k3) x = 0 with any initial conditions x(0) and v(0). Here the spring constant has been artifically split into three spring constants to simulate multiple potentials. If there is only one potential AVI simplifies to the usual Velocity Verlet integrator. The friction term is absorbed into the k1 term in the implementation. The main idea in the implementation is to construct the propagation matrix for the system (x,v) for the different potentials.