[Slide 1] Hey everyone, welcome back.
So this Lecture 4.8, so now we're going to actually explain within the context
of the finite element method how to use what we call the Galerkin method.
Specifically in order to minimize the error of finite element solutions.
And so we're going to actually take an example that comes out of mechanics,
not because we necessarily only want to do mechanics, but
just because it's probably the most intuitive to understand.
So think about, for now, like a wire, okay?
And so if we have a wire, then of course a wire is subject to Newton's Law just like
any other mechanical object.
And so we can actually write down the solution for f equals ma in this form.
So basically here, our two forces that are impacting the wire.
One that's basically coming from the curvature of the wire,
creating some tension.
And then we have q, which is essentially like a uniform force, maybe from gravity,
or so on, that's applied to the wire, is equal to the mass density, mu,
times the acceleration in the y direction, which is the second derivative of w.
Okay, so that's, again, w.
This is the drawing from Peter Crystal's book that kind of shows how this works.
And then in static equilibrium, of course, the forces should cancel.
So basically mu w dot double dot is equal to 0, so then we get this.
And then we can try to solve this problem in static equilibrium
by defining a residual error in the static equilibrium case,
which would basically be taking this term, and
then measuring our solutions deviation from this being 0.
Okay, so this is just kind of showing what is the set up, and
what is the balance of forces.
So now we said we want to apply the Galerkin Method to this kind of problem, so
now we're going to create what we call a set of trial functions.
And so then the trial functions will actually multiply this residual error at
each point, and then we're going to insist that integrated over the whole interval,
that the trial function times the residual error function should integrate to 0.
Okay, so that's basically our condition.
So the way you can kind of think about it is that if we had a balloon,
and we want to stuff it into a box, okay, which may sound a little funny.
But then, it would be kind of hard if we just pushed it on one end, right?
This is a big box.
We're pushing the balloon on one end.
It's not going to go in, right?
It's going to be sticking out on the other side.
But if we actually use a lot of fingers,
then we can actually probably push it more successfully into that box.
Maybe it doesn't fit perfectly, but it will fit much better at least.
And the more fingers we have, maybe we call over our friend.
Our friend also provides some fingers,
we also can stuff it into the box more accurately.
So that's essentially what we're trying to do with these trial functions.
So each of these trial functions is a finger that's kind of
pinning down our balloon into where we want it to be.
So that basically corresponds to integrating the residual error out to 0.
And so now we can actually write down the explicit form of the residual function,
which here was the static equilibrium problem P
times second derivative of w plus q, okay?
Where q is like static force, P is like a tension of the wire.
And so then we can actually integrate this expression by parts.
And so, as you can imagine, that reduces the number of derivatives on w by 1,
so you have eta j times P, dw dx integrated from 0 to l.
And then we also are left with two terms.
So you have eta j times q, and then minus the first derivative
of eta j with respect to x times P times first derivative of w with respect to x.
And so we can actually probably assume that the boundary terms will vanish.
Like if our fingers basically have no application on the edges, so
we don't put our fingers on the edge, then that's pretty easy to achieve that.
And then we can substitute a linear basis for w.
So you can just write w as the sum of wis.
So then that leaves us basically with this second term up here,
since this first term vanished.
And then we have for this term,
we actually have something that looks like this, where the first derivative
in w becomes like a first derivative in ni, and wi is just a constant, right?
And so, we can actually re-write this whole thing as basically
this first term as being b, and then this set of terms here is being k ji for
example, because there's a eta j here, there's eta j here.
So you can write it as kji times wi.
And so of course you know in Einstein's notation,
if you repeat a index, then that's like a summation.
So you can actually think of that also as a matrix multiplication.
And so then we can write b is a common factor, and then k is a square matrix or
rectangular matrix, and then w is again, a common vector, right?
So, of course eta j and wi have different coefficients, but
the k is basically allowing us to match up one to one, all of the terms.
And so, of course, like I said before, if you have more fingers,
so basically more js, then that's going to give us a better solution.
But we basically now have everything like we're in a linear algebra type form.
And so when we apply the solution with a very coarse grid, okay?
We actually can already calculate the analytical solution,
this has been known for a long time, so I'm not going to belabor the point.
You can look it up in Peter Crystal's book if you don't know what it is.
But it basically gives us something like this where there are assumptions, and
that's the red curve.
The numerical soluton with the very course grid looks something like this.
And so you can see at the key points, it actually matches quite closely.
Although it doesn't match everywhere.
Now if we want to improve this solution, of course, we can refine the match.
And it'll match at all those key points, which is analogous
to using more fingers to basically force it onto the analytical solution.
So if we want to do solution in dynamic equilibrium,
then of course it becomes a little trickier,
because now we have to track the second derivative in time as well.
And so then we can actually redo the whole calculation that I showed earlier.
I'm not going to go through all the details because it's very similar.
But we actually just get an extra mass matrix m times the second derivative of w,
which kind of makes sense if you think of a harmonic oscillator.
And so if we assume that there's no harmonic restoring force, then we can
actually assume that we have something like Kw plus Mw double dot is equal to 0.
Right, so we basically have dropped the b term, and
then we could assume that we have harmonic solutions, because this is basically like
a glorified harmonic oscillator equation, right?
And so then that gives us w is phi times u to the i omega t,
and then the w double dot gives us a factor minus omega squared.
And so then that comes out in front, and
so you've got K phi minus omega squared times M phi equals 0.
So we basically got the harmonic oscillator type solution for this problem.
And then you can see actually that the error of this kind of approach, which is
more general than what we've done before and thus assumes and subsumes the previous
calculation as well, actually reduces very rapidly with the number of elements.
Before, the graph that I showed you, which did have, of course,
a significant error, was at a very small number of elements, but
as we increase the number of elements to maybe 50 or 100,
then you can see that the errors become very, very small as well.
So this shows that the approach systematically converges where all
the frequencies of interest to accurate values.
In the next lecture, we'll talk in more detail about some applications for
finding the element method in the context of optics.