Solving Linear Static Finite Element Models

13-10-18
Solving Linear Static Finite Element Models | COMSOL Blog
Solving Linear Static Finite Element Models
Core Functionality | Posted on October 15th, 2013 by Walter Frei
In this first blog entry of our new solver series, we describe the algorithm used to solve all linear static
finite element problems. This information is presented in the context of a very simple 1D finite element
problem, but is applicable for all cases, and is important for understanding more complex nonlinear and
multiphysics solution techniques to be discussed in upcoming blog posts.
What Makes a Finite Element Model Linear and Static
Consider the system shown below, of a spring that is attached to a rigid wall at one end, and with an
applied force at the other end.
We are interested in finding the displacement of the end of the spring, where the force is applied. Using
the vocabulary of the finite element method, we have here a single element finite element model. The
spring is the element, and it is bounded by twonodes at either end. One of the nodes is fixed rigidly to
the wall, and other node will deform due to the applied load. We are trying to find the nodal
displacements due to the applied load. This problem is linear because neither the material properties
(the spring constant) nor the loads are dependent upon the solution. This is a static problem because
we are finding the solution under the assumption that there is no variation with respect to time.
Working Through the Model
This problem can easily be solved with pen and paper, but let’s look at how this is done in a more
rigorous way. Consider the node where we are trying to find the displacement, and draw the balance of
forces at equilibrium:
comsol.com/blogs/solving-linear-static-finite-element-models/
1/4
13-10-18
Solving Linear Static Finite Element Models | COMSOL Blog
We can write this out as: f(u)=p-ku, and we call this equation the functional of the system, at equilibrium
(steady state conditions) the functional is equal to zero. We want to find the value of u such that f(u)=0.
Let’s also plot out the functional:
Of course we can find the solution by examination in this case, but in general u will be a vector with
possibly millions of unknowns, so let’s be more rigorous and take a look at the exact algorithm used:
1. Choose a starting guess, for example: u_{init}=0
2. Evaluate the functional at this point: f(u_{init})=2-4(0)=2
3. Evaluate the derivative of the functional: f'(u_{init})=-4
4. Compute the solution: u_{solution}=u_{init}-[f'(u_{init})]^{-1}f(u_{init})=0-(2/(-4))=0.5
The above algorithm is also known as the Newton-Raphson method. Additionally, we can visualize this
graphically as:
Note that regardless of the starting point, the solution will be found in one step. So, whenever you solve
a linear static finite element problem in COMSOL Multiphysics, the software is following this algorithm to
find the solution. Now, the above example has only a single unknown, so we only need to solve a single
linear equation. Typically your models will have thousands or even millions of unknowns, which means
you will need to solve a system of linear equations, but the idea is the same.
comsol.com/blogs/solving-linear-static-finite-element-models/
2/4
13-10-18
Solving Linear Static Finite Element Models | COMSOL Blog
Lastly, we address the issue of numerical scaling. Whenever we solve a problem on a computer, we
need to consider the problem of finite precision due to the floating point representation of numbers.
Computers cannot represent the space of the real numbers perfectly. To minimize the effect of this,
COMSOL applies a scale factor to the equations before they are solved. COMSOL automatically
chooses a scaling appropriate for each set-up field variables in the model, and this almost never needs
to be handled by the user, but it is worth knowing what effect the scale factor has. As long as it is within
a few orders of magnitude of the average magnitude of the values in the solution, then no interaction is
required. Only if the scaling is very different from the expected solution magnitude should the scale
factor be changed.
To summarize what you need to know about solving linear static finite element models:
1. Regardless of what starting guess you use, you will find the solution in one iteration
2. The scaling of the variables is done to address the issue of finite precision floating point arithmetic
How to Interpret the COMSOL Log File
The Log File
Now let’s look at how the above information can be used to interpret the COMSOL Log file of a typical
linear static finite element model. Here’s the log file (with line numbers added) from a thermal stress
problem:
1) Stationary Solver 1 in Solver 1 started at 30-Apr-2013 17:41:45.2) Linear so
lver3) Number of degrees of freedom solved for: 3651 (plus 124 internal DOFs).4
) Symmetric matrices found.5) Scales for dependent variables:6) Displacement fi
eld (Material) (mod1.u): 0.00907) Temperature (mod1.T): 2.9e+0028) Iter
ping
Stepsize #Res #Jac #Sol9)
1
1.0000000
4.7e-017
1
1
Dam
110)
Stationary Solver 1 in Solver 1: Solution time: 0 s11)
Physical memory: 878 MB12)
Virtual mem
ory: 879 MB
Explanations
Line 1 reports the type of solver called, and the start time.
Line 2 reports that the software is calling the linear system solver. (COMSOL can automatically
detect if the problem is linear or nonlinear, and will call the appropriate solver.)
Line 3 reports the size of the problem in terms of the number of degrees of freedom (DOF). The
internal DOF’s (when they are used at all) typically are used to compute boundary fluxes, and do not
significantly affect problem size.
Line 4 reports on the type of finite element matrix to be solved.
Lines 5-7 report the scaling. In this case, a thermal stress problem is solved, so COMSOL scales the
displacement and temperature fields. The displacement field scale is 0.0090, using the unit system
of the model (meters) so as long as the structural displacements are not smaller than ~9
nanometers (or larger than 9 km!) this scaling is acceptable for displacement. The temperature field
scale factor is 293 K. Unless we’re solving a cryogenic problem (where the temperatures may be 4 K
+/- 0.001 K) or a problem with temperatures in the millions of Kelvin, this scaling is also acceptable.
Lines 8-9 report that a single Newton-Raphson iteration was used to solve this problem.
Lines 10-12 report the solution time and memory requirements.
comsol.com/blogs/solving-linear-static-finite-element-models/
3/4
13-10-18
Solving Linear Static Finite Element Models | COMSOL Blog
Now you should have an understanding of how linear static problems are solved in COMSOL, and how
to interpret the log file.
comsol.com/blogs/solving-linear-static-finite-element-models/
4/4