[MUSIC] Welcome again to this third week of the class, Simulation and Modeling of Natural Processes. In this module, we will talk about the discrete dynamical system and an example which is the random walk. So random walk can be used to model many different kind of processes. It can be the Brownian motion of particles. It can be drunk people. It can be really a lot of physical phenomena. So how do we describe a random walk? So here, we are in two dimensions, so we have two state variables, which are the x position and the y position of our particle. This particle will be able to move in X and Y direction with velocity VX and VY respectively. So a teach times step will add to our position. Delta T times our velocity. The velocity is chosen in a set, which is basically velocity directed towards north direction, west direction, south direction, and east direction, as well as with the rest velocity which consist in not moving at all. The displacement is made upon to a velocity which is chosen randomly with equal probability in this set. So each one of these jumps will be made of a space increment which will be delta x for jumping x direction, and delta y for jumping y direction. So let's see an illustration. Suppose delta were a particle at time t equal to 0 is located on position x0,y0 so on the red dot on the left picture. Let's also assume that delta x is equal to delta y. So the space between two great points is delta x. So on the right image of this slide, you see the possible displacement in one delta t of our particle. So it can jump. North, south, east, west, or stay in place. Each of these movements has an equal probability of happening, and this probability is one one-fifth. So now, suppose that we draw our random number and we decide that the particle moved on the right. So then we start our choice process again as depicted on the right image of the slide, and so on, and so on. So for our particle after ten jumps we reach a possible situation as depicted on the left of our slide. Of course each time we play this game again we start with a new particle, the trajectory of our particle will be completely different as depicted on the right image of the slide. So here you have three different particles, one red, one blue, and one green, and each of them has its own trajectory, which is completely random. So now one natural question will be, what happens to on average with the position of our particles? So where, will they end on average? So let's try to answer to this question. To do so, we assume again that the initial position of our walker is on x(0), y (0) and we want to know the position of our walker, one walker after a time(t) which is equal to N times, delta. So, let's first write x of t for one walker. So x of t is by definition equal to x of t minus delta t plus delta t times the velocity in the X direction. Then we use this recursive definition for our random walker and x of t minus delta t can be replaced by x of t minus two delta t plus delta t times vx of t minus two delta t and we continue like this using our recursion. And we end with x of t, which will be equal to the initial position x0 plus delta t plus the sum of all random velocities we'll have between the zero and t equals n times delta t. So this is the x position for a unique walker. Now what happens to the x position when we use many walkers and we compute their average position. So we just take the average of the previous formula and we get the first formula in this slide. So the average of x(t) is equal to x0 plus delta t plus the sum of the average of our sum of the velocity. Of course, since vx is chosen randomly, and these random numbers are not correlated, they are statistically independent, and the average value of vx will be zero. Therefore, we end with the average position of x of t is equal to x zero. So what does this means is that on average if you draw a huge amount of these random workers and you compute the average position they will not move. So, the trajectory is this will be made in such a way that on average they will be, it's not they will not move, it's that their average position will be on the place were launched of. Okay, so now to come back to how they will move. We can compute the average displacement, so by how many will they move? Actually, before coming back to the initial position, so this can be computed by roughly the root mean square of the position. So on the first equation, distance is the square root of the sum of the RMS position in x and y direction. So let's just look at what happens in IMS of the x direction so we want to come to the average of x of t minus x0 squared. Again, we use the formula we divide for the to slides ago for x of t, and we have this recursion which is reflected here by this double sum. So we will sum the average of dx of t minus m delta t, and dx of t minus n delta t over m and n, and multiply the result by delta t square, and this will give us the displacement in the x direction. So again, we have statistical independence, so vx (t- m delta t) vx (t- n delta t) = 0 if m is different from n. Now what happens if m = n? Since we have one fifth probability of jumping to the left, plus one fifth probability to jump to the right, and three fifth probability to stay put the total of our probability to jump and have a displacement is two fifth times the jump squared. So let's use this formula in the expression for dx squared and we see that we can split our double sum in two parts. The first one is the part where m is different from n, so this part will be null. This is the left term on the right hand side of the equation. The right term of this equation, we just computed it and it's two-fifths of delta x squared over delta t which must be summed over m equal 1 to n. So this will add a term t, so the final result that we have is that the mean square displacement in the x direction is t times 2 delta x squared over 5 delta t. Now we just do exactly the same for the y direction and we end up with the formula that the displacement is equal to the square root of t times 4 delta x squared over 5 delta t. So this means that the mean displacements, or the mean distance that will be traveled by each particle is proportional to the square root of t times a constant. So this concern can be related to a concern whether using physics, which is a diffusion coefficient. So, if we define the diffusion coefficient here as delta if square over 5 delta t. We have first the distance will be equal to square root of for d times t and also that on average, the dynamics of our system will be equivalent to a diffusion equation that you see on the bottom of the slide. So the time derivative of rho, each proportional to the of rho and the professionality constant is d. I will talk about this equation a bit in a later modules. So let's see what's simulation of this system mean. So we took we put all our particles so our random workers starting from the same point will let the system evolute for a time, t equals 100, delta x and delta t equals to 1. So, we can compute a diffusion coefficient and an average distance travelled by our particles. So let's have a look at what happens when we increase the number of particles. So on this slide, on the left, you have a map where we let our N particles evolve and record the N position. And then, if we have more than one worker on this position, we add this number. So, the map on the left is the number of workers per cell. On the right, you have an analytical solution of the diffusion process happening when you have a huge amount of particles located on a single point at an initial time. So what you see is that, for a small amount of particles, the two systems are not at all the same. So we have a really discrete world on the left and a continuous world on the right. Furthermore, we can see that the result for this particular simulation is that the distance traveled is already quite close to our analytical solution and the average position is not too bad either. So what happens when we increase the number of particles? Here we see with 1,000 particles we start vaguely seeing some circular shape of our distribution of particles after some time. And if we continue increasing the number of particles, we see that we are starting really to converge towards the continuous solution, so the equation. If we now go to 100,000 particles, we see that the images are almost the same. And we also see that the average position and the distance traveled are almost the ones predicted by our analytical computations. So with this I end the random walk module, and in the next module I will talk to you about continuous dynamical system which will be illustrated by the growth of population. Thank you for your attention. [MUSIC]