# Finite elements/Heat equation time integration

## Solving the Matrix Problem

[edit | edit source]The matrix equations for the Poisson problem do not involve time and can be solved directly using either direct or iterative methods for solving systems of equations. You have done that in your introductory course on finite elements.

For the time-dependent heat equation, a few extra steps are needed. This is because the equations we have developed so far still have continuous time derivatives which need to be approximated.

Recall equations (45)

These equations are a coupled system of first-order ordinary differential equations rather than a system of algebraic equations.

One way of solving the system of differential equations
(45) is to use the ** generalized midpoint rule**.

### Generalized midpoint rule

[edit | edit source]Consider the following initial value problem

where is a smooth function.

The generalized midpoint rule can be used to solve this differential equation in an approximate manner.

Let us discretize the domain into increments of . Let be the approximation to the exact value of at time .

The integration rule for the generalized midpoint rule is

When we choose , we get

When we choose , we get

When we choose , we get

### Generalized midpoint rule for Heat equation

[edit | edit source]If we apply the generalized midpoint rule to the system of differential equations

we get

The computational problem is to find and given and .

We start at at which time the initial condition is given. In that case, the value of can be calculated using

Implementation of the algorithm for subsequent times may take various forms.

Let us combine the second and third equations in (46) to get

If we collect the known quantities at time , we can write equation (47) as

where

The quantity is often called the ** predictor value** of .

At this stage we can proceed in two ways (or more).

##### The v-form of the Generalized Midpoint Rule.

[edit | edit source]Substitute equation (48) into the first equation in (46) to get

Collect terms containing and rearrange to get

We can solve equation (49) for . Substitute this solution into equation (48) to get .

This approach is called the -form because the "velocity" or rate of change of the unknown quantity is calculated first followed by the actual quantity.

##### The d-form of the Generalized Midpoint Rule.

[edit | edit source]Substitute equation (48) into the first equation in (46) to get

Collect terms containing and rearrange to get

The system of equations (50) can be solved for . Once we know , we can calculate using equation (48).

This approach is called the -form because the "displacement" or the actual unknown quantity is calculated first followed by its rate.

#### Explicit foward Euler method

[edit | edit source]FE System of ODEs:

We know:

Apply generalized midpoint rule ():

Combine:

Solve for .

Many other techniques are available for solving systems of time-dependent
ODEs. We will look into some of them later.

## Quality of Approximate Solutions

[edit | edit source]The usual engineer's approach is to stop after a solution has been obtained and assume that this solution is adequate. However, it is quite important to have some information about the quality of the approximation. Unless such information is available, the finite element solution is essentially useless because it could have little resemblance to the actual solution.

** Verification** is the process of determining if the numerical
approximation
is an accurate representation of the mathematical model. The first
step in the process is to obtain a qualitative estimate of the
error in the approximation. Functional analysis plays a vital role
in determining these estimates of error.

The next step in the verification process is to obtain some information
about whether an approximate solution ** converges** to the exact
solution as the mesh is refined. We can also determine what the
** rate of convergence** or ** order of accuracy** for a particular
approach is. We will not get into the details of error estimation in this
course except for a few specific cases.

The final step in the verification process involves comparisons of numerical results with known exact solutions and experimental results of well-characterized benchmark problems.

We also need to ** validate** our models. Validation is the process of
determining the degree to which our mathematical model represents
physical reality (as far as the intended use of the model is concerned).

Later, we will discuss some aspects of verification and validation in the context of multi-physics problems.