[MUSIC] Okay, let's have a quick detour to ask the question. What happens if we have boundary conditions at the end of the domain D, so basically at x min and x max? So let's write this down using our basis function, simply imposing these values at the boundaries. That would be index 1 and index N, and as you can see, we basically just multiply the value there with the equivalent basis function. Now, if we inject all of this into the weak form of the equation that we're solving, the static problem that we're solving. And we've put this to the right-hand side. You can basically see that the left-hand side is now looking, in terms of structure, exactly the same as before without boundary conditions. And on the right-hand side, we have the forces plus these additional terms. And actually that means the boundary conditions act to some extent like forces. Now let's look at this graphically. We show here the matrix vector system of our equation that we're solving. And you see that we have the K matrix multiplying the vector of the displacements. And on the right-hand side, we now have the force vector. But as you can see at the first element and the last element there, now we now have nonzero terms. Does the standard forcing would here in this example be in the center? And that just serves to show again that basically these boundary conditions now act, in principle, like additional forces. So that's very handy, and we're going to use that later in our Python example to show how this works in a simple example. Just one more point, as you can see in the graphics here, basically now we're solving a system that is reduced. Because of course, we do not have to ask what is the value of u at point 1, at point N. So we're actually solving a matrix system that's now slightly reduced, which, of course, makes it easier to solve. So now let's get back to these terms that are inside our weak formulation, the stiffness matrix. Actually, to calculate this matrix, we now make use of something that's elemental in the finite element method. We're actually transforming the coordinate system in space locally to the element. And that means basically then we can apply exactly more or less the same way of calculating these integrals that we need to calculate for each element. Now we define a new variable, that's xi, a funny, curly-looking Greek letter, equals x- xi. And that also means we can define the size of the element here is very easy. It's one-dimensional, which is h subscript i is equal then to xi- xi-1. In this case, this will be very general, so the element size could vary. In this example that we now do, we'll actually keep the element size constant. So with this, we can now basically rewrite the definition of our basis functions, and you see this here. It's now containing the element sizes, hi or adjacent hi- 1 or hi + 1. And equivalently, we can also define, write down the mathematical expression of the derivatives of those basis functions now with respect to xi. Which is, of course, very simple. There will be constants depending, of course, on the size of the elements. And that's basically all we need now as ingredients to calculate analytically this stiffness matrix, and that will be the next step. So we can now write down the integrals for the stiffness matrix, Kij. You see here that's mu multiplying the derivatives of the basis functions first in the x-space. And we can now move to the transformed domain, basically the elemental domain, using the coordinate xi. They look exactly the same, except that remember that if you do a coordinate transform for an integral, you have to calculate the Jacobian. In this case, it's 1, so this is why they basically look exactly the same. Before proceeding to calculate individual elements of the stiffness tensor, let's look at this in a more graphical way. What we expect, what's the shape, and which elements will be nonzero, which elements will be 0. Now here you can see, in this graph, the basis function directly for element i, and this is a solid line. And next to it, actually the i- 1, i + 1 basis functions in a dashed line. And also below, you can now see what we actually need for these stiffness element calculations, the derivatives of the basis functions. So they all overlap only from i to i + 1 or i- 1. So what that means is the whole matrix, Kij, will actually be banded. So it will have a band around the diagonal. And all other elements of the stiffness matrix will be nonzero. And now let's actually do some calculations and estimate or calculate these elements of the stiffness matrix. So let's start with K11. In the local coordinate system using variable xi, you can see here that we need to integrate over the derivatives with respect to xi of the basis functions. Now, just looking into the previous definition, we've already calculated that. We also note that we only have to integrate between 0 to h. Even though in principle, we integrate over the whole domain, the only part where we have a nonzero contribution is between 0 and h. So if we solve those integrals, it's very easy to see that we end up with a value mu over h. So let's make a next step, K22, what about K22? Now, if you look at this in space, graphically, you will see that actually we'll have contributions from -h to 0 and 0 to h. We cannot integrate over the element boundaries. Because there, the derivatives are not defined, that's quite obvious. So we have to separate this out into two integrals. And again, solving those, very simple, we obtain here actually 2 mu divided by h, and so that's a diagonal element. Let's look at one more example, which is an off-diagonal element, K12. Again here, for obvious reasons, we actually only have to integrate once, only one integral domain, and we obtain -mu over h. Now, if you put all this together, and we leave this also to an exercise, you can now create very simply the whole stiffness matrix. And if you look at this, you might be surprised. It's actually mu over h multiplying something that probably looks very familiar. Actually, it's the same numbers, like the second derivative finite difference operator. And that actually is an indication how, in the end, similar the finite element method in the linear approximation is to the simplest finite difference approximation. And we'll see this later in the Python code.