Welcome back. What we worked out in the previous segment was the form of the stiffness matrix for a general element. We proceed now with getting together the other parts of our matrix vector version of the finite dimensional weak form. And the first thing we have to do is carry out a similar equation for the forcing function. That is, the, the, the distributed body force. All right? So let's start with that. So, we will next. Consider. The following term. Integral over omega e W,h,f,A,d,x, all right. No gradients in here so this actually becomes somewhat simpler integral to calculate. So integral over omical e. For wh we have sum over a. Na, Cae. And we'll put parenthesis around here to remind ourselves. This is what wh is represented as. We have f, A dx now. Because we know that N A ultimately is represented in terms of C, that is the coordinate in the by unit pairing domain. And because we know that we have availability, we have available to us this map. Right? For the geometry, isoparametric map. What this tells us is we can very well write this as an integral now by changing variables as an integral omega X C. Sum over A, C A E. The reason we can do that is, what? Reason we can pull C A E out of the integral because of course it is just a degree of a freedom that is used to build our Representation of the waiting function, it does not depend upon C, right, or does not depend upon position, so we are able to pull it out, just as like, just as we've been doing all along. All right and remember that this sum runs A going from one to three, right, for three nodes in the element. All right. We have C A e. N, A, f, A. Now, the integral over dx can now be written as dx, dz, dz. And of course, we remember, from before, something we calculated a couple of units ago. dx, dc is he over 2. All right? We're going to go ahead and build this integral. And in order to build it, let us just, just in order to be able to fix ideas, and get something that we can compute. Let us consider the situation where f and A are uniform, right? They're uniform over Omega E right? Over the element of interest. What this allows us to do is to pull f and A as well out of the integral. And h e is of course the element width, which is independent of. Right? So what that tells us is that what we're trying to compute from up here, right? I've represented it in here in dots with ellipses. This is sum A equals one to three CA e Times FAHE over 2, integral minus 1 to 1, NA, DZ. Right. Now, just as we did before, in the case of linear basis functions, and just as we did in the previous segment in order to compute the left-hand side integral. Right? We go now to matrix factor notation. All right. So, what we're trying to compute on the left hand side, right? The integral that comes from the top of the slide is now represented as c1e, c2e, c3e, using vector notation for representing our degrees of freedom of our waiting function over the element. Times F A H E over 2. Now, we get a vector here. Right? And this is integral. The first component here is integral minus 1 to 1. N 1, right? And, 1 however, we already know, is one half C times C minus 1 d C. And, 2, the, the integral from N 2 is integral minus 1 to 1. Or the integral from, ga. The integral for component 2 is the integral minus 1 to 1. Of n 2. Which is one minus xi squared d xi. All right? And the third component is integral minus 1 to 1 one-half C times C plus 1 dC. All right? Okay. We go ahead now and compute those integrals. They are relatively straight forward to compute. Let's do that. We get our C vector for the element. We have F A h, e over two because f and a, we are assuming are uniformed and for our integrals we get here first, we get one half of c cubed over 3 limits minus 1 to 1. For the second one we get c Minus Z cubed, over 3, minus 1, 2, 1. And for the third, we get one-half, Z cubed, over 3, also minus 1 to 1. Right. When we compute result, we see that we are left with c1e, c2e, c3e, fAhe over 2 and here, we get 1 over 3, 4 over 3, 1 over 3. Right. Okay. So this is our general representation of the contribution from the right-hand side forcing function term, for a general element, okay? What we're going to do now is go to assembly, right? So, assembly. Of global matrix vector equations All right. Now, it's worthwhile just in order to position ourselves to recall that what we're attempting to do here is actually carry out an integral over the entire domain. Right, over our entire 1D domain. And, we've used this partition into elements to write that as a sum over element integrals. Of that term, that element integral. Equal to the sum over elements of that element integral. Plus a term which arises from the fact that we have a, what kind of a boundary value problem do we have? We have a, there [INAUDIBLE] boundary value problem. Right? So we are WHL times T which is the attraction times A. Okay? So, this is our, finite dimensional weak form expressed as a sum over element integrals. And we've just, over the previous segment and over the first few minutes of this segment learned how to compute this integral, in the last segment, and that integral, in this segment. For general elements. Okay? Okay, now, in order to carry out the assembly, we just need to recall something. Okay? We need to recall. That for the Dirichlet Neumann problem. Right. Because we know that u h add 0 equals some given value which actually is equal to 0 in this case. Right? What that implies for us is that w h at 0 is also equal to 0. All right, because we have a tertiary boundary condition at x equals 0. We also have a homogenous tertiary condition on the waiting function. Of course, it turns out that our tertiary condition on the left hand side, on x equals 0 is itself homogenous, meaning we are saying that the trial solution there has to be 0. Okay? Even if it were something other than 0 not, if it were non-zero, we would still have a homogeneous Dirichlet condition on the waiting function, right? And that's just the nature in which we built our waiting function, okay, the function's base, in fact. All right, so what does this mean? What this implies is that for element 1, okay? Because w h at 0 is equal to 0, we construct w h e equals 1 as sum A, not starting with 1, but starting with 2, to number of nodes in the element, which is 3. Okay, so we have this. N A C A e. Okay. And in fact, going from local to global numbering of degrees of freedom, we will get here here is what we get. Okay? Here is what we get, because of the fact that we can go from local to global numbering of nodes, here's what we get. When we right out our matrices, right, matrices and vectors coming from our weak form, here's what we will get. We will use the fact that this thing can be written explicitly as N2 times c, 2e plus N3, c 2e plus 1 for e equals 1. Okay, we're going to use this. Where do we use it? Here's what we get. Right, our global equations for the matrix vector weak form. Okay? They take on the following form. For element e equals 1, we have something a little special, right? We have here c 2 e, okay? C 2 e, plus 1. Okay? This is for e equals 1. Okay. In fact, let me do this. Let me explicitly use the fact that e equals 1 here. When I do that, c 2 e becomes c 2, and c 2 e plus 1 becomes c 3. Okay, we have 2EA over h1. Okay? We're assuming here, of course, that E and A are uniform or not only over each element, but also between elements, right? Effectively over the entire domain. There is nothing preventing us from developing the more complicated formulation where E and A are allowed to vary with position. Okay? All right. Now, what we get for the matrix contribution here is a matrix that is not square but has only two rows. Okay, and in fact, that matrix has the form minus 4 over 3, 8 over 3, minus 4 over 3. 1 over 6, minus 4 over 3, 7 over 6, okay? Multiplying it here, however, is the full d vector for that element. Okay? That would be d1 in terms of global, no numbers, d2 and d3. Okay. That's all for element one. Okay, and note that I called that h, h1 or e equals 1. Thus, plus now, sum E equals 2 to number of elements. Here things look the same. 2e minus 1, the same as for general element, c2e minus 1, c2e, c2e plus 1. 2EA over he. Our matrix, which we developed in the previous segment which is 7 over 6 minus 4 over 3, 1 over 6, 8 over 3 minus 4 over 3, 7 over 6. Completing bisymmetry. All right, all of this multiplying here, d2e minus 1, d2e, d2e plus 1, right? Global numbering of degrees of freedom and nodes. Okay, so those terms together, that's this one, for the first element and this for a generic other element give us our left-hand side. This is now equal to, okay? The right-hand side. Again, the same thing happens with the forcing function contribution, okay? So we get for the c vector, for the forcing function contribution, again, we get c2, c3. Okay? The contribution here is fAh1 over 2. And it multiplies a vector which is just 4 over 3 and 1 over 3, 'kay? The first element, the first entry, the first component from the general form of the factor that arises from the forcing function is absent. Because in element one, we start with that global degree of freedom. Because the weighting function satisfies the homogenous Dirichlet boundary condition. All right, we have this plus, sum over e equals 2 to number of elements. C2e minus 1, c2e, c2e plus 1, fAhe over 2. Now we get the full form of this vector 1 over 3, 4 over 3, 1 over 3. In addition, let's never forget the Neumann boundary, too. Right. Which is wh at l. But that is simply c2, nel plus 1, times tA, okay? That's it. That's really our weak form written out fully in matrix-vector notation.