Implementation of Finite Element Method in Matlab for Assessing Modes and Natural Frequencies of 2D Rectangular Plates
Implementation of Finite Element Method in Matlab for Assessing Modes and Natural Frequencies of 2D Rectangular Plates
net/publication/323869464
Conference Paper in Proceedings of meetings on acoustics Acoustical Society of America · May 2018
DOI: 10.1121/2.0000779
CITATION READS
1 971
2 authors, including:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Mechanical Phenomena in the Response of Buildings Submitted to Collisions and Explosions (Thesis - PhD) View project
All content following this page was uploaded by Jeferson Rafael Bueno on 14 July 2021.
Despite the fact that the engineering students often have a high amount of disciplines and subjects they
have to deal with during their degree, most of them do not know how to apply the acquired knowledge in their
professional lives.1 Still, the increase in the number of students in each discipline makes the learning process
harder for both students and professors, which brings the need to rethink the “chalk and talk” educational
model, where the teacher speaks and the students write, to make this learning process more effective.2
The use of softwares might be helpfull to students who are strugling to understand a certain physical
concept, but sometimes even though they have a sense of how to get results from a computer simulation,
the processes made by the software itself and the mathematical theory behind the results might not be very
clear.3
When it comes to studies regarding acoustic and vibrations, most simulations are made in commercial
softwares available in the market. Such softwares use algorithms to solve the problems given by the user
through numerical methods such as the Finite Element Method4 (FEM) and the Boundary Element Method5
(BEM). These simulations range from measuring the natural frequencies of a given structure6 to the analysis
of acoustic parameters in rooms.7 However, these computational tools are very expensive for students to
buy, which means that they rely on their universities buying the needed licenses to model physical systems.
Furthermore, in the poorer countries, where universities do not have high amount of resources or where the
individuals do not have access to the legal procedure of acquiring such softwares, the piracy is the way found
to avoid research from stopping.8–10 Nevertheless, software piracy is bad for both developers and users: for
the developers, because it causes money loss and it is not fair with them; and for the pirates, because it is
unethical and it might compromise the research, for some features are only present in the legal versions of
the computer program.
This paper is the full version of the work previously developed elsewhere6 and presents a self-taught
algorithm to the implementation of the FEM to assess natural frequencies and modal shapes of 2D rectangu-
lar plates with different boundary conditions. In addition, the results given by this algorithm are compared
with results obtained from a numerical simulation made with a commercial software. The algorithm is an
alternative for students to the use of expensive commercial softwares and is written for MATLAB, whose
academic version is way cheaper than the ones of such commercial platforms. The paper highlights the main
features of the FEM theory and presents parts of the code itself. The code is available for students uppon
request by e-mail. People interested in going deeper in the mathematical development of the equations are
encouraged to look at ref. [4].
The foundations that would lead to the Finite Element Method started to be developed in the 1940’s11, 12
and 1950’s.13, 14 These ideas were first developed by engineers of aeronautical and civil engineering to solve
structural problems.15
The method relies in the idea of subdividing a structure in small elements to account for physical quanti-
ties such as kinetic and potential energy in each one of these elements. It is then possible to sum everything
up to have a final value of these energies, thus leading to the acquisition of the mass and stiffness matrices.
From such matrices it is possible to determine the natural frequencies and modal shapes (eigenfunctions and
eigenvalues) of the system.
A typical element for a 2D consideration is shown in Fig. 1. In this figure, the three axis are x, y and z,
2a and 2b are the dimensions of the element and θx and θy are the bending moments in their respective axis.
The letters ξ and η represent the transposed coordinates x and y to dimensionless or general coordinates,
i.e., ξ = x/a and η = y/b. This transposal of coordinates is useful to deal with the differential equations
Figure 1: Typical element used in FEM theory (2D).
within the numerical model and is the first step to do before the implementation of the model. The numbers
1, 2, 3 and 4 are the nodes of the element.
From Fig. 1 it is possible to see that each of the nodes will have three degrees of freedom, i.e., rotation
in the x axis, rotation in the y axis, and a transversal motion in the z axis. The three vectors that describe
such degrees of freedom are
1 ∂w 1 ∂w
θx = , θy = − , (2)
b ∂η a ∂η
where t indicates a time dependance and {α} is a vector used to determine a general matrix [Ae ] for the
system. The process to obtain this matrix can be seen in detail in ref. [4].
Thus, for an element with thickness h, density ρ and surface area A, the kinetic and potential energy of
the element can be described as being, respectively,
Z
1
Te = ρhẇ2 dA (3)
2 A
and
h3
Z
1
Ue = {X}T [D]{X}, (4)
2 A 12
where
¨ + (1 + jη)[K]{ω} = {f }
[M]{ω} (8)
where [M] and [K] are the global matrices of mass and stiffness (i.e., the sum and allocation of the individual
matrices of mass and stiffness for each element) and ω is the vector of natural frequencies of the system.
For the sake of clarity, it is important to remind that the process to obtain the matrices [Ae ], [D], [Me ],
[Ke ], [M], [K] and the vectors {α} and {f } is described in ref. [4], as well as the assumptions and develop-
ment of the mathematical expressions here exposed. This process will not be repeated here to avoid making
the paper very long. It can also be visualized in the MATLAB code used in this work.
A. A FEM PROBLEM
The problem used in this work is illustrated in Fig. 2, where a door with its hinges and handle is pictured
with its dimensions in mm. The problem consists in modelling this system, considering that the hinges
and handle are fixed and cannot move and that a point force is applied at point “A”, to assess its natural
frequencies and modal shapes.
• The first six natural frequencies and modal shapes of the plate;
• A comparison of the results obtained with the algorithm with a commercial software.
3. METHODOLOGY
A. MATLAB IMPLEMENTATION
The code itself will not be put in this text, but for the reader to have glimpse of it in advance, the lines
for the implementation of the matrices [Me] and [Ke], as well as the vector of forces, are shown in Fig. 3.
Symbolic math is used in MATLAB for learning purposes.
In the above figure [Ae ] is the matrix that relates the degrees of freedom and their changes in coordinates.
As an example and for comparison with Fig. 3, the equation for [Me ] in the theory is given below:
Z +1 Z +1
−T
[Me ] = [Ae ] ρh{p(ξ, η)} {p(ξ, η)}abdξdη [Ae ]−1
T
(9)
−1 −1
i. Mesh
The mechanical properties of the plate were E = 205 GPa and ρ = 7850 kg/m3 . The thickness chosen
for the problem was h = 2 mm and the Poisson’s ratio was υ = 0.28. The first step in this implementation
is to model the mesh and its properties in order to determine the number of elements in both x and y axis,
thus obtaining the nodes. The element size was chosen as 0.01 m in both axis and each element has 4 nodes
and 3 degrees of freedom, as illustrated in Fig. 1. This leads to 20 and 50 elements in the x and y axis,
respectively, totalizing 1000 elements in the mesh, which is shown in Fig. 4. The red circle and red elements
represent the point A and the door handle and hinges, respectively.
In the above figure, element one has the nodes 1, 2, 5 and 4, element 2 has the nodes 2, 3, 6 and 5 and
so forth. A mathemcatical pattern can be used to identify which node belong to each element, as well as
the nodes that are shared by two or more elements. Let Ni be the i-esimal node of each element in the
above figure (i = 1, ..., 4), Ne the number of the element (e = 1, ..., 4), L and C be the number of lines and
columns in the x and y axis, respectively and Nx the number of elements in the x axis in the mesh (4 for
this study case). In this case, L = 1 or 2 and C = 1 or 2.
One can then easily find that the first node of each element can be found by the expression N1 =
Ne + (L − 1). For the third element, for example, the first node is N1 = 3 + (2 − 1) = 4. Since this third
element is in the second row of the mesh, L = 2. For the fourth element, N1 = 4 + (2 − 1) = 5 and so forth.
The remaining nodes can be found as being N2 = Ne + L, N3 = Ne + Nx + 3 and N4 = Ne + Nx + 2.
This information is summarized in Table 1.
Table 1: Guide to find the connectivity matrix.
Element (Ne ) Node 1 (N1 ) Node 2 (N2 ) Node 3 (N3 ) Node 4 (N4 )
1 1 2 5 4
2 2 3 6 5
3 4 5 8 7
4 5 6 9 8
Expression Ne + (L − 1) Ne + L Ne + Nx + 3 Ne + Nx + 2
1 2 3 4 5 6 7 8 9
1 N1 N1 N1 N2 N1 N4 N1 N3
2 N2 N1 N2 N2 N1 N2 N2 N4 N2 N3 N1 N3
3 N2 N1 N2 N2 N2 N4 N2 N3
4 N4 N1 N4 N2 N4 N4 N4 N3 N1 N4 N1 N3
5 N3 N1 N3 N2 N4 N2 N3 N4 N3 N3 N4 N3 N2 N4 N2 N3 N1 N3
6 N3 N1 N3 N2 N3 N4 N3 N3 N2 N2 N2 N3
7 N4 N1 N4 N2 N4 N4 N4 N3
8 N3 N1 N3 N2 N4 N2 N3 N4 N3 N3 N4 N3
9 N3 N1 N3 N2 N3 N4 N3 N3
4. COMSOL SIMULATION
To compare the results obtained from the MATLAB code the mechanical system was also implemented
in COMSOL Multiphysics software. The implementation used the Structural Mechanics Module and the
Eigenfrequency Solver. The discretisation of the mesh respected the six elements per wavelength require-
ment.4 The force applied in point A (see Fig. 2) was a normal Point Load with 1 N, and, on the door, a
Spring Foundation was added.
Both MATLAB and COMSOL first six natural frequencies are shown in Table 3.
There is an excellent agreement between both results. The highest error is 6.02%, which occurs in the
3rd natural frequency. However, both values for it (143.83 Hz and 153.05 Hz) are within the same third-
octave band, whose central frequency is 160 Hz. This means that if one is to treat this mode there would
not be a very huge problem if the treatment is for either 143.83 Hz or 153.05 Hz. The other relative errors
are so small that the results of the MATLAB code presented are trustworthy and feasible of achieving. The
modal shapes for the MATLAB code are presented in Fig. 6.
In Fig. 6 the natural frequencies are rounded up to next integer. It is clear to see that in the positions of
the handle and door hinges there is no motion at all, which is expected since they were degrees of freedom
that were set to zero in the MATLAB code. When plotting the modal shapes in COMSOL, the agreement
was also excellent between both results. For the sake of the length of this paper, COMSOL modal shapes
were not put here, but readers can request the model file by email.
The processing time for MATLAB symbolic language is higher than if one uses numbers in the equa-
tions. However, the authors believe that using the first strategy is better for code learning and to understand
how the software deals with the equations.
Figure 6: Modal shapes of the first 6 natural frequencies of the system.
6. CONCLUSION
The FEM algorithm presented here shows great agreement with commercial software results and can
be used by any person who has the MATLAB code. The code consists of a good way to learn the Finite
Element Method in its state-of-art. Its main disadvantage is that it is only valid for rectangular geometries.
However, one can modify it to basically any geometry as long as the equations for the new shape(s) are
provided.
ACKNOWLEDGMENTS
The authors would like to acknowledge Prof. Julio Cordioli for the lectures and FEESC for the financing
of the Master’s of the first author.
REFERENCES
1 J. E. Mills, D. F. Treagust, et al., “Engineering education – is problem-based or project-based? learning
the answer,” Australasian journal of engineering education 3(2), 2–16 (2003).
2 B. A. Mello, “Aumento na quantidade de alunos em disciplinas básicas: Como obter vantagens dessa
realidade universitária.,” Caderno Brasileiro de Ensino de Fı́sica 37(3) (2015).
3 C. Fiolhais and J. Trindade, “Use of computers in physics education,” in New technologies for higher
education: proceedings, Universidade de Aveiro (1998), pp. 103–115.
4 M. Petyt, Introduction to finite element vibration analysis (Cambridge University Press, 2010).
5 P. K. Banerjee and R. Butterfield, Boundary element methods in engineering science, Vol. 17 (McGraw-
Hill London, 1981).
6 A. R. Carvalho de Sousa and J. R. Bueno, “Self-taught finite element method implementation to the
assessing of natural frequencies and modal shapes in 2d rectangular plates,” The Journal of the Acoustical
Society of America 141(5), 3556–3556 (2017).
7 J. Crompton, L. Gritter, S. Yushanov, K. Koppenhoefer, and D. Magyari, “Analysis of acoustic response
of rooms,” in Proceedings of the COMSOL Conference (2010).
8 G. M. Eckhardt, R. Belk, and T. M. Devinney, “Why don’t consumers consume ethically?,” Journal of
Consumer Behaviour 9(6), 426–436 (2010).
9 H. K. Cheng, R. R. Sims, and H. Teegen, “To purchase or to pirate software: an empirical study,” Journal
of Management Information Systems 13(4), 49–60 (1997).
10 R. R. Sims, H. K. Cheng, and H. Teegen, “Toward a profile of student software piraters,” Journal of
Business Ethics 15(8), 839–849 (1996).
11 A. Hrennikoff, “Solution of problems of elasticity by the framework method,” Journal of applied mechan-
ics 8(4), 169–175 (1941).
12 R. Courant, “Variational methods for the solution of problems of equilibrium and vibrations,” Bulletin of
the American Mathematical Society 49(1), 1–23 (1943).
13 J. Argyris, “Energy theorems and structural analysis, part l,” Aircraft Engineering 26(1), 383 (1954).
14 M. Turner, R. Clough, H. Martin, and L. Topp, “Stiffness and deflection analysis of complex structures,”
Journal of Aeronautical Sciences 25(1), 805–823 (1956).
15 J. Meek, “A brief history of the beginning of the finite element method,” International journal for numer-
ical methods in engineering 39, 3761–3774 (1996).