[MUSIC] Hi and welcome again to our class simulation and modeling of natural processes. The present module is about the time-integration of the equations of motion in the system of many particles or many point-like objects. The principles of the time-integrations are as follows. We discretize the time axis into discrete steps which are spaced from each other with regular intervals of size delta t. The system is going be iterative and it will iteratively take the numerical scheme, the numerical system from time t to time t + delta t and then to time t + 2 delta t, and so on. At every moment in this inter-iterative scheme, the state of the system is defined by the position of each point-like object in the system and its velocity. Newton's second law provides us with the acceleration, acting on the object, on the each individual object, because acceleration is proportional to force. And the forces in our system will depend on the relative positions of the particles or other point-like objects, with respect to each other. There exist many numerical schemes to integrate the acceleration and to find the time evolution of the system. I will introduce one very commonly used scheme which is called the Verlet algorithm. It is both efficient and accurate, and therefore commonly used in this domain. I will first take a historical standpoint and describe the first version of this algorithm which was described by the physicist Verlet, who wanted to use this algorithm to simulate molecular dynamics. Which means a system of many objects at nano scale, molecules which interact with each other. In this original version of the Verlet algorithm, the velocities of the particles are not stored at all. Instead, the positions of all particles are stored at two moments in time. In this key in which I am showing you here, we store the position of all particles at time t- delta t, and at time t. From Newton's law we get the acceleration acting on the particles or point-like objects at time t. Because given all the positions, we can calculate the forces acting on them. Depending on the physics at hand, it could be a gravitational force or it could be a Lennard-Jones potential or any other kind of force. Once we know the acceleration, we use an omega approximation to predict the value of all positions at time t + delta t. This is done by means of a finite-difference scheme. Which I approximate the value of the acceleration at time t, with second order accuracy, by using the position of the particles at three moments in time. At time t- delta t, at time t, and at time t + delta t. The acceleration is proportional to the inverse of the discrete time step squared times the sum of a particle's position on time t + delta t and t- delta t- twice the value of the position of the particle in the middle at time t. This scheme quite efficiently simulates the time evolution of a system. However, it is prone to numerical error because the time step delta t can be very small. And if you take the square of the time step delta t, you get a value which is even smaller. So in this system, we are comparing values like the position of the particles, which can be quite big. And the value which is the square of the time step, which can be very small. Numerically this is very challenging and is prone to error. Therefore, this scheme is not used very frequently. However, let's go on and see how this acceleration is used. The acceleration, well it's actually a quantity which we already know, we got it from Newton's second law. The only value which in this system is unknown is the position of all particles at time t + delta t. We are therefore going to resolve this system for that value position at time t + delta t. Consequently, the position which is this position of the system at the next time step, is proportional to the square of the time step times acceleration + twice the position of the particles at the current time + the position of the particles at the previous time. Once this is done, one iteration of the system is done. And we keep in memory, again, the position of particles at two consequent time step, in this case, at time t, and time t + delta t. And then we reiterate the same algorithm over and over again. As I said, it is an efficient algorithm, which however is prone to numerical error. Therefore the physicist Verlet proposed an alternative version of the scheme, in which only scale and multiplication with the time step delta t is used. This scheme is also known as the leap-frog algorithm. We usually call it the Verlet algorithm because the physicist Verlet was the first one to apply it to the domain of molecular dynamics. However, it is a quite obvious scheme which has been used many times before in past centuries already. The idea in this model is that we do not represent the position and the velocity of particles at the same moment in time. The position of the particles is defined at full time steps. At time step t, t + delta t, t + 2 times delta t, and so on. Whereas the velocity are defined at half-interval times. t + one-half delta t, t + three-half delta t, and so on. When you write a computer program this doesn't mean that the variables are implemented at a different moment during the execution of the program. They are just normal, usually defined variables. But the value they represent is interpreted to represent a quantity at different moments in time. Either at time t for the position, or at time t + one-half delta t for the velocity of all particles. Now we use again a finite-difference scheme to approximate the quantities which we have here with second order accuracy. In this case, given that the velocity is defined at half interval position between time t and time t + delta t. We can say that with second order accuracy the value of this velocity is just equal to the position of the particle at time t + delta t- the position of the particle at time t. As before we now solve the system for the only quantity which is the unknown one. The position of the particle at the next time step t + delta t. This means that the position of the particle at time t + delta t is equal to its position at the previous time step + the discrete time step delta t times the velocity at half interval time t + a half delta t. This is called the leap-frog algorithm, because the position jumps over the velocity from time t to t + delta t like a frog. We have used this the leap-frog algorithm to integrate space from time t to time t + delta t by jumping over the velocity. We will use the same scheme to integrate now the velocity because, to get to the next iteration of the scheme, we need to know the velocities of the particles now at time t + three-half delta t. In this case the velocities are integrated from the acceleration. We know now the position of the particles at time t + delta t. Which means that from Newton's second law we can calculate the forces and the acceleration at time t + delta t. And reintegrate the velocity by jumping, leap frogging over this acceleration as we did for the position. The exact same scheme says that the velocity at time t + three-half delta t is equal to the previous velocity at time t + one-half delta t + the discrete time step delta t times the acceleration at time t + delta t. Which we computed from Newton's second law from the previously computed positions. This algorithm is very efficient to implement numerically because it just involves a few additions and multiplications. When you treat a system with many interacting particles, this numerical efficiency is crucial. And this is why the Verlet, or leap-frog algorithm is very commonly used in this domain. This ends our module on the time-integration of the equations of motion. Stay tuned for the next module. [MUSIC]