GGGGG KKK
GGGGG KKK
GGGGG KKK
https://doi.org/10.1007/s00158-020-02726-w
EDUCATIONAL PAPER
Abstract
In this paper, two separate topology optimization MATLAB codes are proposed for a piezoelectric plate in actuation and
energy harvesting. The codes are written for one-layer piezoelectric plate based on 2D finite element modeling. As such,
all forces and displacements are confined in the plane of the piezoelectric plate. For the material interpolation scheme,
the extension of solid isotropic material with penalization approach known as PEMAP-P (piezoelectric material with
penalization and polarization) which considers the density and polarization direction as optimization variables is employed.
The optimality criteria and method of moving asymptotes (MMA) are utilized as optimization algorithms to update the
optimization variables in each iteration. To reduce the numerical instabilities during optimization iterations, finite element
equations are normalized. The efficiencies of the codes are illustrated numerically by illustrating some basic examples of
actuation and energy harvesting. It is straightforward to extend the codes for various problem formulations in actuation,
energy harvesting and sensing. The finite element modeling, problem formulation and MATLAB codes are explained in
detail to make them appropriate for newcomers and researchers in the field of topology optimization of piezoelectric material.
Keywords Topology optimization · MATLAB code · Piezoelectric actuator · Piezoelectric energy harvester
elements to be gray in addition to black (material) and mization (Schlinquer et al. 2017; Bafumba Liseli and
white (void). However, due to practical constraints, it is Agnus 2019; Homayouni-Amlashi et al. 2020a), shape
desired that the optimization finally converges to a black and optimization (Muthalif and Nordin 2015), layers number
white layout. To do so, a penalization factor is defined for optimization (Rabenorosoa and et al 2015), or parame-
intermediate densities. One of the reasons for the popularity ters sub-optimization (Rakotondrabe and Khadraoui 2013;
of this approach is its simplicity of implementation Khadraoui et al. 2014) with interval techniques (Rakoton-
in comparison with other approaches. Similar to SIMP drabe 2011). After development of TO methodology, it is
approach, there is evolutionary structural optimization extended to different physics (Alexandersen and Andreasen
(ESO) (Xie and Steven 1993) or the more general form 2020; Deaton and Grandhi 2014) including the piezoelec-
bi-directional evolutionary structural optimization (BESO) tricity. Primarily, the homogenization approach is used
(Xia et al. 2018) which is about removing or adding the (Silva et al. 1997; Sigmund et al. 1998). Afterwards, other
elements inside the design domain during optimization approaches including SIMP (Kögl and Silva 2005), BESO
iterations. In addition to the aforementioned approaches, (de Almeida 2019) or level set method (Chen et al. 2010) are
there are other approaches including level set method (van also explored. By defining proper objective functions, TO
Dijk et al. 2013; Andreasen et al. 2020) and method of methodology is applied to piezoelectric actuators (Moretti
moving morphable components (MMC) (Guo et al. 2014; and Silva 2019; Gonċalves et al. 2018), sensors (Menuzzi
Zhang et al. 2017) which is a geometrical approach. For a et al. 2018) and energy harvesters (Homayouni-Amlashi
detailed review and comparison between these approaches, et al. 2020b; Homayouni-Amlashi 2019; Townsend et al.
one can refer to the following review papers: Sigmund and 2019). The publications considered different types of sys-
Maute (2013) and Deaton and Grandhi (2014). tem modeling including the static (Zheng et al. 2009),
Due to the success of TO methodology, several dynamic (Noh and Yoon 2012; Wein et al. 2009), modal
implementation codes in different software are published in (Wang et al. 2017) and electrical circuit coupling (Salas
the literature. Using the SIMP approach, Sigmund (2001) et al. 2018; Rupp et al. 2009). Different types of prob-
published the 99 lines of MATLAB code for 2D topology lem formulation can be found as well such as optimization
optimization of compliance problems. Andreassen et al. with stress constraints (Wein et al. 2013). Although the
(2011) published the 88 lines of MATLAB code which was application of TO methodology to piezoelectric materials is
an improvement of Sigmund’s 99 lines of code while having well established in the literature, no implementation code is
much faster speed in each iteration thanks to introducing the published yet.
connectivity matrix that facilitates the assembly procedure In this paper, 2D topology optimization codes are
of elemental matrices. Liu and Tovar (2014) published proposed for actuation and energy harvester by using
the TOP3D MATLAB code by extension of the 88 lines the extension of SIMP approach known as PEMAP-P
of code for topology optimization of 3D structures. Chen (piezoelectric material with penalization and polarization).
et al. (2019) published 213 lines of MATLAB code The codes are written based on the 88 lines of MATLAB
for 2D topology optimization of geometrically nonlinear code written by Andreassen et al. (2011), except the code
structures. There are other published codes using other is extended and modified considerably to consider the
TO approaches like level set method (Challis 2010; Wei electromechanical coupling effect of piezoelectric material
et al. 2018; Yaghmaei et al. 2020), BESO (Xia et al. and problem formulation. In Section 2, the finite element
2018), and projection method (Smith and Norato 2020). modeling of one-layer piezoelectric plate is presented by
These published codes facilitate the implementation of using the plane stress assumption. The finite element
TO methodology for various applications. For this reason, equation is derived for both actuation and energy harvesting.
the application of TO can be seen in solving different A normalization is applied to the finite element equation
problems including the compliance problems (Bendsoe which significantly reduces the numerical instabilities in
2013), compliant mechanism problems (Zhu et al. 2020), optimization iterations. Hence, the proposed codes in
heat conduction (Gersborg-Hansen et al. 2006), and smart this paper work smoothly in both actuation and energy
materials in particular the piezoelectric materials (Sigmund harvesting. In Section 3, first, the material interpolation
and Torquato 1999). scheme for piezoelectric material is explained. Then, the
Due to their electromechanical coupling effect, piezo- optimization problem is formulated for both actuation and
electric materials have applications in actuation, sensing energy harvesters. The problem formulations are basic for
and energy harvesting. Plenty of methods can be found educational purposes. The sensitivity analysis is performed,
in the literature to analyze and improve the performance and finally, the optimization algorithms are explained. In
of the piezoelectric structures, whether actuators, energy Section 4, the MATLAB codes are explained part by part
harvesters or sensors such as geometrical and size opti- in detail. The explanations in this part help the readers to
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
extend and implement the codes for their own purposes. In – the piezoelectric plate is confined to have planar
Section 5, different numerical examples are illustrated and movement and it is subjected to loading only in the xy
the modification to the original codes to implement those plane,
numerical examples are expressed as well. – the thickness of the electrodes is negligible in compari-
son with thickness of piezoelectric plate,
– the electromechanical system is assumed to be linear,
2 Finite element modeling – the electrodes are perfectly conductive,
– the polarization direction is perpendicular to the plate
→
2.1 Constitutive equation in parallel to z axis,
– the electrical field is uniform in the direction of
The general linearly coupled mechanical and electrical con- thickness aligned with the polling direction,
stitutive equation of piezoelectric materials by neglecting – the variation of the potential in the direction of the
the thermal coupling can be written as (Lerch 1990) thickness is linear,
T̄ = cE S̄ − eĒ The first two assumptions let us use the plane stress
D̄ = eT S̄ + εS Ē (1) assumption modeling for the piezoelectric plate (Hutton and
Wu 2004). In this case, any stress in the direction of z will
In (1), T̄ and S̄ are the vectors of mechanical stress and be zero. By considering transversely isotropic piezoelectric
strain while cE is the stiffness tensor in constant electrical material and considering plane stress assumption, the piezo-
field. D̄ and Ē are the vectors of electrical displacement and electric plate has in-plane isotropic behavior. Furthermore,
electrical field. e is the piezoelectric matrix, εS is the matrix by poling the piezoelectric material in the z direction, the
of permittivity in constant mechanical strain and T shows only non-zero electric field will be in the z direction. In
the matrix transpose. this case, the reduced (2D) form of piezoelectric constitutive
The 4-mm tetragonal crystal class piezoelectric material equation can be derived in the following form (Junior et al.
(Piefort 2001) which has orthotropic anisotropy is consid- 2009)
ered to derive the corresponding model. This class includes ⎡ ⎤ ⎡ ∗ ∗ ∗ ⎤⎡ S ⎤
most of the piezoelectric material in particular the well- T1 c11 c12 0 −e31 1
⎢ T2 ⎥ ⎢ c∗ ∗
c11 ∗ ⎥⎢ S ⎥
0 −e31
known PZT (lead zirconate titanate) materials. By this ⎢ ⎥ ⎢ 12 ⎥⎢ 2 ⎥
⎣ T3 ⎦ = ⎣ 0 0 ∗
c33 0 ⎦ ⎣ S3 ⎦
(3)
consideration, the mechanical stiffness tensor, piezoelectric
D3 ∗
e31 ∗
e31 ∗
0 ε33 E3
matrix and permittivity for full 3D modeling are
⎡E E E ⎤
c11 c12 c13 0 0 0
⎢ cE E
c11 E
c13 0 0 ⎥0
⎢ 12 ⎥
⎢ cE E
c13 E
c33 0 0 ⎥0
cE = ⎢
⎢ 0
13 ⎥
⎢ 0 0 E
c44 0 ⎥0
⎥
⎣ 0 0 0 0 0 ⎦E
c44
0 0 0 0 E
c66 0
⎡ ⎤
0 0 0 0 e15 0
eT = ⎣ 0 0 0 e15 0 0 ⎦
e31 e31 e33 0 0 0
⎡ S ⎤
ε11 0 0
εS = ⎣ 0 S
ε11 0 ⎦ (2)
0 0 S
ε33
The components of the reduced constitutive equation can thickness of electrodes is negligible in comparison with the
be written as (Junior et al. 2009) thickness of the piezoelectric plate, its structural effects are
E 2 E 2 neglected in the modeling. Hence, only the piezoelectric
∗E c13 ∗ c ∗ plate is discretized by the finite number of elements. The
c11 = c11 − E , c12 = c12 − 13
E E
E
, c33 = c66
c33 c33 schematic form of this discretization is illustrated in Fig. 2a.
E
c13 2
e33 As can be seen in this figure, The piezoelectric plate is
∗ ∗
e31 = e31 − e33 E
, ε33 = ε33
S
+ E
(4) discretized as 3 by 4 elements. It is clear that a finer
c33 c33
discretization will be used for the numerical optimization.
The obtained constitutive equation in (3) will be used in It can be seen in the figure that each rectangular element
the finite element modeling of the piezoelectric plate which has 4 nodes and each node has 2 in-plane mechanical
will be discussed in the next section. degrees of freedom regarding the displacement in x and y
directions. The rectangular element shown in Fig. 2b can
2.2 Piezoelectric finite element model have arbitrary length le and width we . In fact, with the
method of finite element modeling which is used to write
In this section, to derive the finite element (FE) formulation, the optimization code, the dimensions of plate and number
the piezoelectric plate is discretized by rectangular elements of elements can be defined separately. This freedom will
which are particular form of the more general 2D elements have two advantages: first, for a predefined geometry of
called “bilinear quadrilateral element” (Hutton and Wu a piezoelectric plate, higher number of elements can be
2004; Kattan 2010). It should be noted that since the defined to have better results in terms of having small detail.
Second, it is possible to define lower number of elements the strain displacement matrix which is written as follows
when reducing the computation time is necessary. As it is (Kattan 2010),
illustrated in Fig. 2c, the rectangular element is mapped to
a parent element which is a square element with natural 1
Bu = B1 B2 B3 B4
coordinates ξ and η. The displacement of every point within |J |
the element will be expressed by the displacement of the ⎡ ∂ni ⎤
a ∂ξ − b ∂n
∂η
i
0
nodes through the interpolation functions in the following ⎢ ∂ni ⎥
format (Hutton and Wu 2004). Bi = ⎣ 0 c ∂n
∂η − d ∂ξ ⎦
i
(9)
c ∂n ∂ni ∂ni
∂η − d ∂η a ∂ξ − b ∂η
i ∂ni
x = x1 n1 + x2 n2 + x3 n3 + x4 n4
y = y1 n1 + y2 n2 + y3 n3 + y4 n4 (5) and the parameters a, b, c and d are given by Kattan (2010),
mechanical force and q is the charge. These components of Equation (18) can also be written in following form
linear differential equation are derived in the following form
Kuu − MΩ 2 Kuφ U F
= (19)
kuu = h BuT cE Bu |J | dξ dη Kφu −Kφφ Φ 0
A
To solve the FEM (19), the mechanical boundary
kuφ = h BuT eT Bφ |J | dξ dη condition and equipotential condition should be applied.
A This will be explained in detail in Section 4.
kφφ = h BφT εS Bφ |J | dξ dη
A
2.3 Normalization
m = ρh N T N |J | dξ dη (14)
A
Here, the critical point is that the scale difference between
where A is the top surface area of the element and ρ is the the piezoelectric matrices including the mechanical stiffness
density of the material. In fact, (14) illustrates the analytical matrices (kuu ) and (kuφ ) and the dielectric stiffness matrix
calculations of elemental matrices. However, for numerical (kφφ ) is huge. This huge scale difference can bring
implementation in MATLAB, two-point Gauss quadrature numerical instabilities in form of singularities in solving the
method (Hutton and Wu 2004) is utilized for calculation of final global FEM equation during the optimization loops. To
the elemental matrices numerically, which gives the exact eliminate the scale difference, a normalization is suggested
values. The implementation procedure is explained later in (Homayouni-Amlashi 2019; Homayouni-Amlashi et al.
Section 4. 2020b) by factorizing the highest value of each elemental
To have the global FEM equation for a whole piezoelec- matrix which can be expressed in the following format
tric plate, the elemental matrices in (13) should be assem-
bled, which is a general procedure in the FEM methodol- k̃uu = kuu /k0 , k̃uφ = kuφ /α0
ogy and which will also be explained in Section 4. After k̃φφ = kφφ /β0 , m̃ = m/m0 (20)
assembling the elemental matrices, the global finite element
equation for the whole design domain can be written as Starting by this normalization of elemental matrices, the
actuation FEM (16) can be rewritten as
M 0 Ü Kuu Kuφ U F
+ = (15)
0 0 Φ̈ Kφu −Kφφ Φ Q K̃uu Ũ + K̃uφ Φ̃ = F̃ (21)
Now, for two cases of actuation and energy harvesting, in which
the global FEM (15) can be interpreted in different ways.
Here, we focus on static actuation so that the dynamics will F̃ = F /f0 , Ũ = U/u0 , Φ̃ = Φ/φ0
not be considered. Therefore, the global FEM equation for
u0 = f0 /k0 , φ0 = f0 /α0 (22)
the actuation can be written as
Kuu U + Kuφ Φ = F (16) The same normalization can be performed on the energy
harvesting FEM (19)
This equation will be used to calculate the mechanical
displacement due to applied potential. K̃uu − M̃ Ω̃ 2 K̃uφ Ũ F̃
= (23)
For the energy harvesting case, the external charge (Q) K̃φu −γ K̃φφ Φ̃ 0
is considered to be zero. In addition, the external force is
where
considered to be a harmonic excitation of frequency Ω. In
this case, by considering a linear electromechanical system, Ω̃ 2 = Ω 2 m0 /k0 , γ = k0 β0 /α02 (24)
the force and the response of the system can be stated as
Here γ is a normalization factor which keeps the
F = f0 eiΩt
solution of the system equal before and after applying
U = u0 eiΩt , Φ = φ0 eiΩt (17) the normalization. This normalization factor is having the
where f0 , u0 and φ0 are the amplitude of harmonic force, scale of 101 and in this way the scale difference between
displacement and potential. By substituting the (17) in (15), the piezoelectric matrices is eliminated. The proof of
the global FEM equation for the energy harvesting case can normalization is provided in the Appendix.
be written as Now, by having the FEM equations (21) and (23), it is
possible to enter the optimization phase. In the upcoming
2 M 0 U Kuu Kuφ U F sections, optimization of actuator and energy harvester is
−Ω + = (18)
0 0 Φ Kφu −Kφφ Φ 0 separated.
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
3 Topology optimization polarization) (Kögl and Silva 2005), which is the exten-
sion of the SIMP approach. Although some projections
As explained before, topology optimization is about are defined for SIMP to have a robust topology optimiza-
distribution of the material within a design domain while tion (Wang et al. 2011), there are alternative interpolation
there is no prior knowledge of the final optimized layout of functions like RAMP (rational approximation of material
the structures (Bendsoe 2013). There are several approaches properties) (Stolpe and Svanberg 2001), or newer interpola-
for topology optimization method (Maute and Sigmund tion function introduced in Clausen et al. (2015). This latter
2013). However, the density-based approach is chosen for one is also used in topology optimization of piezoelectric
this paper since its efficiency is already established in many transducers (Donoso and Sigmund 2016). In fact, the study
researches specially in the area of piezoelectric actuators on preference of these interpolation functions is not in the
(Kögl and Silva 2005; Ruiz et al. 2017; Moretti and Silva scope of this paper. But, with the proposed MATLAB code,
2019) or energy harvesters (Homayouni-Amlashi 2019; it will be easy for implementation of other interpolation
Zheng et al. 2009; Noh and Yoon 2012). functions.
After establishing the material interpolation scheme, the
3.1 Piezoelectric material interpolation scheme rest of this section will be divided into two parts: actuation
and energy harvesting.
One of the famous material interpolation schemes is
the density-based approach which has been introduced 3.2 Actuation
to relax the optimization from the binary (void-material)
problem. In this approach, for a discretized design domain 3.2.1 Problem formulation
by finite number of elements, the material properties of
each element are related to element’s density through a Following the classic approach for compliant mechanisms
power law interpolation function. For passive isotropic reported in Bendsoe (2013), the optimization of a pla-
material, this interpolation function is referred to as solid nar piezoelectric actuator can be defined simply as dis-
isotropic material with penalization (SIMP) which relates placement optimization or minimization of the following
the element’s Young modulus of elasticity to its density. For objective function,
active non-isotropic piezoelectric material, the interpolation
minimize Jact = −LT Ũ
function is the extension of SIMP scheme which can be
written as follows (Kögl and Silva 2005)
NE
Subject to V (x) = xi vi ≤ V
i=1
k̃uu (x) = Emin + x puu (E0 − Emin ) k̃uu
0 < xi ≤ 1
k̃uφ (x, P ) = (emin + x puφ (e0 − emin ))(2P − 1)pP k̃uφ 0 ≤ Pi ≤ 1 (26)
k̃φφ (x) = (εmin + x pφφ (ε0 − εmin ))k̃φφ
where L is a vector with a value of 1 that corresponds to
m̃(x) = x m̃ (25)
the output displacement node and 0 otherwise. In addition,
a constraint is defined on the final volume of the optimized
where Emin , emin and εmin are small numbers to define design. V is the target volume which is a fraction of the
the minimum values for stiffness, coupling and dielectric overall volume of the design domain while vi is the volume
matrices while E0 , e0 and ε0 are equal to 1 to define the of each element and NE is the total number of elements
maximum values of the respected matrices. The definition while i is the number of each element.
of minimum values is provided to avoid the singularities
during the optimization iterations. x is the density ratio of 3.2.2 Sensitivity analysis
each element which has a value between 0 and 1. P is
the polarization variable which also has the value between For applying a gradient-based optimization, the sensitivity
0 and 1 and determines the direction of polarization. of objective function with respect to the optimization
puu , puφ , pφφ and pP are penalization coefficients for variables should be calculated. As such, the sensitivity of
the stiffness, coupling, dielectric matrices and polarization objective function with respect to the xi can be derived as
value respectively. It is obvious that in (25), the normalized
form of piezoelectric matrices is used. However, the ∂J ∂ T
= −L Ũ + ΛT K̃uu Ũ + K̃uφ Φ̃ − F̃
interpolation function is true for non-normalized matrices as ∂xi ∂xi
well. ∂ T
= −L + ΛT K̃uu Ũ + ΛT K̃uφ Φ̃ − ΛT F̃
The introduced material interpolation scheme is known ∂xi
as PEMAP-P (piezoelectric material with penalization and (27)
A. Homayouni-Amlashi et al.
Through using the procedure known as adjoint method, the one piezoelectric plate of this paper, B will be a vector
Λ is introduced to avoid taking the derivative of displace- of ones.
u˜i
ment with respect to design variable, i.e., ∂∂x . Therefore, the It is worth to note that the equipotential condition given
following adjoint equation should be solved in (33) will be applied only to the energy harvesting FEM
(19). For the case of actuation, the equipotential condition
− LT + ΛT K̃uu = 0 (28)
will be applied automatically by defining equal applied
where Λ is the global adjoint vector. By solving the adjoint voltage for all of the elements.
(28), the sensitivity values can be obtained as By applying the equipotential condition in (33), the
∂J ∂ k̃uu ∂ k̃uφ energy harvesting FEM (19) can be rewritten as
= λTi ũi + λTi φ̃i (29)
∂xi ∂xi ∂xi Kuu Kuφ Ũ F̃
= (34)
where λi is the elemental format of global adjoint vector Λ. Kφu −Kφφ Vp 0
By using the same procedure, sensitivity analysis with where
respect to polarization P is derived in the following form as
Kuu = K̃uu − M̃ Ω̃ 2
well bc
∂J ∂ k̃uφ Kuφ = K̃uφ B
= λTi φ̃i (30) bc
∂Pi ∂Pi
Kφφ = γ B T K̃φφ B (35)
where λi is the same adjoint vector which is already
calculated in (28). in which ([ ]bc ) shows the application of mechanical
Based on (29) and (30), the derivative of piezoelectric boundary condition.
stiffness and coupling matrices with respect to design Now, the objective function for the energy harvesting
variables is required which can be derived with the help of application should be defined. Generally, the energy con-
(25) as version ratio (Zheng et al. 2009; Noh and Yoon 2012) or
electromechanical coupling coefficient (de Almeida 2019)
∂ k̃uu p −1
= puu (E0 − Emin )xi uu k̃uu which is equivalent mathematically is chosen as the objec-
∂xi tive function. However, this format of objective function
∂ k̃uφ p −1 suffers from numerical instabilities during optimization iter-
= puφ (e0 − emin )xi uφ (2Pi − 1)pP k̃uφ (31)
∂xi ations where it is suggested to penalize the mechanical
energy as suggested in de Almeida (2019) and Salas et al.
∂ k̃uφ
= 2pP (e0 − emin )(2Pi − 1)pP −1 xi uφ k̃uφ (2018). Therefore, to avoid the numerical instabilities here,
p
(32)
∂Pi a classical format of objective function is defined. The opti-
After performing the sensitivity analysis, and defining mization is defined as minimization of the weighted sum of
the constraint, the optimization of variables should be done the mechanical and electrical energy of the system,
by the optimization algorithms which will be discussed later
minimize JEH = wj Π S − (1 − wj )Π E
in this section.
NE
Subject to V (x) = xi vi ≤ V
3.3 Energy harvesting
i=1
0 < xi ≤ 1
3.3.1 Problem formulation
0 ≤ Pi ≤ 1 (36)
In the case of energy harvesting optimization, electri- Π E and Π S are electrical and mechanical energies
cal boundary condition should be applied in addition to respectively which are defined in the following form (Noh
mechanical boundary condition. As mentioned previously, and Yoon 2012; Zheng et al. 2009)
by considering perfectly conductive electrodes, the equipo-
1 1
tential boundary condition can be applied by using the Π =
S
Ũ Kuu Ũ , Π =
T E
VpT Kφφ Vp (37)
Boolean matrix in the following form (Cook and et al 2007) 2 2
In optimization of (36), wj is the weighing factor which
Φ = BVp (33)
has the value between 0 and 1. Choosing the value of 1
in which Vp is the voltage of the top electrode while the for wj will make the optimization problem, a minimum
bottom electrode considered as ground. For a general case of compliance problem in which the goal is to minimize the
multi-layer piezoelectric plates, Boolean matrix B is having mechanical deflection of the system under the applied force.
the dimension of Ne × NP where Ne is the number of nodes By decreasing the value of wj , more weight will be given to
and NP is the number of electrodes. However, in the case of maximize the output electrical energy. However, choosing
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
very small values for wj will result in mechanically unstable in which μ and λ are the elemental adjoint vectors which
layouts. Therefore, the value for wj will be found by using are calculated by the following global coupled system
trial and error approach. The basis for choosing this value
Kuu Kuφ Λ1 −Kuu Ũ
can be the maximum energy conversion factor of the plate =
Kφu −Kφφ Υ1 0
under the same force. For example, in Homayouni-Amlashi
et al. (2020b), the maximum energy conversion factor for Kuu Kuφ Λ2 0
= (40)
an optimized piezoelectric plate under planar excitation is Kφu −Kφφ Υ2 −Kφφ Vp
found to be 0.03 while in Noh and Yoon (2012) for a two- where Λ and Υ are the global adjoint vectors which need to
layer optimized piezoelectric plate under the bending force be disassembled to form the elemental adjoint vectors
this ratio is 0.1. Therefore, the initial value of wj for the
trial error approach can be considered between 0.01 and [λ1 ]bc = Λ1 , [λ2 ]bc = Λ2 , [μ1 ] = BΥ1 , [μ2 ] = BΥ2 (41)
0.1. The final chosen value of wj depends on the maximum
Now, the sensitivities with respect to polarization (P )
stress and strain induced by the defined mechanical input to
are calculated as well (Homayouni-Amlashi et al. 2020b;
the structure which can be revealed by the post processing
Homayouni-Amlashi 2019)
analysis. On the other hand, stress and strain constraints
can also be considered in the optimization problem as it is ∂Π S ∂ k̃uφ ∂ k̃φu
investigated by Wein et al. (2013). = λT1,i φ̃i + μT1,i ũi
∂Pi ∂Pi ∂Pi
In fact, the advantage of the objective function defined ∂Π E ∂ k̃uφ ∂ k̃φu
here is that the optimization algorithm converges very = λT2,i φ̃i + μT2,i ũi (42)
∂Pi ∂Pi ∂Pi
smoothly to the final result. However, the drawback of this
objective function is that the obtained result can be sub- Based on sensitivity equations in (39) and (42), the
optimal depending on the chosen value for the wj . On the derivative of all piezoelectric matrices with respect to the
other hand, the problem of sub-optimal results exists in design variables is required. The derivative of stiffness
other formats of the objective function. For example, Noh and coupling matrices is found in (31) and (32). Here,
and Yoon (2012) showed that by considering the energy the derivative of dielectric matrix and mass matrix is also
conversion factor (Π E /Π S ) as objective function, different required which are
values of penalization factors can produce different results. ∂ k̃φφ p −1
Eventually, we believe that the chosen objective function = pφφ (ε0 − εmin )xi φφ k̃φφ
∂xi
suits the educational purpose of this paper. Indeed, with
∂ m̃
the help of provided MATLAB code, the readers can easily = m̃i (43)
change the code to implement other objective functions. ∂xi
In addition to derivative of piezoelectric matrices with
3.3.2 Sensitivity analysis respect to density, derivation of the piezoelectric coupling
matrix with respect to polarization variable is also required
Similar to the actuation case, the next step after defining
∂ k̃uφ
= 2pP (2Pi − 1)pP −1 xi uφ k̃uφ
p
the objective function is sensitivity analysis. Since the (44)
objective function in (36) consists of mechanical and ∂Pi
electrical energies, the sensitivity of each energy with After calculation of sensitivities, the optimization vari-
respect to density ratio x can be found as (Zheng et al. 2009; ables can be updated in each iteration of optimization with
Homayouni-Amlashi 2019; Homayouni-Amlashi et al. the help of optimization algorithm which is the subject of
2020b) the next section.
∂Π S 1 T ∂(k̃uu − m̃Ω̃ 2 ) 3.4 Optimization algorithms
= ũ + λT1,i ũi
∂xi 2 i ∂xi
∂ k̃uφ ∂ k̃φu γ ∂ k̃φφ For solving the optimization problem, there are several
+λT1,i φ̃i + μT1,i ũi − μT1,i φ̃i (38) optimization algorithm like sequential linear programming
∂xi ∂xi ∂xi
(SLP), sequential quadratic programming (SQP), method
∂Π E 1 γ ∂ k̃φφ γ ∂ k̃φφ of moving asymptotes (MMA) or the optimality criteria
= φ̃iT φ̃i − μT2,i φ̃i
∂xi 2 ∂xi ∂xi (OC) method. This latter one is more historical than the
∂(k̃uu − m̃Ω̃ 2 ) ∂ k̃uφ ∂ k̃φu other methods and its application is more simple. However,
+λT2,i ui + λT2,i φ̃i + μT2,i ũi
∂xi ∂xi ∂xi MMA is more powerful in terms of solving multi-variable
(39) and multi-constraint optimization problems. In addition, the
A. Homayouni-Amlashi et al.
convergence in MMA is more assured due to consideration Similar to the classical compliant problems of passive
of two past successive iterations during optimization. material (Bendsoe 2013), the values of move and η are
Therefore, in this paper to solve the actuation problem, considered to be 0.2 and 0.3 respectively.
the OC method is implemented so the proposed code is For optimization of polarization there is no volume
self-working. However, the OC method has convergence constraint. In fact, since the polarization of each element
problem in energy harvesting code due to coupling effect will be optimized separately, it is not necessary to force
of piezoelectric material. In the upcoming two sections, the the optimization algorithm to push the polarization value to
OC method and MMA and their implementation codes will zero for the elements with low density values. Therefore, the
be explained. optimization problem can be simply defined as follows
∂J
3.4.1 Optimality criteria method =0 (48)
∂Pi
Optimality criteria is a heuristic method to update the The algorithm for this simple optimization can be
design variables in each element of design domain during obtained by modifying the OC algorithm given in (46) in the
each iteration of optimization. Here, there are two design following form
variables for each element including the density and
polarization. It is common for structural optimization with max(0, Pi − move) if ∂P ∂J
≥0
Pi =
new i (49)
optimality criteria that the mutual influence of the design min(1, Pi + move) if ∂Pi < 0
∂J
for all i and the optimization problem mentioned in (50) will There are several studies which focused on defining
be matched to the optimization problem of this paper. the criteria for choosing other penalization coefficients,
Finally, the OC and MMA optimization algorithms i.e., puφ , pφφ and pP (Kim and Shin 2013; Noh and
can update the optimization variables in each iteration of Yoon 2012; Kim et al. 2010). In particular, Noh and
optimization. To do so, the implementation code for both of Yoon (2012) chose the penalization factors randomly and
OC and MMA will be given in Section 4. obtained different density layouts. The final conclusion
was that the penalization factors have extreme effect on
3.5 Filtering the final topology. But, no criteria or rule is presented in
this study about the method of choosing the penalization
Like other problems in structural optimization, topology factors. On the other hand, a detailed study is presented
optimization of piezoelectric materials also suffers from by Kim et al. (2010) for choosing the penalization factors.
numerical instabilities such as checker board problem or Based on this study, necessary condition for choosing the
mesh dependency. To remedy, the solutions need to be penalization factors is that the electromechanical coupling
filtered in each iteration of optimization. So far, many coefficient (EMCC) should be increased when the density
filtering methods are suggested in the literature (Sigmund (x) increases and vice versa. Based on this condition, the
2007). Among the proposed filtering methods, sensitivity following intrinsic condition which is independent from
filter and density filter proved their success in overcoming objective function is proposed for choosing the penalization
the aforementioned numerical instabilities. The sensitivity factors (Kim et al. 2010)
filter is used in the 99 lines of topology optimization code
2puφ − puu + pφφ > 0 (51)
written by Sigmund (2001) and density filter is used as an
alternative option in the 88 lines of topology optimization In addition to this condition, Kim et al. (2010) proposed
code written by Andreassen et al. (2011). As such, in other objective dependent criteria for the actuation and
this paper, the density and sensitivity filters are used as energy harvesting application. In particular, for the actuation
two available options. To implement these filters, the same objective function in (26), the following condition is
lines of codes written in 88 lines of code by Andreassen proposed (Kim et al. 2010),
et al. (2011) are employed. Therefore, the concepts behind puφ − puu > 0 (52)
these filters will not be explained here since the related
explanations can be found in the mentioned references. and for energy harvesting approach, when the objective
The important point here is that the density filter shows function is energy conversion factor then the following
more promising performance in comparison with sensitivity conditions should be satisfied (Kim et al. 2010),
filter specially in the case of energy harvesting problem with puφ − puu > 0
using the MMA as the optimization algorithm.
pφφ − puu > 0 (53)
Finally, the filters will be applied only to the densities
and filtering of the polarization variable is not necessary. It should be noted that these conditions are proposed to
guarantee the convergence of the final topology and yet
3.6 Choosing proper penalization factors there is no study on the methods to define these penalization
factors to avoid the local optima.
After preparing the ingredients of topology optimization For polarization penalization, the value of 1 seems the
algorithm, the important question would be how to tune best choice as it is suggested by Kögl and Silva (2005).
the parameters of optimization? in addition to parameters Indeed, it is not necessary to penalize the polarization.
which are the same for optimization of passive and active
materials like radius of filtering and volume fraction, there
are other parameters which belong to multiphysics nature 4 MATLAB implementation codes
of piezoelectric topology optimization like penalization
coefficients of the piezoelectric matrices, i.e., puφ , pφφ and In this section, the goal is to establish the MATLAB code for
pP . In fact by choosing the penalization coefficients, we the piezoelectric optimization methodology explained in the
are pursuing two goals: (1) guaranteeing the convergence previous section. Two MATLAB codes are mentioned in the
to perfect void-material in the final obtained layout, (2) Appendix of the paper. The first code is for actuation and the
avoiding local optima. For choosing puu , it is already proven second code is for energy harvesting. Each MATLAB code
that the value of 3 is the best choice (Bendsoe 2013) to reach is partitioned so the readers can have a perception of the goal
a perfect void/material in the final layout. of each part. The important lines of codes are also labeled
A. Homayouni-Amlashi et al.
to provide a connection between the line and the analytical analytical calculations, elemental matrices are calculated by
calculation. Again, the rest of this section will be divided for using the two-point Gauss quadrature method. To do so, first
actuation and energy harvesting codes and in each section the geometrical sizes of each element are calculated based
different parts of the codes will be explained more in detail. on the defined geometry of the design domain and desired
resolution of mesh. Then, Gauss quadrature points are
4.1 Actuation defined in matrix GP. Afterwards, the elemental matrices
are found inside a loop with the help of Gauss points as
4.1.1 General definition follows,
matrix with rows containing the node IDs. However, due to matrix. To avoid redundancy, there is no iKpp and jKpp. In
equipotential condition, one potential degree of freedom is fact, these latter are just equal to the edofMatPZT.
considered for each element and the potential connectivity The material interpolation scheme mentioned in (25),
is a vector. At last, the connectivity matrix edofMat and the is applied in sKuu and sKup matrices. xPhys(:) and
potential connectivity vector edofMatPZT is defined as pol(:) are the vectorized physical density and polarization
matrices respectively which will be updated in each iteration
of optimization.
equal to 1, the stiffness will be equal to the highest (26) that the sensitivity of volume constraint with respect to
value of the piezoelectric stiffness matrix. In this case, P is zero.
the piezoelectric layout will be optimized to produce As can be seen in the aforementioned lines of the code,
maximum possible of force. However, by defining very the sensitivities containing the stiffness (kuu) and coupling
low values of stiffness for the spring (i.e., 0.01), then matrix (kup) are calculated separately. This will help us to
the piezoelectric layout will be optimized for maximum define different penalization coefficients for each of these
possible of deflection. matrices.
Calculation of objective function for actuator is a routine The implementation lines of code for the OC update of
procedure to calculate the desired displacement in each densities are the same as what is mentioned in 88 lines
iteration. To do so, first the mechanical displacement due to of code (Andreassen et al. 2011). In addition to densities,
applied voltage should be calculated. Therefore, based on for updating the polarization based on algorithm (49), there
(21), the mechanical displacement vector is calculated by is no need for the bi-sectioning loop and just one line
the following line of code of code can optimize the polarization in each iteration of
optimization as follows
4.1.10 Filtering
the objective function’s weighing factor (wj) and excitation (23). This modification is done by the following line of
frequency (omega) are defined. code
Fig. 3 Topology optimization of a piezoelectric actuator (pusher) for and d, f, h, j respectively present the density and polarization pro-
different stiffness of the modeled spring. Panel a presents the spec- file of the design for the specified output stiffness after convergence.
ification for a practical use and panel b is the mechanical model For the polarization profile, blue, red and green represent respectively
for implementation in the finite element software. Panels c, e, g, i negative, positive and null polarization
After updating the optimization variables and plotting the width and length of each element increases the inaccuracy
results, this iteration of optimization will be finished and the of the finite element model (Logan 2000). Therefore, it
optimization will be started from the beginning of the loop is recommended to follow the aspect ratio of the plate in
for the next iteration. defining the number of elements in x and y directions.
The chosen penalization factors are puu = 3 and puφ =
4, which satisfy the conditions mentioned in (52). These
5 Numerical examples penalization factors are the same for all of the actuation
examples.
In this section, the goal is to investigate the performances For having a completely symmetrical response with
of the codes in different application cases of actuation respect to the horizontal dotted line in Fig. 3a and to
and energy harvesting with different configurations. First, decrease the number of elements in the design domain, the
different examples of actuation will be investigated. defined design domain in the code is the upper half of the
Thereafter, different configurations of energy harvesting are piezoelectric plate. Therefore, in the symmetry line of the
explored. design domain, the roller mechanical boundary condition is
applied with the following line of code,
5.1 Actuation
5.1.1 Pusher
With this mechanical boundary condition, the nodes
The first example in the actuation part is a simple pusher connected to the symmetry line can have displacement in
as can be seen in Fig. 3a. The gray area shows the the x direction but not in the y direction.
design domain which can be optimized by the optimization As can be seen in Fig. 3, the results of topology
algorithm. The actuation optimization code which is optimization for different spring stiffness are plotted. The
mentioned in the Appendix is written for this example. As it upper row of the figure shows the density layout while the
can be seen from the code, the aspect ratio of the elements in lower row shows the polarization profile. By mirroring the
the x and y directions is following the aspect ratio between obtained result with respect to the symmetry line, the results
the length and width of the plate which produces square are illustrated for whole piezoelectric plate.
elements for discretization of the design domain. This is not The numerical results for different spring stiffness are
mandatory, but it is known that increasing the aspect ratio of also reported in Table 1. The numerical results show the
A. Homayouni-Amlashi et al.
Table 1 Displacement amplification ratio of optimized actuators with be done to the actuation code in the Appendix. First of all,
respect to full plate the OUTPUT DISPLACEMENT DEFINITION part should
Pusher Gripper be completely changed by replacing the following lines
ks Amplification ks Amplification
ratio ratio
Fig. 4 Topology optimization of a piezoelectric gripper for different stiffness of the modeled spring. The panels follow the same presentation as
Fig.3
gripper needs the combination of expansion and retraction for the energy harvesting code in contrast to actuation
for increasing the amplification ratio. part are not the same for all cases. As such in Table 2,
the penalization factors are reported for each case. But,
5.2 Energy harvesting for all cases, the chosen penalization factors are satisfying
the conditions mentioned in (51) and (52). The reason for
5.2.1 Lateral force different penalization factors for each case is that the energy
harvesting optimization is more complicated than actuation
The first example of the energy harvesting code is a plate due to existence of the coupling effect. This coupling effect
under a lateral force excitation as it is shown in Fig. 5. is highly affected by the chosen penalization factors in
The code in the Appendix is written for this case. Here, particular puφ and pφφ . By choosing proper penalization
the goal is to maximize the output electrical energy while factors, it is possible to avoid the nonsymmetric results or to
minimizing the mechanical energy of the system. For this improve the convergence.
case, the problem is static and the excitation frequency The results of optimization for different values of the
is considered to be zero. The chosen penalization factors weighting factor (wj ) are illustrated in Fig. 5. For the first
Fig. 5 Topology optimization of a piezoelectric energy harvester under c, e, g, and d, f, h respectively present the density and polarization pro-
application of a lateral static force for different values of wj . Panel a file of the obtained design. For the polarization profile, blue, red and
presents the specification for a practical use and panel b is the result green represent respectively negative, positive and null polarization
that can be obtained through classical compliance optimization. Panels
A. Homayouni-Amlashi et al.
Table 2 Output energies of the optimized designs for different weighting factors
Lateral force
Compliance 1 116.66 0.00 3 6 4 0 0 volfrac 1
CASE (1) 1 99.90 1.25 3 6 4 1 0 volfrac 1
CASE (2) 0.01 152.87 1.70 3 4 4 1 0 volfrac 1
CASE (3) 0.005 741.09 7.77 3 4 4 1 0 volfrac 1
CASE (4) 1 106.04 1.38 3 6 6 1 1 kHz volfrac 1
CASE (5) 0.01 123.15 1.43 3 6 6 1 1 kHz volfrac 0.1
CASE (6) 0.02 240.50 2.63 3 6 4 1 3.5 kHz volfrac 0.1
2 load case
Compliance 1 106 0.03 3 6 6 0 0 1 1
CASE (1) 0.005 168.54 1.20 3 6 6 1 0 1 1
CASE (2) 1 107.88 0.86 3 6 6 1 1 kHz 1 0.1
CASE (3) 0.005 163.43 1.04 3 6 4 1 1 kHz 1 0.1
CASE (4) 0.05 120.06 0.95 3 6 6 1 1.5 kHz 1 0.1
case, the weighting (wj ) is equal to 1. As such, the problem In the next case, the goal is to increase the electrical
is now a compliance problem in which minimization of energy due to the same amount of force. To do so, the
deflection is the target. In this case, the optimization is weighting factor is decreased to 0.01. As can be seen
done without polarization optimization. To do optimization in Fig. 5e and f, the density layout is changed and
without polarization, it is possible to simply put the the polarization profile is changed accordingly as well.
penalization factor for the polarization equal to 0, i.e., By observing the obtained numerical results in Table 2,
penalPol = 0 in GENERAL DEFINITIONS part of the the electrical energy is increased in comparison with the
code. As can be seen in Fig. 5b, the obtained density previous cases with the cost of increasing the mechanical
layout for this case is similar to the results of the topology energy as well. By further increasing the weighting factor,
optimization of passive materials as reported by 99 lines the results of Fig. 5g and h will be obtained in which a
(Sigmund 2001) or 88 lines (Andreassen et al. 2011) of jump in both mechanical energy and electrical energy of the
MATLAB code. This was expected since the PZT materials design can be seen in Table 2.
have the plane isotropic behavior. The numerical results of It can be noticed that in the optimized polarization profiles,
the optimizations are given in Table 2. It is reported for the there are areas with null polarity (green color) while there
aforementioned case that the output electrical energy is zero are materials (non-void). This null polarity is mostly at
which is due to the charge cancellation. In fact, lateral force places where there is a transition between the polarization
induces tension and compression in different parts of the direction. It is possible to take these null polarity areas into
piezoelectric plate which produces voltages with opposite consideration in the optimization problem formulation as
sign on the surface of the electrode. The opposite signs of discussed in Donoso and Sigmund (2016).
voltages nullify each other. In the next example, the piezoelectric plate with the
For the next case, polarization is also optimized by same configuration of boundary and load condition is
putting penalPol = 1. In Fig. 5c and d, it is obvious considered while the force is considered to be harmonic. In
that the density layout did not change and the polarization Fig. 6, the results of topology optimization under harmonic
profile is not uniform anymore. By this polarization force can be seen. The related numerical results are also
optimization, based on Table 2, not only the mechanical reported in Table 2. In this figure, the excitation frequency
energy of the piezoelectric plate is reduced in comparison is primarily considered to be 1 kHz. At this frequency,
with the first case, but also the problem of charge the optimization converges to the final layout for different
cancellation is suppressed and we have a non-zero electrical values of wj . However, by increasing the frequency of
energy. excitation, convergence problems begin. The problems are
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
Fig. 6 Topology optimization of a piezoelectric energy harvester under and c, e, g respectively present the density and polarization profile of
application of a lateral harmonic force for different values of wj . Panel the obtained design. For the polarization profile, blue, red and green
a presents the specification for a practical use and panels b, d, f, represent respectively negative, positive and null polarization.
parasitic effects of the material layout and the force will be increased gradually during the optimization iterations. Liu
disjointed from the material. These problems are due to the et al. (2015) and Jensen (2007) modeled the damping in the
fact that the excitation frequency is close to the resonance dynamic system and optimized the structure for an interval
and antiresonance frequency of the piezoelectric plate. The of frequencies including the resonance ones. For mechanical
resonances are the natural frequencies when the electrodes structures, the goal is to reduce the displacement or stored
are short-circuited and antiresonances are the ones when mechanical energy in the system. For piezoelectric energy
the electrodes are in open-circuit condition (Lerch 1990). harvesters in which the maximization of electrical output
During the optimization, these frequencies are changing in regarding the mechanical input is desired, Noh and Yoon
each iteration. Therefore, it is possible that the excitation (2012) solved the disjoint problem of force and material
frequency comes close to the resonance frequency during in dynamic topology optimization by defining a constraint
the optimization which will introduce singularity in the on the mechanical energy of the piezoelectric structure and
FEM (23) and the amplitude of the displacement vector they defined the objective function as maximization of the
reaches to infinity. Even by defining the damping, still the electrical output of the system.
jump in the displacement vector will result in numerical Reducing the weighting factor wj brings the resonance
instabilities and disjoint problem in which the force will frequency closer to the excitation frequency to some
be disconnected from material as it is reported by Noh extent. However, a very low weighing factor can introduce
and Yoon (2012). One solution to reduce the numerical convergence problems as well. On the other hand, for
instabilities is to restrict the move limit of the MMA piezoelectric energy harvesters, matching the resonance
code. Indeed, the move limit of the MMA optimization frequency and excitation frequency is favorable. To do so,
code is by default set to 1 which means the density of the problem formulation should be changed. For example,
material can jump from 0 (void) to 1 (material) in a single Kim and Shin (2013) did eigenfrequency optimization to
iteration. To modify this move limit, in the mmasub.m, increase the electromechanical coupling coefficient of the
one needs to change the value of move from 1 to 0.1. design and to match the resonance frequency and the
With this restriction on the move limit, convergence to excitation frequency. Wang et al. (2017) and Nakasone
a black and white final layout is achieved for 3.5 kHz and Silva (2010) formulated the optimization problem to
excitation frequencies as it is shown in Fig. 6f and g. optimize the eigenmodes in addition to optimization of
However, by reducing the MMA move limit, the final result the eigenfrequency. It is worth mentioning that for these
can be trapped in the local optima. This is the maximum problem formulations, alternative material interpolation
excitation frequency that the convergence can be achieved. functions should be used to avoid the artificial local modes
After this frequency, again the force will be disjointed in the low-density regions (Pedersen 2000). The alternative
from the material and the convergence problem can be material interpolation functions can be the one introduced
seen. To overcome the challenges of dynamic topology by Huang et al. (2010) for the stiffness matrix or the RAMP
optimization of mechanical structures, several methods interpolation function which is used by Nakasone and Silva
can be found in the literature. For example, Olhoff and (2010) in combination with the PEMAP-P interpolation
Du (2005) suggest that the excitation frequency can be function.
A. Homayouni-Amlashi et al.
Fig. 7 Topology optimization of a piezoelectric energy harvester under c, e, g, i and d, f, h, j respectively present the density and polar-
application of 2 load cases for different values of wj and Ω. Panel a ization profile of the obtained design. For the polarization profile,
presents the specification for a practical use and panel b is the result blue, red and green represent respectively negative, positive and null
that can be obtained through classical compliance optimization. Panels polarization
5.2.2 Two loads case BCTratio is the ratio of the clamped part to the total
length of the edge. To define the two load case the part
In this example, the goal is to optimize piezoelectric energy FORCE DEFINITION will be changed with the following
harvesters for two loads case as shown in Fig. 7a. In fact, lines:
the piezoelectric plate will be optimized for in-plane forces
that can come from different directions as it is discussed in
Homayouni-Amlashi et al. (2020b) since any in-plane force
can be decomposed to the load cases shown in Fig. 7a. The
mechanical boundary condition of this figure is proposed to
make the harvested energy symmetric with respect to the
forces in each direction as it is possible.
To implement the two loads case, the following changes In contrast to previous case, the initial values for the
should be made to the energy harvesting code mentioned densities (x{0} ) are not equal to volume fraction (volfrac).
in the Appendix. The parameters in the GENERAL It is observed that by changing the initial values to one,
DEFINITIONS part should be changed by putting Lp the obtained results are more symmetric. Therefore, the
= 3e−2, Wp = 3e−2, nelx = 100, and nely = 100. following line of energy harvesting code is updated,
To define the boundary condition, the DEFINITION
OF BOUNDARY CONDITION part will be changed
completely as follows
fact that with the defined geometry and boundary condition, codes are developed based on the finite element modeling
the first resonance frequency is lower than the previous of piezoelectric materials. The PEMAP-P as an extension of
example of Fig. 6. SIMP approaches is used for material interpolation scheme.
Optimality criteria and method of moving asymptotes are
used for optimization of element’s density and polariza-
6 Discussion tion direction. Different parts of the codes are explained
in detail to make the implementation and extension of the
In the actuation code, the optimization algorithm is OC. codes straightforward. Some basic and general examples are
However, it is very simple to apply the MMA to the chosen to show the effectiveness of the codes. The aim of
actuation code. One has just to copy the MMA Preparation the codes is to help the students and newcomers in the field
part from the energy harvesting code and paste it after the of topology optimization of smart materials in particular
INITIALIZE ITERATION part of the actuation code. Then, the piezoelectric material. While the codes have been and
one has to remove the OPTIMALITY CRITERIA UPDATE can be used for energy harvesting and actuation applica-
OF DESIGN VARIABLES part and substitute the MMA tions, perspective works include their application to opti-
OPTIMIZATION OF DESIGN VARIABLES part from the mization of piezoelectric sensors as well as piezoelectric
energy harvesting code. It will be observed that the obtained sensors-actuators, also named as self-sensing (Bafumba
result remains the same. Liseli and Agnus 2019; Rakotondrabe 2013; Aljanaideh
It is possible to implement the OC in the energy et al. 2018).
harvesting code as well. This can be simply done by
substituting the MMA OPTIMIZATION OF DESIGN
VARIABLES part with the OPTIMALITY CRITERIA Funding This work has been supported by the national CODE-
UPDATE OF DESIGN VARIABLES part of the actuation TRACK project (ANR-17-CE05-0014-01, Control theory tools for
optimal design of piezoelectric energy harvesters devoted to birds
code. However, due to coupling effect, sometimes the tracking devices). This work has also been partially supported by the
convergence problem appears. Bourgogne Franche-Comté region project COMPACT.
It should be noted that the results presented in this
paper are not the best results that can be obtained from the Compliance with ethical standards
codes. In fact by changing the penalization factors, volume
fraction, filter radius and initial values, different results can Conflict of interest The authors declare that they have no conflict of
be obtained. However, finding the best results or performing interest.
the parameters analysis on the final results is not the subject
of this educational paper.
Replication of results All the results presented in this work can be
There are similar aspects between the proposed codes reproduced with the MATLAB code available within the paper and by
here and the 88 lines of MATLAB code (Andreassen adding reference of this latter.
et al. 2011), such as the use of different filtering methods,
different boundary conditions, and different load cases.
These aspects are not discussed here since the procedures of Appendix: Proof of normalization
implementation are similar.
Extension of the codes for different goals such as Here the goal is to prove the normalization which is
different objective functions, multi-material optimization, proposed by authors in Homayouni-Amlashi (2019) and
and 3D finite element modeling is straightforward. For Homayouni-Amlashi et al. (2020b). To normalize the global
example, the 169 lines of code for 3D topology optimization FEM equation of the piezoelectric plate
(Liu and Tovar 2014) of passive material are the extension
of the 88 lines of code. The same strategy can be used for the
Kuu − MΩ 2 Kuφ U F
proposed code here to extend the code for 3D finite elements = (A.1)
Kφu −Kφφ Φ 0
to consider multi-layer piezoelectric plates and out of plane
forces. the first step of normalization is to factorize the values
defined in (20) and (22)
Two MATLAB codes are proposed for topology optimiza- Kφφ = β0 K̃φφ , U = u0 Ũ , Φ = φ0 Φ̃, F = f0 F̃
tion of piezoelectric actuators and energy harvesters. The (A.2)
A. Homayouni-Amlashi et al.
It should be noted that since the responses of the system, Now, it can be considered that
i.e., U and Φ are unknown, their factorization values will be
1 −1
defined later. K̃ K̃φu Ũ = Φ̃ (A.12)
With the help of factorization defined in (A.2), (A.1) can γ φφ
be rewritten as follows, If one write (A.12) as
k0 K̃uu − m0 M̃Ω 2 α0 K̃uφ u0 Ũ f0 F̃ K̃φu Ũ − γ K̃φφ Φ̃ = 0 (A.13)
= (A.3)
α0 K̃φu −β0 K̃φφ φ0 Φ̃ 0
then the following linearly coupled equation can be
written with the help of (A.11) and (A.13)
This is two linearly coupled equations. The second
equation can be written as
K̃uu − M̃ Ω̃ 2 K̃uφ Ũ F̃
= (A.14)
K̃φu −γ K̃φφ Φ̃ 0
α0 u0 K̃φu Ũ − β0 φ0 K̃φφ Φ̃ = 0 (A.4)
which is the same as (23) of the paper.
Then, the Φ̃ will be However, right now we have two equations for Φ̃ in
(A.12) and (A.5). By equating these two equations results in
α0 u0 −1
Φ̃ = K̃ K̃φu Ũ (A.5) α0 u0 −1 1 −1
β0 φ0 φφ Φ̃ = K̃φφ K̃φu Ũ = K̃φφ K̃φu Ũ (A.15)
β0 φ0 γ
The first linear equation from (A.3) can be written as We can then simplify both sides and replace the γ
coefficient
(k0 K̃uu − m0 M̃Ω 2 )u0 Ũ + α0 φ0 K̃uφ Φ̃ = f0 F̃ (A.6)
α0 u0 α2
= 0 (A.16)
By substituting (A.5) to (A.6) and dividing the resulted β0 φ0 β0 k 0
equation by k0 u0 , one will have We will find the following equation for φ0 ,
m0 α0 φ0 α0 u0 −1 u0 k0
K̃uu − M̃Ω 2 Ũ + K̃uφ K̃φφ K̃φu Ũ φ0 = (A.17)
k0 u0 k0 β0 φ0 α0
f0
= F̃ (A.7) But from (A.8) u0 can be replaced and the final value for
k0 u0 φ0 will be
Now, it is possible to define, f0
φ0 = (A.18)
α0
m0 2 f0
Ω̃ 2 = Ω , u0 = (A.8) Now, by finding the values of γ , u0 and φ0 , the normal-
k0 k0
ization of global FEM equations of piezoelectric material
By substituting (A.8) to (A.7) is finished. Actuation is the sub problem for the aforemen-
tioned normalization. Only (16) should be normalized. This
equation with the help of the normalization factors defined
α02 −1
(K̃uu − M̃ Ω̃ 2 )Ũ + K̃uφ K̃φφ K̃φu Ũ = F̃ (A.9) in (20) and (24) can be written as
β0 k 0
k0 K̃uu u0 Ũ + α0 K̃uφ φ0 Φ̃ = f0 F̃ (A.19)
Now, the normalization factor can be defined as
By dividing each side of equation by f0 ,
β0 k 0
=γ (A.10) k0 α0
α02 K̃uu u0 Ũ + K̃uφ φ0 Φ̃ = F̃ (A.20)
f0 f0
Again, the (A.9) can be written as, Now by considering u0 and φ0 equal to values in (A.8)
and (A.18), the normalized (21) will be obtained.
1 −1
(K̃uu − M̃ Ω̃ 2 )Ũ + K̃uφ K̃φφ K̃φu Ũ = F̃ (A.11)
γ K̃uu Ũ + K̃uφ Φ̃ = F̃ (A.21)
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
A. Homayouni-Amlashi et al.
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
A. Homayouni-Amlashi et al.
2D topology optimization MATLAB codes for piezoelectric actuators and energy harvesters
A. Homayouni-Amlashi et al.
Gonċalves JF, De Leon DM, Perondi EA (2018) Simultaneous Muthalif AG, Nordin ND (2015) Optimal piezoelectric beam shape
optimization of piezoelectric actuator topology and polarization. for single and broadband vibration energy harvesting: Modeling,
Struct Multidiscip Optim 58(3):1139–1154 simulation and experimental results. Mech Syst Signal Process
Guo X, Zhang W, Zhong W (2014) Doing topology optimization 54:417–426
explicitly and geometrically—a new moving morphable compo- Nakasone P, Silva E (2010) Dynamic design of piezoelectric laminated
nents based framework. J Appl Mech 81(8) sensors and actuators using topology optimization. J Intell Mater
Hassani B, Hinton E (1998) A review of homogenization and topology Syst Struct 21(16):1627–1652
optimization iii—topology optimization using optimality criteria. Noh JY, Yoon GH (2012) Topology optimization of piezoelectric
Comput Struct 69(6):739–756 energy harvesting devices considering static and harmonic
Homayouni-Amlashi A (2019) Multi directional piezoelectric plate dynamic loads. Adv Eng Softw 53:45–60
energy harvesters designed by topology optimization algorithm. Olhoff N, Du J (2005) Topological design of continuum structures
IEEE Robot Autom Lett, Rakotondrabe M subjected to forced vibration. In: Proceedings of 6th world
Homayouni-Amlashi A, Mohand-Ousaid A, Rakotondrabe M (2020a) congresses of structural and multidisciplinary optimization, Rio de
Analytical modelling and optimization of a piezoelectric can- Janeiro, Brazil
tilever energy harvester with in-span attachment. Micromachines Pedersen NL (2000) Maximization of eigenvalues using topology
11(6):591 optimization. Structural Multidiscip Optim 20(1):2–11
Homayouni-Amlashi A, Mohand-Ousaid A, Rakotondrabe M (2020b) Piefort V (2001) Finite element modelling of piezoelectric active
Topology optimization of 2dof piezoelectric plate energy harvester structures. PhD thesis, Ph. D. thesis. Bruxelles, Belgium:
under external in-plane force. J Micro-Bio Robot 1–13 Université Libre de Bruxelles, Department ...
Huang X, Zuo Z, Xie Y (2010) Evolutionary topological optimization Rabenorosoa K et al (2015) Performances analysis of piezoelectric
of vibrating continuum structures for natural frequencies. Comput cantilever based energy harvester devoted to mesoscale intra-body
Struct 88(5-6):357–364 robot
Hutton DV, Wu J (2004) Fundamentals of finite element analysis, Rakotondrabe M (2011) Performances inclusion for stable interval
vol 1. McGraw-hill, New York systems. In: American control conference, pp 4367–4372
Jensen JS (2007) Topology optimization of dynamics problems with Rakotondrabe M (2013) Combining self-sensing with an unkown-
padé approximants. Int J Numer Methods Eng 72(13):1605–1630 input-observer to estimate the displacement, the force and the
Junior CDM, Erturk A, Inman DJ (2009) An electromechanical finite state in piezoelectric cantilevered actuator. In: American control
element model for piezoelectric energy harvester plates. J Sound conference, pp 4523–4530
Vib 327(1-2):9–25 Rakotondrabe M, Khadraoui S (2013) Design of piezoelectric
Kattan PI (2010) MATLAB guide to finite elements: an interactive actuators with guaranteed performances using the performances
approach. Springer Science and Business Media, Berlin inclusion theorem and interval tools. In: Smart materials-based
Khadraoui S, Rakotondrabe M, Lutz P (2014) Optimal design of actuators at the micro/nano-scale. Springer
piezoelectric cantilevered actuators with guaranteed performances Ruiz D, Dı́az-Molina A, Sigmund O, Donoso A, Bellido J, Sánchez-
by using interval techniques. IEEE ASME Trans Mechatron Rojas J (2017) Optimal design of a microgripper-type actuator
19(5):1660–1668 based on aln/si heterogeneous bimorph. In: Smart sensors,
Kim C, Shin JW (2013) Topology optimization of piezoelectric actuators, and MEMS VIII, International society for optics and
materials and application to the cantilever beams for vibration photonics, vol 10246, p 1024606
energy harvesting. Int J Precis Eng Manuf 14(11):1925–1931 Rupp CJ, Evgrafov A, Maute K, Dunn ML (2009) Design of
Kim JE, Kim DS, Ma PS, Kim YY (2010) Multi-physics interpolation piezoelectric energy harvesting systems: a topology optimization
for the topology optimization of piezoelectric systems. Comput approach based on multilayer plates and shells. J Intell Mater Syst
Methods Appl Mech Eng 199(49-52):3153–3168 Struct 20(16):1923–1939
Kögl M, Silva EC (2005) Topology optimization of smart structures: Salas R, Ramı́rez F, Montealegre-Rubio W, Silva E, Reddy J (2018)
design of piezoelectric plate and shell actuators. ?Smart Mater A topology optimization formulation for transient design of
Struct 14(2):387 multi-entry laminated piezocomposite energy harvesting devices
Lerch R (1990) Simulation of piezoelectric devices by two-and three- coupled with electrical circuit. Int J Numer Methods Eng
dimensional finite elements. IEEE Trans Ultrason Ferroelectr Freq 113(8):1370–1410
Control 37(3):233–247 Schlinquer T, Mohand-Ousaid A, Rakotondrabe M (2017) Optimal
Liu H, Zhang W, Gao T (2015) A comparative study of dynamic design of a unimorph piezoelectric cantilever devoted to energy
analysis methods for structural topology optimization under harvesting to supply animal tracking devices. IFAC-PapersOnLine
harmonic force excitations. Struct Multidiscip Optim 51(6):1321– 50(1):14600–14605
1333 Schmit LA (1960) Structural design by systematic synthesis. In:
Liu K, Tovar A (2014) An efficient 3d topology optimization code Proceedings of the second national conference on electronic
written in matlab. Struct Multidiscip Optim 50(6):1175–1196 computation, ASCE, Sept. 1960
Logan DL (2000) A first course in the finite element method using Sigmund O (2001) A 99 line topology optimization code written in
Algor. Brooks/Cole Publishing Co, Pacific Grove matlab. Struct Multidiscip Optim 21(2):120–127
Maute K, Sigmund O (2013) Topology optimization approaches: a Sigmund O (2007) Morphology-based black and white filters for
comparative review. Struct Multidiscip Optim 6 topology optimization. Struct Multidiscip Optim 33(4-5):401–424
Menuzzi O, Fonseca JS, Perondi EA, Gonċalves JF, Padoin E, Silveira Sigmund O, Maute K (2013) Topology optimization approaches.
OA (2018) Piezoelectric sensor location by the observability Struct Multidiscip Optim 48(6):1031–1055
gramian maximization using topology optimization. Comput Appl Sigmund O, Torquato S (1999) Design of smart composite materials
Math 37(1):237–252 using topology optimization. Smart Mater Struct 8(3):365
Moretti M, Silva EC (2019) Topology optimization of piezoelectric bi- Sigmund O, Torquato S, Aksay IA (1998) On the design of 1–
material actuators with velocity feedback control. Front Mech Eng 3 piezocomposites using topology optimization. J Mater Res
14(2):190–200 13(4):1038–1048
A. Homayouni-Amlashi et al.
Silva EN, Fonseca JO, Kikuchi N (1997) Optimal design of Wein F, Kaltenbacher M, Baensch E, Leugering G, Schury F (2009)
piezoelectric microstructures. Comput Mech 19(5):397–410 Topology optimization of a piezoelectric-mechanical actuator with
Smith H, Norato JA (2020) A matlab code for topology optimization single-and multiple-frequency excitation. Int J Appl Electromagn
using the geometry projection method. Struct Multidiscip Optim Mech 30(3-4):201–221
1–16 Wein F, Kaltenbacher M, Stingl M (2013) Topology optimization of
Stolpe M, Svanberg K (2001) An alternative interpolation scheme for a cantilevered piezoelectric energy harvester using stress norm
minimum compliance topology optimization. Struct Multidiscip constraints. Struct Multidiscip Optim 48(1):173–185
Optim 22(2):116–124 Xia L, Xia Q, Huang X, Xie YM (2018) Bi-directional evolutionary
Suzuki K, Kikuchi N (1991) A homogenization method for shape and structural optimization on advanced structures and materials: a
topology optimization. Comput Methods Appl Mech Eng comprehensive review. Arch Comput Methods Eng 25(2):437–
Svanberg K (1987) The method of moving asymptotes—a new method 478
for structural optimization. Int J Numer Methods Eng 24(2):359– Xie YM, Steven GP (1993) A simple evolutionary procedure for
373 structural optimization. Comput Struct 49(5):885–896
Svanberg K (2007) Mma and gcmma-two methods for nonlinear Yaghmaei M, Ghoddosian A, Khatibi MM (2020) A filter-based level
optimization. 1: 1–15 set topology optimization method using a 62-line matlab code.
Townsend S, Grigg S, Picelli R, Featherston C, Kim HA (2019) Topol- Struct Multidiscipl Optim
ogy optimization of vibrational piezoelectric energy harvesters for Zhang W, Chen J, Zhu X, Zhou J, Xue D, Lei X, Guo X (2017) Explicit
structural health monitoring applications. J Intell Mater Syst Struct three dimensional topology optimization via moving morphable
30(18-19):2894–2907 void (mmv) approach. Comput Methods Appl Mech Eng 322:590–
van Dijk NP, Maute K, Langelaar M, Van Keulen F (2013) Level- 614
set methods for structural topology optimization: a review. Struct Zheng B, Chang CJ, Gea HC (2009) Topology optimization of
Multidiscip Optim 48(3):437–472 energy harvesting devices using piezoelectric materials. Struct
Wang F, Lazarov BS, Sigmund O (2011) On projection methods, Multidiscip Optim 38(1):17–23
convergence and robust formulations in topology optimization. Zhu B, Zhang X, Zhang H, Liang J, Zang H, Li H, Wang R (2020)
Struct Multidiscip Optim 43(6):767–784 Design of compliant mechanisms using continuum topology
Wang X, Lin Z, Ren Y (2017) Topology optimization of piezocompos- optimization: a review. Mech Mach Theory 143:103622
ite resonator for maximizing excitation strength and synthesizing
desired eigenmodes. Acta Mechanica Solida Sinica 30(5):531–539
Wei P, Li Z, Li X, Wang MY (2018) An 88-line matlab code for the Publisher’s note Springer Nature remains neutral with regard to
parameterized level set method based topology optimization using jurisdictional claims in published maps and institutional affiliations.
radial basis functions. Struct Multidiscip Optim 58(2):831–849