To understand the global assembly, let's have a look, again, at the one of the early equations that we have deriving the whole system. We basically, remember we have two levels of discretization. One is we divide everything up into elements, Ne. Then, inside the elements, we sum over basis functions Phi i. So, this is another level of discretization. Now in the end, there is a sum over all elements, and we have integrals that are defined locally. We call this local domain, D sub E. Now, what that means, basically, is that in the end, we have to on the whole set of points, we're going to actually sum up the values at the element boundaries. And I want to illustrate this first graphically, and then, mathematically. So, let's make an example. Here, you see an example of a discretization using four elements. We also assume an order N equals four. That means each element actually has five collocation points including the boundaries. An important aspect of the finite element or spectral element method is actually that two elements share the same point. They have the same value. So from this graph, we can also derive the overall number of points in general, for a, in this case, an example with four elements and n equals 4, and 5 collocation points. But you can count one by one and you can see it's overall, it's actually 17, but of course there is a general formula that I would like you to derive. And just to think about in general, use the number of elements and e, and the polynomial order and come back with the number, the global number ng of collocation points. This will be the size of our vectors and matrices. So, I'm sure you found out easily, of course the number, global number of points nG is equal to number of elements times polynomial order n plus one. Now again, this we will be the size of our matrices and vectors. And you can imagine that one dimension that's usually not a problem, but if it's in two-dimension or three-dimension, the size could be huge, because today, on supercomputers and parallel supercomputers, we have up to hundreds of millions or billions of degrees of freedom. And as you can imagine in this case, actually, it would not be possible to write down or even define these vectors and matrices that simply like that on the computer, but that's not the issue here. Now, let's look at how this global assembly work graphically. At the top, you see again, the discretization into four elements. And with an order N equals four. And as a first example, here's the way the mass matrix will be assembled globally. Of course, the mass matrix is diagonal. And now, what we have is basically sub matrices of size N plus one times N plus one, where capital N is the order of the polynomials for the Lagrange polynomials that we that we're using. Now, these matrices will overlap at one point in the mass matrix and the global mass matrix. And that's basically those are the boundary points. And at this point, we will show this later in the mathematical form. It's simply the sum over the value of inside one element plus the value of the adjacent element. The mass matrix is shown here in matrix form, of course, on the computer would never do that. You would not initialize it as a matrix. That's not necessary. You would initialize it as a vector. Now, the stiffness matrix is the next example here, where now, again, the sub-matrices and these submatrices of full are N plus one times N plus one matrices for each element. And again, they overlap at one point where the values are added up. And so, this is graphically the way the assembly works. It works exactly the same for the for the force term. And now, let's have a quick look at this also from a mathematical point of view. To show this mathematically and such that it so that it fits on the page, we now reduce the system to three elements and take order N equals 2. So, we have three by three matrices for each element. Now, the mass matrix is the first example here shown of course as a vector because its diagonal. And you can see that the third term from the top, which is the first element boundary, basically, the two values from the first and the second element are simply added. The same holds for the stiffness matrix where we have seen this graphically. Basically, the edges of the sub-matrices are added up. And this same principle holds for the fourth term where we basically, also simply, add up the values at the element boundaries. So, all these matrices and force vector, we can now put together and come up with a final extrapolation algorithm for the global system of equations. And that's given here. It basically looks exactly the same, as the solution for the linear finite element schemes simply now, the numbers of degrees of freedom depends on the order of the Lagrange polynomials inside, we've just calculated that. That's the Ng or the subscript G here stands for Global. And Ng would be the overall number of points, collocation points on the whole physical domain. So just to recall, the displacement vector now would have Ng elements. The mass matrix, of course, it's written as a vector would be Ng times Ng. The stiffness matrix would be Ng times Ng. And the force vector also would have Ng elements. Now again, I really need to stress, It's very nice to write this spectral elements system in this compact equation. And also, in one-dimension we can actually solve it exactly like that in our Python code. It looks basically just the way we write it here. But it's important to note, this is not how you would do it eventually for a very large system of equations in two dimensions or in three dimensions. That's beyond the scope here. Here, we simply want to illustrate how the spectral element method works, but that's nice. We can now, basically, take that equation and write it like that in Python, and solve our simple wave equation problem.