| Home - Lesson 1 - Lesson 2 - Lesson 3 - Lesson 4 - References. | ||
Lesson 2 - Numeric AlgorithmsBrian Bockelman
Abstract:
This lesson starts off with two simple numeric application - explicitly constructing all the harmonic functions on the
Harmonic Functions, Revisited
I ended the section on harmonic functions from the last lesson rather cryptically, saying there exists a explicit construction of any harmonic. This served partly as a teaser, and partly because the algorithm is a great way to introduce the topic of this lesson: computations on the Sierpinski Gasket. Specifically, by the end of this lesson, you should be able to solve dynamic equations on the Sierpinski Gasket (or at least understand the steps), one of the main goals of this tutorial.
One obvious way to create harmonic function on the
Start off by picking the value of the function at the three boundary points,
We want the Laplacian at
Expanding these three equations (with three unknowns), we get:
I leave it up to you to solve for
So, the three inner vertices of level So, the values of a harmonic function on level
Figure illustrating the 1/5-2/5-2/5 rule. Notice how u_1 is 2/5 of its closest neighbors, and 1/5 of the far one.
Because the values in level
where
A picture of one of the basis elements follows:
An element of the level 2 spline basis. Notice that the other two basis functions are just rotations of this one.
Generalized Harmonic Functions and SplinesHarmonic functions were our first step to the
That is,
If
This condition simply requires that the different 'pieces' match up in a continuous fashion.
The space of all piecewise harmonic functions which are zero on the boundary points is called the spline space. The function must be zero on the boundary because the spline spaces will be used to solve equations with Dirichlet boundary values,
We know that, in the case of the real interval, we can gain a lot of accuracy by approximating with quadratics instead of approximating with lines.
There are similar functions in the case of
That is, the Laplacian of
Here's an example of a tri-harmonic function.
Remember,
and If we extend each of the
IntegrationA second important, but simple example of computation on the Sierpinski Gasket is that of numerical integration. For those of you who are familiar with measure theory, you already know that there is a clear and ``natural" way to define integrations on the
It is clear that, like last section, we cannot calculate the exact integral of an arbitrary function on the
Remember our approximation of the real Laplacian on the unit interval by using the didactic points? We will construct our integral on the
What we are really doing is taking each interval, multiplying its length / size by the function value, and summing over each interval. By looking at more intervals, we can get a better approximation of the integral. So, for
If we want a really good approximation of the integral, we might decide to pick
We want to perform numerical integrations on the
To start out with, we want to think of the normal
In our approximation, when we compare the area of the triangle in
An example of a numeric integration of a function
For an example of an exact integration, consider the three harmonic basis functions,
Hence,
Now, for any harmonic function,
Thus,
Trapezoidal Rule and Simpson's MethodJust like with the real line, the naive implementation of numerical integration isn't the best. There are two other methods that, at very little computation cost, can increase the accuracy of your integrations.First, there is the so-called trapezoidal rule. Instead of evaluating at one point per cell, we can evaluate at all three boundary points of the cell, and average them out. This method is rather straightforward, and illustrated below:
An example of how the trapezoidal rule is used on a function
Secondly, there is Simpson's Rule. Here, we use the next level,
An example of how the Simpson's rule is used on the same function as above. Compare the two results.
EnergyWe have one last theoretical hurdle before we can describe our methods of solution. We must construct a way to measure the energy of a function on
It will be a bit more difficult to derive an exact analogy for the To mimic the term inside the integral, where the We now impose conditions so the We also want the following: where
and
In fact, we can extend the definition a little more to be able to examine the energy of two functions:
Here's an example of how to approximate the energy of a function; we use a level 1 approximation.
We have the following identity, called the weak formulation of the Laplacian, which relates the energy, integral, and Laplacian of a function, for all
The Finite Element MethodOverall, methods for solving differential equations fall into one of two categories: finite difference methods and finite element methods. It turns out that we have all the background needed to do the second, a finite element method.We want to solve the equation with what is called Dirichlet initial conditions, that is,
It may not be easy to solve this problem analytically, but we can do an approximation. Suppose
is the approximation of
By the weak definition of the Laplacian (equation 5), we get Now, we can take The equations are clumsy in this notation. To fix this, define the constants
and the matrices
where
The solution is straightforward:
Of course, while this is the solution, in the actual numeric computation, there are more accurate and quicker methods to solve for Now that we know the value of
This completes the solution procedure. Notice that
or simply the inner product of the two spline basis functions. For this reason,
Now that you've progressed through the basics of solving dynamic equations on the Sierpinski Gasket, there should be nothing stopping you from being able to implement the methods yourself. No need to reinvent the wheel though; in the next lesson, I walk you through working with a set of tools made specially for this tutorial that will allow you to use the finite element method (FEM) on your own.
| ||
| Home - Lesson 1 - Lesson 2 - Lesson 3 - Lesson 4 - References. |