# Finite Elements Method - FEM

• FEM minimizes the energy stored in the field and instead of solving a second order partial differential equation it minimizes an expression containing the square of the first derivatives of potential.
• The potential is evaluated at the mesh points of a mesh made of small quadrilateral elements, each with its own material properties. The computation is based on the assumption that the potential changes linearly inside a triangular finite element.
• Fast solution methods get the potential by solving a set of linear equations of the order of the number of mesh points, half a million equations in less than a minute.
• We determine the potential only in 2 dimensions.

## Information about FEM

• A number of papers was published, e.g. at CPO (Charged Particle Optics) conferences between 1990-2006
• Computation of coefficients for the first order FEM was improved for all relevant problems
• Fine mesh for computation can have very many points
• Fast preconditioned conjugate gradient method is used to solve large sets of equations
• Accuracy estimate of solution from 2 meshes (one is two times denser) can be used for lenses

## FEM mesh – specification of geometry

• The coarse mesh is made of horizontal and vertical lines
• The quadrilaterals so made cannot be degenerate
• Each of them can be filled with its own material (electrodes can be only a part of a line)
• Magnetic materials are specified by magnetization curve and they can saturate
• A number of lens excitations can be calculated one after another

## Fine mesh for computation of potential

• The fine mesh is made by subdividing the coarse mesh by additional lines
• The fine mesh is automatically computed in EOD from one or more gaps in which the mesh density is specified by the user
• The rest of the fine mesh has graded mesh step that expands from the gap
• Each of small quadrilaterals is for computations divided into four triangles, in each of them the potential is supposed to be a linear function of coordinates
• From the condition that the energy stored is minimum we get a system of linear equations for potentials at the nodes of the fine mesh