0% found this document useful (0 votes)
2 views

Implementation of Finite Element Method in Matlab for Assessing Modes and Natural Frequencies of 2D Rectangular Plates

This conference paper presents a self-taught algorithm for implementing the Finite Element Method (FEM) in MATLAB to assess the natural frequencies and modal shapes of 2D rectangular plates. The algorithm serves as an alternative to expensive commercial software, making it accessible for students, especially in resource-limited settings. The paper includes a comparison of results obtained from the algorithm with those from commercial software, highlighting the main features of FEM theory and providing parts of the MATLAB code.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Implementation of Finite Element Method in Matlab for Assessing Modes and Natural Frequencies of 2D Rectangular Plates

This conference paper presents a self-taught algorithm for implementing the Finite Element Method (FEM) in MATLAB to assess the natural frequencies and modal shapes of 2D rectangular plates. The algorithm serves as an alternative to expensive commercial software, making it accessible for students, especially in resource-limited settings. The paper includes a comparison of results obtained from the algorithm with those from commercial software, highlighting the main features of FEM theory and providing parts of the MATLAB code.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/323869464

Implementation of Finite Element Method in Matlab for assessing modes and


natural frequencies of 2D rectangular plates

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:

Jeferson Rafael Bueno


Federal University of Pampa
18 PUBLICATIONS 7 CITATIONS

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

App SAU View project

All content following this page was uploaded by Jeferson Rafael Bueno on 14 July 2021.

The user has requested enhancement of the downloaded file.


1. INTRODUCTION

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].

2. FINITE ELEMENT METHOD

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

w(ξ, η, t) = {1 ξ η ξ2 ξη η2 ξ3 ξ2η ξη 2 η3 ξ3η ξη 3 }{α}, (1)

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

{X}T = {∂ 2 w/∂x2 ∂ 2 w/∂y 2 2∂ 2 w/∂x∂y} (5)


and [D] (see ref. [4]) is the matrix of material constants; ν is the Poisson’s ratio and E 0 and G are the
Young’s and shear modulus, respectively.
One can now transpose Eqs. (3) and (4) to general coordinates to find that
Z 1 Z 1
1 1
Te = ρhẇ(ξ, η)2 (ab)dξdη = {we }T [Me ]{we } (6)
2 −1 −1 2
and
Z 1
1 1
Ue = I{X}T [D]{X}(ab)dξdη = {we }T [Ke ]{we }, (7)
2 −1 2
where the matrices [Me ] and [Ke ] are the matrices of mass and stiffness for the element.
Upon excitation of an external force fe in the element, the virtual work We realized by this force is
δWe = {δwe }T {fe }. Finaly, one can derive a general equation of motion for a system with n finite elements:

¨ + (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.

Figure 2: Problem used in the implementation (values in milimeters).

The following points will be evaluated in the implementation of this problem:

• 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.

Figure 3: Part of the implemented FEM code.

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.

Figure 4: Finite element mesh for the plate.


ii. Connectivity matrix
The connectivity matrix is a mathematical tool that relates each element with its nodes, i.e. it tells the
software which node belongs to each element and vice-versa. To explain how to program it, consider the
four elements of a mesh shown in Fig. 5.

Figure 5: Elements of a typical mesh.

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

iii. Global matrices


The matrices for the elements [Me ] and [Ke ] are obtained considering that each element has 12 degrees
of freedom in total, i.e. 3 degrees of freedom × 4 nodes. If the elements have 12 degrees of freedom, their
matrices of mass and stiffness are 12 × 12 matrices. These are calculated and then allocated in the global
matrix.
To study the allocation process, consider the mesh in Fig. 5, which has 9 nodes overall, meaning that the
global matrices will have 9 × 9 “slots”, with ij elements ocupying the i-esimal row and j-esimal column.
These slots will be filled with the relation of the degrees of freedom of each element with itself and with the
degrees of freedom of other nodes.
Let’s consider the first element of Fig. 5. The relation of the first node with itself, i.e., N1 N1 , will be
filling the slot in the first line and first column. On the other hand, the relation between the first node and the
third node, N1 N3 , will be filling the slot in the first line and fifth column (see in Fig. 5 that the third node of
element 1 is marked as 5. In Table 2 it is presented the positions of all the relations of elements 1 (blue), 2
(green), 3 (yellow) and 4 (purple) of the mesh shown in Fig. 5. This table can be used as a guide to find and
understand the global matrices of FEM problems.
From Table 2 it is clear that the global matrices of mass and stiffness shall be diagonal, with the non-
nodes elements (blank spaces in this table) being equal to zero. Other thing that the reader might find out is
that some relations are superposed, for instance the relations N3 N3 , N4 N4 , N2 N2 and N1 N1 for elements
1, 2, 3 and 4, respectively. It is explicit that such elements share the comon node N5 , which means that this
relation is the same regardless of the element to which the node belongs, i.e. the relation of the node N5
with itself is not variable, and this is the reason of the superpositioning in the table. The Nij relations are,
physically, the degrees of freedom for each node and how these degrees of freedom affect each other. When
the reader looks at the ij element in Table 2, i.e. N1 N1 , she or he is looking at the first three degrees of
freedom, w1 , θx1 and θy1 , and how they relate with themselves.

Table 2: Guide to obtain the global matrices.

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

iv. Natural boundary conditions (or geometric conditions)


Boundary conditions are the conditions imposed to parts of the system. The reader might ask himself
the simple questions: “Can this part of my system move? How?”. From the answers she or he will have the
boundary conditions. If the edge of a plate can not move at all (i.e. it can not move in the xy plan nor can
it rotate), it means the the nodes that are part of this edge will also have no motion, so the values of such
nodes in the Ni Nj relations in Table 2 will be zero.
In the case of the problem showed in Fig. 2, the nodes that compose the door handle and hinges will be
considered as constrained. It is simple do define the position of the nodes that will be “zero-nodes”: if the
door is 500 mm tall and the discretisation (element size) in the y axis is 0.01 m, the plate will have 0.5/0.01
= 50 elements. The easy way to do this is by deleting the rows and columns of the global matrices that
correspond to constrained degrees of freedom. One can simply measure the spacial position of the hinges
and handle and define the nodes that will be constrained in a similar process as showed in Table 1.
v. Extracting natural frequencies and modal shapes of the system
From Eq. 8, one can easily access the natural frequencies and modal shapes of the system through the
eigs function in MATLAB, where its input arguments will be the global matrices of mass and stiffness. This
function will return two essential parameters in the analysis proposed in this paper: eigenvalues (natural
angular frequencies) and eigenvectors (modal shapes). Natural frequencies can then be assessed by the
following equation in the implementation:

eigenvalues
fn = (10)

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.

5. RESULTS AND DISCUSSION

Both MATLAB and COMSOL first six natural frequencies are shown in Table 3.

Table 3: Natural frequencies of the system.

Natural Frequency 1st 2nd 3rd 4th 5th 6th


MATLAB 57.98 Hz 59.25 Hz 143.83 Hz 161.88 Hz 169.13 Hz 234.73 Hz
COMSOL 59.13 Hz 62.60 Hz 153.05 Hz 163.24 Hz 167.25 Hz 236.02 Hz
Relative Error [%] 1.94 5.35 6.02 0.83 1.12 0.55

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).

View publication stats

You might also like