Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

University of Southampton

Faculty of Engineering and Physical Sciences

Electronics and Computer Science

Forward Modelling of Thermoelectric Generators


via Artificial Neural Networks

by

Chotiya Mahittigul

3rd May 2022

Supervisor: Dr. Ruomeng Huang

Second Examiner: Dr. Koushik Maharatna

An Individual Project Report submitted for the award of


MEng Electronic Engineering with Artificial Intelligence
Abstract

The constantly increasing global energy demand, and its supply by fossil fuels, have di-
rectly accelerated global warming. Moreover, most of the global primary energy gets wasted
as heat, giving motivation for the development of thermoelectric generators with better power
performance. Asymmetric thermoelectric generators have been found to exhibit greater power
performance as opposed to conventional symmetric thermoelectric generators, and to optimize
such structure, a powerful modeller is needed. Asymmetric thermoelectric generators are in-
vestigated and forward modelled in this project using an artificial neural network, a subset of
machine learning, for the first time. The artificial neural network in this project with 3 layers
and 663 neurons in the hidden layer achieved a high prediction accuracy of over 96%. Methods
such as Bayesian optimization for hyper-parameter tuning, early stopping, regularization, and
drop-out have been utilized for the first time for artificial neural network based thermoelec-
tric generators problems. The artificial neural network also proved its computational efficiency
by being 1,000,000 times faster than a simulation performed by finite element method. The
successful implementation of the artificial neural network to forward model asymmetric ther-
moelectric generators show future possibilities for machine learning to be applied to different
thermoelectric generators structures or even other renewable energy technologies.
Statement of originality
• I have read and understood the ECS Academic Integrity information and the University’s
Academic Integrity Guidance for Students.

• I am aware that failure to act in accordance with the Regulations Governing Academic
Integrity may lead to the imposition of penalties which, for the most serious cases, may
include termination of programme.

• I consent to the University copying and distributing any or all of my work in any form
and using third parties (who may be based outside the EU/EEA) to verify whether my
work contains plagiarised material, and for quality assurance purposes.

• I have acknowledged all sources, and identified any content taken from elsewhere.

• I have not used any resources produced by anyone else.

• I did all the work myself, or with my allocated group, and have not helped anyone else.

• The material in the report is genuine, and I have included all my data/code/designs.

• I have not submitted any part of this work for another assessment.

• My work did not involve human participants, their cells or data, or animals.

i
Acknowledgements

Firstly, I would like to extend my sincerest thanks to my supervisor, Dr. Huang, for all the
support and insightful meetings throughout the project. I am also extremely grateful to Yuxiao
for giving me some guidance throughout the project. Finally, I would like to thank my parents
for distracting me with good food while I was writing this report.
Contents

1 Introduction 1

2 Background and Literature Review 3


2.1 Thermoelectric Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 Seebeck Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Thermoelectric Generator (TEG) . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 TEG Device Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 Electrical Resistances in a TEG . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.3 Thermal Resistances in a TEG . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.4 Figure of Merit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.5 TEG Material Optimization . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.6 TEG Geometric Design Optimization . . . . . . . . . . . . . . . . . . . . 6
2.2.7 Asymmetric Thermoelectric Legs . . . . . . . . . . . . . . . . . . . . . . 8
2.2.8 Constant Hot side vs Input Heat Flux . . . . . . . . . . . . . . . . . . . 8
2.2.9 Maximum Power of TEG . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.10 Full TEG Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.11 TEG Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Modellers for TEGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.1 Analytical Modeller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.2 Finite Element Method (FEM) Modeller . . . . . . . . . . . . . . . . . . 11
2.3.3 Artificial Neural Network Modeller . . . . . . . . . . . . . . . . . . . . . 11
2.4 Artificial Neural Network (ANN) . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1 Type of ANN problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.2 Cost Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.3 Gradient Descent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.4 Structure of Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.5 Activation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.6 Hyper-parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.7 Forward propagation & Backpropagation . . . . . . . . . . . . . . . . . . 14
2.4.8 Data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.5 Improving ANN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.1 Bias vs Variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.2 Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.3 Feature Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.4 Regularization and Dropout . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.5 Early Stopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5.6 Hyper-parameter Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

i
3 Methods 17
3.1 COMSOL Multiphysics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.1 COMSOL: Setting up COMSOL . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.2 COMSOL: Parameter Lists . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.3 COMSOL: Geometry of TEG . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.4 COMSOL: Material of TEG . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.5 COMSOL: Heat Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.6 COMSOL: Contact Resistivity . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.7 COMSOL: TEG Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.8 COMSOL: Parameter Sweeping . . . . . . . . . . . . . . . . . . . . . . . 22
3.1.9 Resistance Calculation for Asymmetric TE Legs . . . . . . . . . . . . . . 22
3.1.10 Load Resistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.11 COMSOL: Exporting Data . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.12 COMSOL: Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2 Input Data Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.1 TEG Input Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.2 Python Random Data Generator . . . . . . . . . . . . . . . . . . . . . . 25
3.3 Processing COMSOL Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.1 MATLAB: Automatic Maximum point finder . . . . . . . . . . . . . . . 25
3.3.2 Preprocessing MATLAB Output Data . . . . . . . . . . . . . . . . . . . 25
3.4 Artificial Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.1 High-Level ANN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.2 Read & Preprocessing Data (High-Level State 1, 2) . . . . . . . . . . . . 27
3.4.3 Neural Network Model (High-Level State 3, 4) . . . . . . . . . . . . . . . 27
3.4.4 Training Neural Network (High-Level State, 5) . . . . . . . . . . . . . . . 28
3.4.5 Validation Neural Network (High-Level State 6) . . . . . . . . . . . . . . 29
3.4.6 Early Stopping (High-Level State 7) . . . . . . . . . . . . . . . . . . . . . 29
3.4.7 Testing Neural Network (High-Level State 8) . . . . . . . . . . . . . . . . 29
3.4.8 Optuna Hyper-parameter Tuning (High-Level State 9) . . . . . . . . . . 30
3.4.9 Saving Network & Deployment: Neural Network to predict PD (High-
Level State 10, 11) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4 Results and Discussions 32


4.1 COMSOL/MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2 Artificial Neural Network (ANN) . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3 TEG Geometric Design Parameter Sweep . . . . . . . . . . . . . . . . . . . . . . 39
4.3.1 Height of TE Legs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.3.2 Width of TE Legs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3.3 Ratio of TE Legs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.4 TEG Operating Condition Parameter Sweep . . . . . . . . . . . . . . . . . . . . 43
4.4.1 Thermal Contact Layer Thickness . . . . . . . . . . . . . . . . . . . . . . 43
4.4.2 Electrical Contact Resistivity . . . . . . . . . . . . . . . . . . . . . . . . 44
4.4.3 Input Heat Flux Density . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5 Conclusion 46
5.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2 Further Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.3 Project Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.4 Reflection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

A Project Brief 56

ii
B Additional Information 58
B.1 Semiconductors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
B.2 Thermocouples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
B.3 Conditions for good performing TEG . . . . . . . . . . . . . . . . . . . . . . . . 59
B.4 Efficiency of TEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
B.5 COMSOL: Power and Voltage vs Load Resistor . . . . . . . . . . . . . . . . . . 60
B.6 Appendix Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

C Project Archive Guide 62

iii
Nomenclature

TEG Thermoelectric Generator

TE Thermoelectric

FEM Finite Element Method

ML Machine Learning

ANN Artificial Neural Network

NN Neural Network

ZT Dimensionless Figure of Merit

P Dmax Maximum Power Density [W/m2 ]

Pmax Maximum Power [W]

S Seebeck Coefficient [V/K]

σ Electrical Conductivity [S/m]

κ Thermal Conductivity [W/(m · K)]

HT E Height of Thermoelectric Legs [mm]

WN Width of N Type TE Leg [mm]

WP Width of P Type TE Leg [mm]

γN Ratio of N Type TE Leg

γP Ratio of P Type TE Leg

ρC Electrical Contact Resistivity [Ω · m2 ]

dT Thermal Contact Layer Thickness [mm]

Qin /A Input Heat Flux Density [W/m2 ]

Rθ Thermal Resistance [K/W]

R Electrical Resistance [Ω]

RL Load Resistance [Ω]

iv
Chapter 1

Introduction

Year after year the global energy demand increases, and 83.1% of the global energy is supplied
by fossil fuels[1]. Excessive use of fossil fuels over the years has led to unnatural amounts of CO2
in the atmosphere, ultimately causing global warming[2]. Climate change, prompted by global
warming, is the major problem of the 21st century. It makes natural disasters such as droughts,
wildfires, water-shortages, flooding, etc more frequent. It even increases the spread of diseases
such as influenza, dengue fever, and malaria[3]. This global problem prompted the Paris Agree-
ment in 2015, signed by 195 countries, to tackle this impending catastrophe. The well-known
Article 2.1a in the Paris Agreement states, “Holding the increase in the global average temper-
ature to well below 2°C above pre-industrial levels and pursuing efforts to limit the temperature
increase to 1.5°C above pre-industrial levels, recognizing that this would significantly reduce
the risks and impacts of climate change”[4]. To achieve this aim, Jacobson et al. claimed that
stopping global warming from increasing 1.5◦ C would require 80% zero-emission energy by 2030
and 100% by 2050 and this should be mainly achieved through the use of renewable energy[3].

Renewable energy sources include the likes of solar, wind, geothermal, hydropower etc, and
a combination of all of them is needed to achieve the net-zero aim. Bhattacharya et al. claims
“effectively 72% of global primary energy gets wasted as heat”, therefore being able to recover
some of the wasted heat could save billions[5]. Zhu et al. states that recovering 1% of wasted
thermal energy from fossil fuels could annually provide over 200TWh of electricity, saving $20
billion, which makes this a lucrative market[6]. Hence, a renewable energy source that can
harvest wasted thermal energy would immensely benefit society.

A TEG is a renewable energy device that creates electrical energy from thermal energy,
specifically using the temperature differences of its 2 sides. It is made of P-type and N-type
semiconductor materials that are connected electrically in series and thermally in parallel. A
TEG device layout can be seen in Figure 2.2. Compared to other renewable energy sources,
TEGs have no mechanical moving parts, high reliability, and a long operating lifetime which
makes them a desirable device, however, it is limited by their low energy conversion efficiency[7].
To overcome this problem, Zhu et al. states that material and geometric design optimization of
a TEG is needed[6].

To optimize a TEG via geometric design, a good modeller is needed. Researchers have long
used analytical models, to estimate a TEG’s performance. Such models have fast computational
time but are limited by the accuracy. Thermoelectric effects are non-linear and have a lot
of inter-dependence on the geometric parameters. This makes it difficult for such analytical
model to consider all the conditions and effects, hence a lot of analytical models assume many

1
conditions to simplify the problem. Although these assumptions can make such models easier
to solve, the trade-off is the accuracy[6].

Another popular modeller is a finite element method (FEM) which uses a finite element
analysis (FEA) to solve TEG problems. Such methods are available in commercial software
such as COMSOL Multiphysics and ANSYS. These software are 3D modelling techniques that
can incorporate all the thermoelectric effects and other external/internal effects in the solution,
therefore producing a very high prediction accuracy for TEGs. Very high prediction accuracy
which takes into account all the conditions comes at a cost of high computational demand,
therefore the simulations in programs such as COMSOL and ANSYS can be slow in finding
the solution. The computational demand is a limiting factor for using FEM to solve TEG
problems[6].

Machine learning (ML) which is a subset of artificial intelligence (AI) has become very pop-
ular in recent years due to the advancements made in computer processing speeds[8]. Machine
learning is extremely versatile and can be used to model complex systems and learn how such
systems work. After learning the complex system, the ML algorithm is able to predict appro-
priate outputs on its own. Such ML algorithm can be classified as an Artificial Neural Network
(ANN). ANNs are extremely fast and accurate, which is a perfect combination of the analytical
models and FEM, however, it needs to be trained using some data, therefore a combination of
FEM and ANNs will be used to model TEGs in this project[6].

Report Structure
The remaining report structure is as follows:

• Chapter 2 covers the underlying theory behind TEGs and ANNs coupled with relevant
literature review. It also explains why certain choices were made in the building process
of the project.

• Chapter 3 is a walk-though of the steps taken to building the project.

• Chapter 4 presents the results in all stages of the project, along with critical analysis and
evaluation of the findings.

• Chapter 5 summarizes the project, discusses possible future extensions to the project,
demonstrates the project management steps taken to ensure the success of the project,
and ends with a reflection of the project.

2
Chapter 2

Background and Literature Review

2.1 Thermoelectric Effect


2.1.1 Seebeck Effect
When heat is applied to one side of a semiconductor and the other side remains at a constant
lower temperature, a temperature gradient is created across the semiconductor. This creates
a thermal non-equilibrium of electrons and holes. The charge carriers (majority carriers) will
gain more net thermal energy, which converts into kinetic energy, than the minority carriers
and diffuse away from the hot end of the semiconductor[9]. The diffusion results in a build-up
of charge carriers in the colder side and the minority carriers in the hot side thus creating a
potential difference across the semiconductor which is known as the Seebeck voltage[10][11].
For N-type semiconductors, electrons are the majority carriers therefore the electrons diffuse
from the hot side to the cold side, for P-type semiconductors, holes are the majority carriers
therefore the holes diffuse from the hot side to the cold side[10]. This Seebeck effect can be
seen in Figure 2.1. In Figure 2.1a the electrons diffuse to the cold side, resulting in a build-up
of electrons in the cold side and a build-up of holes in the hot side, represented by the “-” and
“+” respectively. In Figure 2.1b the holes diffuse to the cold side, and there is a build-up of
holes in the cold side and a build-up of electrons in the hot side represented by the “+” and “-”
respectively.

(a) N-Type semiconductor (b) P-Type semiconductor

Figure 2.1: Seebeck effect on N-type and P-type semiconductors

3
The Seebeck voltage is given by Equation 2.1, where “S” is the Seebeck coefficient (some-
times written as α in other text, but “S” will be used throughout this report) and ∆T is the
temperature gradient from the hot side to the cold side. The Seebeck coefficient is essentially
the coefficient that relates the voltage difference and temperature difference of the 2 sides.

∆V = S · ∆T (2.1)

2.2 Thermoelectric Generator (TEG)


2.2.1 TEG Device Layout
A layout of a single thermoelectric generator (TEG) unit can be seen in Figure 2.2. The
TEG structure consists of an N-type and P-type thermoelectric leg (TE leg) which are the
semiconductors in the middle. The TE legs are covered by an electrode layer on either side of
the semiconductor and finally 2 insulators in the outermost layer[12]. Heat is applied to one of
the insulators (usually as an input heat flux) which will be referred to as the “hot-side”, and
the other insulator is kept at a lower temperature which will be referred to as the “cold-side” as
seen in Figure 2.2. There is only 1 electrode at the hot-side of the TE legs, and it connects the
2 legs, meanwhile at the cold-side there are 2 electrodes and they are separated by a gap of free
space. This essentially a creates circuit where electrons flow from the P-type semiconductor into
the N-type semiconductor, and this generates creates electricity. Finally, the TEG is connected
to a load resistor to measure the power generated by the device as seen in Figure 2.2.

Figure 2.2: TEG Device Layout

The Seebeck coefficient for a TEG is given by Equation 2.2, where SN is the Seebeck coefficient
of the N-type TE leg and SP is the Seebeck coefficient of the P-type TE leg[12]. However, for

4
simplicity, for the rest of the report the Seebeck coefficient, ST EG , of the TEG will be referred
to simply as “S”.

|SN | + |SP |
ST EG = =S (2.2)
2

2.2.2 Electrical Resistances in a TEG


The electrical resistance of a TE leg is given by Equation 2.3, where ρ is the electrical resistivity
of the material, L is the length of the TE leg, and A is the cross-sectional area of the TE leg. The
length is also effectively the height of the TE legs. It can also be rewritten using the electrical
conductivity, σ, as the electrical conductivity is just the reciprocal of the electrical resistivity.
Besides the electrical resistance of a TE leg, there may also be some resistances in the electrodes,
and some electrical contact resistance where the electrodes and TE legs meet[13][14].
ρ·L L
R= = (2.3)
A σ·A

2.2.3 Thermal Resistances in a TEG


The thermal resistance of a TE leg is given by Equation 2.4, where Rθ is the thermal resistance,
L is the length of the TE leg, κ is the thermal conductivity, and A is the cross-sectional area of
the TE leg. As can be seen in Equation 2.3, the formula for thermal resistance is fundamentally
the same as the electrical resistance except the conductivity is the thermal conductivity instead
of the electrical conductivity. There may also be some thermal resistance from the insulator,
electrodes, and thermal contact resistance[13][14].
L
Rθ = (2.4)
κ·A

2.2.4 Figure of Merit


The value of Z in Equation 2.5 is the figure of merit that can determine the quality factor
of a material. As the figure of merit is dependent on temperature, ZT is also used as the
dimensionless figure of merit. The ZT value can be seen in Equation 2.6, where S is the
Seebeck coefficient, σ is the electrical conductivity, κ is the thermal conductivity, and T is the
temperature. A greater “σ” causes electrical resistance to be lower (Equation 2.3) which allows
electrons & holes to flow more freely through the TEG increasing power, and it also suppresses
Joule heat loss[15]. A lower “κ” increases thermal resistance (Equation 2.4) allowing the TE
legs to maintain a greater temperature gradient (∆T ) between the hot-side and cold-side of a
TEG. A greater ∆T and “S” enhances the Seebeck voltage as seen in Equation 2.1.[12][15]

S2 · σ
Z= (2.5)
κ
S2 · σ
ZT = ·T (2.6)
κ

2.2.5 TEG Material Optimization


In the last decade, research for better TE material has been rapidly progressing[15][16]. The
material used for the TE legs hugely impacts the overall performance of a TEG. Materials en-
gineering methods such as band structure engineering, carrier concentration optimization, pro-
motion of carrier mobility, and nanostructuring have shown improvements in ZT values[15][17].

5
Figure 2.3 shows that different semiconductor materials have unique ZT vs Temperature curves
as all TE materials have different “S”, “κ”, and “σ” values[18]. The alloying of materials
have shown that “S”, “κ”, and “σ” values can be improved to enhance the original ZT value,
and optimize the overall performance of the TEG[18][19]. Despite the recent bismuth tel-
luride/skutterudite segmented modules showing a high efficiency of 12%, TEGs are still not
competitive compared to other energy sources[20]. This is mainly because a TEG’s output
power is not only reliant on the TE material, but also on its geometric design[6].

Figure 2.3: Figure of Merit, ZT, vs Temperature of Thermoelectric materials. (a): N-type materials,
(b): P-type materials (Reproduced from Snyder [18])

2.2.6 TEG Geometric Design Optimization


Studies have shown that the geometric design of TEGs affects their performance considerably
[21]. Zhu et al. optimized the TE leg height, width of both TE legs, electrode height, and
electrical contact resistance[6]. Liu et al. investigated two-stage TEGs (2 TEGs stacked on top
of each other) using skutterudite and bismuth-telluride[21]. Segmented TEGs have also proved
to perform better than regular TEGs[22]. Studies have also shown that thermal stress differs for
varying TE leg geometry such as cylindrical, octagonal, and trapezoidal legs[23]. Trapezoidal
legs displayed a non-linear temperature profile, reducing thermal stress throughout the leg,
because of its asymmetric nature. Conventional TEGs use symmetric legs, meaning the sides of
the TE legs remain constant throughout the device, however, the TE legs can also be asymmetric
as seen in Figure 2.4. Karana et al. found that combining segmented and asymmetric TE
legs can further enhance a TEG’s performance[24]. Figure 2.4f shows the temperature vs the
distance from the hot side of the TEG, and it shows that the temperature gradient of asymmetric
TEGs is unique for different structures[25]. The I-leg and X-leg showed similar behaviors, and
the Y-leg showed an extreme curvilinear profile at around 3mm as reported by Jouhara et
al.[26]. Ibeagwu et al. observed that the trapezoidal leg has the lowest thermal conductance
per volume compared to other structures, helping it maintain a larger temperature gradient,
and other researchers have preferred the trapezoidal leg due to its ease of fabrication[25][23].
Consequently, trapezoidal TEGs will be investigated in this project.

6
Figure 2.4: Temperature distribution of the models: (a) Rectangular leg, (b) Trapezoidal leg, (c)
Y-leg, (d) X-leg, (e) I-leg, (f ) Centerline temperature plot (Reproduced from O Ibeagwu [25])

7
2.2.7 Asymmetric Thermoelectric Legs
Figure 2.5 shows the cross-section of a rectangular TEG and a trapezoidal TEG from the side
with contour lines. The contour lines represent the temperature difference from the hot side to
the respective temperature at every location[25]. As seen in Figure 2.4f and 2.5, the temperature
change is constant throughout the leg for symmetric TEGs, and this is because the electrical
and thermal resistance is more or less constant due to the same area. On the other hand,
the trapezoidal TEG’s cross-sectional area is always changing, resulting in an ever-changing
electrical and thermal resistance[25]. The trapezoidal leg has smaller thermal stress resulting in
greater thermal resistance helping it produce more power than the rectangular TEG[25][23].

Figure 2.5: Cross section of TEG with contours for temperature change: (a) Rectangular TEG, (b)
Trapezoidal TEG (Reproduced from O Ibeagwu [25])

2.2.8 Constant Hot side vs Input Heat Flux


The hot-side of a TEG can either be a fixed temperature or an input heat flux. A fixed
temperature means the hot-side temperature will always be the same, whereas a constant input
heat flux means the TEG will have the same amount of thermal energy at the hot-side. Zhu et
al. investigated varying geometric parameters of TEGs in both operating conditions, and the
results showed that the type of heat source affects the geometric design optimization of a TEG[6].
Sisik et al. found that trapezoidal legs where the larger cross-sectional area is at the cold-side
performs better for constant hot-side temperature operation due to a larger thermal resistance
at the hot-side which enables greater heat transfer[27]. Conversely, the reverse trapezoid legs
(mentioned as just “trapezoid” in earlier sections), with its smallest and largest cross-sectional
areas facing the cold-side and hot-side respectively, output 50% more power than symmetric
TEGs for constant input heat flux conditions due to a larger temperature gradient across the
leg[27]. A constant hot side temperature is generally unrealistic in real life because the hot-side
of the TEG would not always remain at the same temperature[27], hence a constant input heat
flux will be used as the operating condition along with the “reverse” trapezoidal legs in this
project.

8
2.2.9 Maximum Power of TEG
The equation for calculating power is given by Equation 2.7:

P = ∆V · I (2.7)

where ∆V is the change in voltage across the load resistor, and I is the current. ∆V can be
given by Equation 2.8:
∆V = I · RL (2.8)

Combining Equation 2.8 with Equation 2.7 gives a new value for power given by Equation 2.9:

P = I 2 · RL (2.9)

The total resistance, R, of the TEG device and the load resistance is given by RT EG + RL , so
substituting the new value for R gives Equation 2.10:
V V
I= = (2.10)
R (RT EG + RL )
Plugging in “I” from Equation 2.10 to Equation 2.9 gives Equation 2.11:

V2
P = · RL (2.11)
(RT EG + RL )2
RL is the variable, so a partial derivative can be taken with respect to RL and set to 0 to
find the RL which gives the maximum power value:
∂P
=0 (2.12)
∂RL

Taking the quotient rule of Equation 2.11 gives Equation 2.13:

∂P (RT EG + RL )2 · V 2 − 2 · RL · (RT EG + RL ) · V 2
= =0 (2.13)
∂RL (RT EG + RL )4

Simplifying Equation 2.13 can be seen from Equation 2.14 to Equation 2.16:

(RT EG + RL )2 · V 2 = 2 · RL · (RT EG + RL ) · V 2 (2.14)

2 · RL = RT EG + RL (2.15)
RL = RT EG (2.16)
It can be concluded that a TEG outputs its maximum power when RL equals RT EG where
RT EG is given by Equation 2.18. After substituting RL = RT EG in Equation 2.11, the maximum
power of a TEG is given by Equation 2.17.

V2
Pmax = (2.17)
4 · RT EG

9
2.2.10 Full TEG Module
In a real-life application, 1 TEG unit produces very little power, so multiple TEG units can
be connected in series to create a full TEG module that can produce more power. A full TEG
module can be seen in Figure 2.6a. The thermocouples (TC) are connected in series from the
bottom electrodes, and the outermost bottom electrodes are connected to a load resistor, this
creates a full circuit. The equivalent electrical circuit of Figure 2.6a can be seen in Figure 2.6b.
The smaller red box in Figure 2.6b shows the circuit for 1 TC with a voltage source and an
internal resistance. The internal resistance, given in Equation 2.18, is the resistance of the TEG
and it consists of the resistances of the electrodes, the N-type TE leg, and the P-type TE leg[12].

RT EG = RT opElectrode + 2 · RBottomElectrode + RP −type + RN −type (2.18)


The output voltage of 1 TC is given by Equation 2.1, however the output voltage of the
entire device is given by Equation 2.19, where “N” is the number of connected TC.

Vout = N · S · ∆T (2.19)

Figure 2.6: Typical thermoelectric generator: (a) Basic principle, (b) Equivalent electrical circuit.
(Reproduced from N.Jaziri [12])

2.2.11 TEG Applications


The main application for TEGs is for waste heat recovery. Combustion car engines are known
to waste a lot of thermal energy. This thermal energy can be used to heat the hot side of a
TEG and recover some otherwise lost energy[28]. TEGs are perfect for usage in a car because
there are no moving parts in a TEG, therefore it is unlikely for a TEG to break down by
the movement of a car[26]. Industrial buildings with a lot of machines, or power plants also
lose a lot of thermal energy, which could be converted to electrical energy through TEGs[29].
TEGs could even be used in every household as the outsides of a hot water pipe would have
sufficient thermal energy to power a TEG which can then recycle the lost thermal energy[30].
Furthermore, TEGs could be used in wireless sensor networks as such systems usually require
very little power[31]. Finally, one of the main uses for TEGs is in space. The Voyager’s probe
uses Radioisotope Thermoelectric Generators (RTG) to power the spacecraft. It converts the
heat from the decay of radioactive material into electrical energy through TEGs, such systems
would have a very long lifetime as there are no moving parts and the radioactive decay process
can be very long[32].

10
2.3 Modellers for TEGs
This section covers the existing modellers used for TEGs.

2.3.1 Analytical Modeller


Min et al. proposed an early theoretical model to investigate the thermoelement length
on the module’s coefficient of performance, and neglected contact resistances[33]. Newbrook
et al. built a simplified mathematical model to optimize a thin-film TEG[34]. Qing et al.
developed an analytical model which was solved by MATLAB to optimize TEGs, and a few
assumptions that “obviously degraded the accuracy” were made[35]. Liang et al. built an
analytical model of parallel TEGs, and assumed “S”, “σ”, “κ” to be constant throughout
the device[36]. Although analytical models provide quick approximations, they are limited by
their oversimplified assumptions and inability to account for all TE effects, hence affecting the
accuracy of the model[6][35].

2.3.2 Finite Element Method (FEM) Modeller


3D modelling software such as COMSOL and ANSYS offer high simulation accuracy[37]. For
example, Seetawan et al. compared the results of a TEG from ANSYS and from laboratory
experiments and found that they were in “good agreement”[38]. Wu et al. showed that FEM
has the advantage of high accuracy, as they can easily solve equations governing temperature-
dependent properties of TE materials, and user-friendly interface[39]. However, such high pre-
diction accuracy comes at the cost of simulation time. Optimization techniques used for TEGs
such as genetic algorithm requires tens of thousands of FEM simulations which can become com-
putationally expensive and limits the potential for large-scale adoption of TEGs[6]. Therefore,
a modeller which is fast and retains a high accuracy is desirable.

2.3.3 Artificial Neural Network Modeller


ANNs are very fast and highly accurate, provided that it is trained with enough data. Only 2
research groups have used an ANN as a modeller, Kishore et al. and Zhu et al. Kishore et al.’s
ANN modeller had 3 geometric input parameters: leg height (1-2mm), both leg cross-sectional
area (1x1mm2 - 2x2mm2 ), external resistance (2-10Ω), and the operating conditions were fixed
at constant temperatures of 513K and 295K for the hot-side and cold-side respectively[40]. This
is a very limited design because of the small range and number of different input parameters.
Zhu et al.’s ANN modeller had more input parameters such as: leg height (0.5-5mm), inter-
connect height (0.5-3mm), N and P type leg width (0.5-5mm), and operating conditions such
as: electrical contact resistivity (10−9 - 10−7 Ωmm2 ), input heat flux density (1000-5000W/m2 ),
constant hot-side temperature (300-500K)[6]. Both researchers found that the ANN can speed
up simulation times while maintaining high accuracy. Zhu et al. reported a computational
efficiency improvement of 1000x when using an ANN compared to COMSOL, and the network
boasted a 98% accuracy[6]. Both researchers simulated symmetric TE leg TEGs, however, asym-
metric TEGs are modelled in this project. More ANN input parameters with bigger ranges are
investigated in this project (see Table 3.2), moreover, the asymmetric legs and thermal contacts
have never been researched using an ANN modeller before.

11
2.4 Artificial Neural Network (ANN)
This section will cover the necessary theory to building an Artificial Neural Network (ANN).

2.4.1 Type of ANN problem


Every supervised ANN problem can be put into 2 different categories: classification and
regression. Classification problems require the ANN to output a prediction of a discrete class
label for a given example, and regression problems require the ANN to output a prediction of
a continuous value for a given example. The aim of using a modeller for a TEG problem is
to predict the power performance (output power) of different TEG geometric designs, and the
output power of the TEG is a continuous value making this a regression problem[41].

2.4.2 Cost Function


For regression problems, the neural network needs a way to measure the degree of error of the
predicted output from the true output, and this error is known as a loss function. Regression
problems have multiple data points, hence multiple errors. To evaluate the error of the entire
function, a cost function is needed. The cost function and loss function are similar, and some-
times used interchangeably, but technically the cost function is the mean of the loss function
values over the entire set of data.

Two commonly used cost functions are the mean squared error and the mean absolute error
given by Equation 2.20 and 2.21 respectively. The MSE finds the difference of true outputs, ti ,
and its corresponding predicted outputs, yi , to get the error at the ith data point. The errors
are squared to remove negative errors, then the “m” number of errors are averaged in order
to find the “mean squared error”. The MAE is similar to the MSE, but uses absolute values
instead of squaring (ti − yi ). The squaring effect of the MSE penalizes larger errors more, and
this can help minimize the bigger errors when using gradient descent, which will be explained
in the next subsection[42][43].
m
1 X
M SE = (ti − yi )2 (2.20)
m i=1
m
1 X
M AE = |ti − yi | (2.21)
m i=1

Due to the reasons mentioned earlier, the MSE will be used as the cost function, J(w), for
the rest of the report. The cost function is given by Equation 2.22. The cost function needs to
be minimized by tuning the weights, w, to lower the error made by the ANN.
m
1 X
J(w) = (ti − yi )2 (2.22)
m i=1

2.4.3 Gradient Descent


The gradient descent formula is a weight updating formula given by Equation 2.23.
∂J
w := w − α (2.23)
∂w

12
θ in Figure 2.7 refers to the weights, w. When the learning rate is too small gradient descent
takes a long time and is computationally expensive to reach the minimum point. Increasing
the learning rate would speed up the computational time to reach the minima faster as seen in
Figure 2.7b. However, when the learning rate is too large, gradient descent can miss the minima
and diverge as seen in Figure 2.7c. Therefore, it is important to find a learning rate that is
“just right” to reach the minima[44].

(a) Learning rate too small (b) Learning rate “just right” (c) Learning rate too large

Figure 2.7: Gradient descent with different learning rate values [44]

2.4.4 Structure of Neural Network


An example structure of an ANN can be seen in Figure 2.8. There are 3 different types of
layers, an input layer, a hidden layer, and an output layer. A NN can only have 1 input and
output layer, but can have multiple hidden layers. NN with multiple hidden layers are known
as deep networks. Each of these layers have nodes, called neurons, which are represented by
circles in Figure 2.8[45]. These neurons can communicate and transmit data between themselves
through forward propagation and backpropagation.

Figure 2.8: A Neural Network with “n” number of input neurons, hidden layers, and output neurons
[46]

13
2.4.5 Activation Functions
The Rectified Linear Units (ReLU) and Linear activation functions are the most commonly used
activation functions for regression NN problems. They are used for regression tasks because of
their lack of bounded features (except for ReLU being bounded when it is less than 0)[47].

2.4.6 Hyper-parameters
Hyper-parameters are variables that determine how an ANN is trained and the structure of
an ANN. The “learning rate”, “batch size”, and “number of epoch” determine how the ANN is
trained (Learning rate explained in Subsection 2.4.3). The “batch size” refers to the number of
training examples that are passed through from each layer during forward pass and backward
pass, when the batch size equals 1 it is referred to as “Stochastic Gradient Descent”. The
“number of epochs” is the number of times the NN model loops through an entire training data
set. The “number of hidden layers” and “number of neurons” determine the structure of the
ANN, it tells the ANN the number of hidden layers and neurons to use in the model. The
hyper-parameters heavily affect the quality of a NN, so it must be optimized (see Subsection
2.5.6 for hyper-parameter optimization)[8].

2.4.7 Forward propagation & Backpropagation


Forward propagation (Feedforward NN) is a process to get from the input layer to the output
layer. Each input is sent to the nodes in the next layer, multiplied with the corresponding
weights, and used in an activation function defined in the layer. This process is repeated until
the output layer[48].

Backpropgation is a process to update the weights in a NN to reduce the error. It essentially


starts from the output layer and works it way back to the input layer, while trying to reduce
the loss value. It is an important part of training a NN as the weights heavily affect the cost
function, which would then affect the quality of the ANN[49].

2.4.8 Data sets


An ANN needs to be trained with labeled data, called the “dataset”. The dataset needs to be
split into 3 smaller datasets: training, validation, and testing dataset[50]. The training dataset
is used solely for training the NN model and updating the weights and biases[50]. The validation
dataset is used to evaluate the NN model while the NN is still learning from the training dataset.
Although the neural network does see the validation dataset, it never learns from it i.e. update
the weights and biases[50]. The test dataset is also used to evaluate the performance of a NN
model, but it is only used once after a model has completed its training. The test dataset is
also referred to as the gold standard to evaluate the model as it gives an unbiased evaluation of
the model. The 3 datasets are commonly split into 60:20:20 or 80:10:10 for training, validation,
and testing respectively[50]. Zhu et al. modelled a TEG using 5000 COMSOL simulations with
a 80:10:10 split, and achieved a high accuracy, therefore 5000 COMSOL simulations with a
80:10:10 split will also be used in this project[6].

14
2.5 Improving ANN
2.5.1 Bias vs Variance
When data is “overfitting” (high variance), the ANN has a lower loss for training data, but
higher loss for validation data, and the ANN generalizes poorly for unseen data. When data is
“underfitting” (high bias), the ANN has a high loss for both the training and validation data.
Good ANNs have both low bias and low variance as seen in Figure 2.9[51]. Using more training
examples, or reducing NN complexity (layers and number of neurons) can fix high variance
problems, and increasing NN complexity can fix high bias problems.

Figure 2.9: Bias vs Variance in Overfitting and Underfitting data [51]

2.5.2 Optimizer
Adaptive Moment Estimation (ADAM) is a widely used optimizer for ANNs. ADAM updates
the learning rate at each node individually which helps the ANN reach the global minimum in
loss. ADAM will be used as the optimizer in this project[52].

2.5.3 Feature Scaling


At times the inputs to an ANN are not on the same scale, for example, an input heat flux
density on the scale of 103 W/m2 and a TEG height on the scale of 10mm. Feature scaling is a
technique used to re-scale the inputs into a similar range, and there are 2 different types of feature
scaling: normalization and standardization. The formula for normalization and standardization
is given by Equation 2.24 and 2.25 respectively. Normalization works bests for a uniform
distribution as it scales the entire data set between 0 and 1, and standardization works best for
a Gaussian distribution as it uses mean and standard deviation[53].
X − Xmin
Xnorm = (2.24)
Xmax − Xmin
X −µ
Xstd = (2.25)
σ

2.5.4 Regularization and Dropout


Regularization and Dropout can address overfitting. Regularization adds a “regularization
parameter” term at the end of the cost function and forces the weights to be smaller so that
the NN does not overfit. Dropout introduces noise during training by removing random nodes
in the ANN, and “thins” out the network[54]. This will be the first time both these methods
will be explored in ANN based TEG problems.

15
2.5.5 Early Stopping
It can be difficult to know the best number of epochs to train a NN. Zhu et al. used 2000
epochs, but a higher epoch does not necessarily translate to better networks, and can lead to
unnecessary computational time[6]. Early stopping is an automatic way of choosing the number
of epochs to train the network. It monitors the validation loss as the model is training and
records the lowest validation loss and the corresponding model. If the NN model’s validation
loss has not improved, i.e. become smaller, after a certain number of epochs, the model will
automatically stop training and use the NN model with the lowest recorded validation loss[55].
This will be the first time “Early Stopping” will be used to solve ANN based TEG problems.

2.5.6 Hyper-parameter Tuning


3 methods to tune the hyper-parameters of a NN are shown in Figure 2.10. Random search
generates random sets of hyper-parameters within the constraints and hopes to reach the min-
ima. The grid search generates sets of hyper-parameters with a step value to cover a certain
range equally. Bayesian optimization dynamically updates the next hyper-parameters based on
a higher probability of combinations to result in a lower loss value. Random search and grid
search are exhaustive methods and do not guarantee the optimal solution, however, Bayesian
optimization always tries to improve the NN[56]. Both Kisore and Zhu et al. have used grid
search, which is akin to a brute force method, to tune the hyper-parameters of the ANN[40][6].
Bayesian optimization, provided by the Python library: Optuna, will be utilized in this project
to ensure a thorough search while saving computational resources.

(a) Random Search (b) Grid Search (c) Bayesian Optimization

Figure 2.10: Hyper-parameter tuning using: (a) Random search, (b) Grid search, (c) Bayesian
optimization [57]

16
Chapter 3

Methods

3.1 COMSOL Multiphysics


This section covers the method of building an asymmetric TEG modeller in COMSOL.

3.1.1 COMSOL: Setting up COMSOL


When opening COMSOL for the first time, there will be an option for “Model Wizard” or
“Blank Wizard”. Model Wizard needs to be selected to easily set up an environment for a
TEG. After selecting Model Wizard, the 3D space needs to be selected. After selecting the
space dimension of the project, the “Physics” needs to be selected. The TE effect physics is
located in the “Heat Transfer” tab, and it needs to be added for the TEG. The final part of
setting up the environment is the Study. The “Stationary” study under the “General Studies”
tab needs to be selected as the TEG is modeller in this project is not time-dependent. At the
end, click done and COMSOL will automatically create an environment to model a TEG. The
rest of Section 3.1 will roughly follow the order of the “Model Builder” in Figure 3.1.

Figure 3.1: COMSOL Model Builder

17
3.1.2 COMSOL: Parameter Lists
Parameter Lists in COMSOL create variables that can be used throughout COMSOL. The
parameter list can be found under the “Global definitions”. Using parameter variables instead of
hard coding the parameter values is good practice as it enables the user to change values easier,
and will be important in the parameter sweeping section. Figure 3.2a and Figure 3.2b show
the fixed parameters and variable parameters used for this project respectively. These variables
will be explained in appropriate sections later in the report. The parameter list consists of 3
columns: name, expression, and value. The “Name” is the global variable, the “Expression”
is the value that the user can give the “Name” and other parameter names can be reused in
the “Expression”. The units in the “Expression” must be enclosed in square brackets, and the
“Value” column automatically represents the SI unit value of the “Expression” term.

(a) Fixed Parameter List


(b) Variable Parameter List

Figure 3.2: COMSOL Global Parameter List

3.1.3 COMSOL: Geometry of TEG


Figure 3.3 shows the menu bar for building a TEG. The “Block” was used for the insulating
layers, the “Pyramid” in “More Primitives” was used as the TE legs, “Work Plane” was used
to build layers for the TEG, and “Extrude” was used to build the electrode layers.

Figure 3.3: Menu bar for geometry of TEG

Figure 3.4a shows all the components used to build the TEG from the bottom-up in chrono-
logical order. A work plane is needed between every different layer such as the insulator &
copper, and the copper & TE legs. Figure 3.4b shows an example of building the bottom insu-
lator layer, the size and shape all use variables from the parameter list so that it can be easily
changed if needed. Figure 3.4c shows an example of building the asymmetric TE leg, again the
size and shape uses the variables from the parameter list. The “x” and “y” positions do not

18
move so it can be hard-coded, but the “z” of the TE leg changes, so it uses variables. A reverse
pyramid shape is used in this project, so the shape needs to be rotated by 180◦ .

(a) Geometry list used for TEG

(b) Example of Insulator Layer (c) Example of TE Legs

Figure 3.4: Building TEG Geometry in COMSOL

An example full TEG geometry can be seen in Figure 3.5. The insulating layer is kept at
20mm x 10mm x 5mm, the top electrode is 19.7mm x 9.7mm x 0.1mm, the bottom electrodes
are both 9.8mm x 9.7mm x 0.1mm.

Figure 3.5: TEG geometry from side view. Height of TE legs = 10mm, N-type TE leg width = 8mm,
N-type TE leg ratio = 0.2, P-type TE leg width = 4mm, P-type TE leg ratio = 0.5

19
3.1.4 COMSOL: Material of TEG
Ceramic is used as the insulator and copper is used as the electrode for the TEG because they
are abundant materials. The P-type TE leg is made out of Germanium Bismuth Antimony Tel-
luride (Ge0.85 Bi0.05 Sb0.10 T e) because the ZT was a good value[19]. Magnesium Tin Germanium
(M g2 Sn0.75 Ge0.25 ) was chosen for the N-type TE leg as the ZT value and temperature range
was similar to the P-type material[58]. The materials are seen in Figure 3.6.

(a) Germanium Bismuth Antimony Telluride (b) Magnesium Tin Germanium (M g2 Sn0.75 Ge0.25 )
(Ge0.85 Bi0.05 Sb0.10 T e)

Figure 3.6: ZT vs Temperature graph: (a) P-Type TE leg [19], (b) N-Type TE leg [58]

The software “DataThief” was used to extract data for the ZT vs Temperature, Seebeck
Coefficient vs Temperature, Electrical Conductivity vs Temperature, and Thermal Conductivity
vs Temperature graphs for both the P and N-type material. An example of DataThief is seen
in Figure 3.7. Axes values need to be labelled correctly to extract data on the correct scale.
The points for the curve of interest needs to be manually marked by the labelling tool.

Figure 3.7: DataThief for thermal conductivity of P-Type TE leg. Red boxes show the axis configu-
rations

20
3.1.5 COMSOL: Heat Transfer
The cold-side (bottom) is set at 300K and a heat flux is applied to the hot-side (top), this is
done by simply clicking on the surface. A few different input heat flux densities (Qin /A) were
tested and 6000 W/m2 on the hot-side gave around 700K, so that was chosen as the maximum
Qin /A. The TEG also needs to be thermally insulated, therefore all the sides except the top
and bottom insulator surfaces need to be selected as seen in Figure 3.8.

Figure 3.8: Heat Insulation of TEG

3.1.6 COMSOL: Contact Resistivity


Both the electrical contact resistivity (ρC ) and thermal contact layer thickness (dT ) were used
as the contact resistances to create a more realistic model[33]. They must be set at the junction
between the electrodes and TE legs as shown by the highlights in Figure 3.9.

Figure 3.9: Contact Resistance selection for TEG

3.1.7 COMSOL: TEG Circuit


The ground is set to be the bottom copper layer of the N-type TE leg, and the terminal is set
to be the bottom copper layer of the P-type TE leg. To extract the output power of the TEG,
an external load resistor is connected accordingly.

21
3.1.8 COMSOL: Parameter Sweeping
COMSOL can make individual simulations, or multiple simulations automatically which is
known as parameter sweeping. Parameter sweeping allows users to plug in specific values or a
range of values with a step value. The range feature is useful when there is a range of values
to sweep over as it can save time. This project, however, uses the specific values as the TEG
inputs are generated randomly, and the values are separated by a space. Having multiple sweeps
is also possible, in this project 2 parameter sweeps will be used. The first sweep should contain
all the random TEG input parameters, and the second sweep should be the load resistor(RL ).

3.1.9 Resistance Calculation for Asymmetric TE Legs


The second parameter sweep is for RL , however, Equation 2.3 does not apply to shapes with
varying cross-sectional areas such as the asymmetric TE legs. Therefore, a new generalized
resistance formula needs to be derived. Figure 3.10 shows a 2D version of the TE legs.

Figure 3.10: Asymmetric TEG side view

This ratio in Equation 3.1 can be made for the trapezoid.


r−a b−a
= (3.1)
x L

Rearranging for “r” gives:


b−a
r =a+( )x (3.2)
L

The change in resistance, R, can be seen as the change in the length“x” over the electrical
conductivity and cross sectional area as seen in Equation 3.3:
dx dx
dR = 2
= (3.3)
σ · (2r) σ · 4r2

To find the resistance, an integral from 0 to the full length, L, can be taken as seen in Equation
3.4: Z
1 Z L dx
R = dR = (3.4)
4σ 0 r2

22
“r” from Equation 3.2 can be plugged into Equation 3.4 to give Equation 3.5:
1 ZL dx
R= (3.5)
4σ 0 [a + ( b−a
L
)x]2

Solving for the integral gives Equation 3.6:


" #L
1 1 L
R= − b−a ·( ) (3.6)
4σ (a + ( L )x) b − a 0

Finally the resistance for an asymmetric TE leg can be simplified to Equation 3.7 where “a”
and “b” are half the width of the bottom and top of the TE leg respectively:
L
R= (3.7)
4·σ·a·b

3.1.10 Load Resistance


After setting RL = RT EG to ensure maximum power output of TEG as proven in Subsection
2.2.9, the resistance values for the 2nd parameter sweep need to be chosen. The RT EG value
is always changing when the geometric structure of the TEG is changing, so the RL which
gives Pmax is also constantly changing. It is impractical to calculate a new RL every time, so
5 different orders of magnitude for RL were parameter swept to ensure RT EG was within the
range. The 5 resistances values used are: RL /100, RL /10, RL , 10RL , 100RL . To increase the
accuracy of finding Pmax , more resistance values can be used, so 9 resistance values were tested
and their values are: RL /100, RL /70, RL /30, RL /10, RL , 10RL , 30RL , 70RL , 100RL .

Table 3.1 shows the results of using 5 resistance values and 9 resistance values. As seen, the
Pmax is very similar, but the 9 resistance values takes 25 minutes to simulate, whereas the 5
resistance value only takes 15 minutes to simulate. If this duration stays constant throughout
the entire simulation, the 5 resistance value simulation would take 5 days and 5 hours, whereas
the 9 resistance value simulation would take 8 days and 16 hours to simulate. To save time and
computational resources, the 5 resistance values were chosen for the parameter sweep.

Table 3.1: Time taken for 10 simulations using 5 resistance values and 9 resistance values

Simulation Maximum Power Maximum Power


(5 Resistance Values) (9 Resistance Values)
1 0.001298077022920 0.001349931415238
2 0.001230520778169 0.001227032804117
3 0.009092275367816 0.009091374276820
4 0.000808076150063 0.000808023748573
5 0.000041063628906 0.000041063887239
6 0.004947213808098 0.004946626364207
7 0.005215356149659 0.005216951140239
8 0.003026143941898 0.003026722759489
9 0.000050938385827 0.000050943871220
10 0.002607622656252 0.002607535340259
Total Duration of Simulation 15 mins 25 mins

23
3.1.11 COMSOL: Exporting Data
The results of the simulations can be exported into a text file and saved for future reference
or data processing. There is an option to save data on the COMSOL file and export once
everything is done, or to simultaneously save data on COMSOL and write into a text file. It is
important to select the latter when simulating large datasets to prevent losing data if COMSOL
crashes. The voltage, power, and load resistance values for each TEG geometric design need to
be exported to find the maximum power value later in the project.

3.1.12 COMSOL: Simulation


When simulating the TEG, the inputs were separated into smaller batches of 500 or 1000
different simulations, and this would prevent a loss of all the data if COMSOL or the computer
unexpectedly crashes. The full dataset was split in half and simulated in parallel on 2 different
computers to save the total time to simulate. The whole process took nearly 4 days, as the
simulation speed slowed down due to CPU stress of the computers.

3.2 Input Data Generation


3.2.1 TEG Input Parameters
The input parameters, their values, and resolution for the COMSOL simulation can be seen
in Table 3.2. A TEG leg height of 1-10mm was chosen because it needs to be small enough
to fit in-between tight spaces, but also large enough to generate power. The lower boundaries
for the width and ratios were chosen to be 1mm and 0.1 respectively because if the value was
any smaller, the actual fabricated TE legs would be too small and break easily. The upper
boundary for the width is 9.5mm to leave some space between the TE legs and between the
outer edges of the TEG so that it can be connected in series with multiple TEGs to create a
module. If the upper boundary for the ratios were greater than 1, the trapezoidal shape would
be inverted. The ρC was chosen to be the typical values[6]. The dT had an upper boundary
of 1mm because it does not make sense for scenarios where dT value is greater than the lowest
value of HT E . If the Qin /A was lower than 1000 W/m2 , the temperature gradient would be too
small and not produce meaningful results. Qin /A upper range was chosen after some COMSOL
tests to ensure that 6000 W/m2 would be around 700K.
Table 3.2: TEG Input Parameters

Geometrical Parameter Value Range Resolution


Height of TE Legs (HT E ) 1 – 10mm 0.1mm
Width of N Type TE Leg(WN ) 1 – 9.5mm 0.1mm
Width of P Type TE Leg (WP ) 1 – 9.5mm 0.1mm
Ratio of N Type TE Leg (γN ) 0.1 – 1 0.05
Ratio of P Type TE Leg (γP ) 0.1 – 1 0.05
Operating Condition Value Range Resolution
Electrical Contact Resistivity 1e-8 – 1e-6 Ωm 1e-8 Ωm
(ρC )
Thermal Contact Layer 0.1 – 1mm 0.1mm
Thickness (dT )
Input Heat Flux Density 1000 – 6000 W/m2 20 W/m2
(Qin /A)

24
3.2.2 Python Random Data Generator
The inputs are randomly generated by a custom python program which can output ran-
dom numbers accordingly to the value range and resolution of the input parameters in Table
3.2. Furthermore, the format of the output is custom made, such that it can be copy-pasted
immediately into COMSOL.

3.3 Processing COMSOL Outputs


This section covers the methods used to process the raw outputs from COMSOL to be used
as labeled input data for the ANN.

3.3.1 MATLAB: Automatic Maximum point finder


The relationship between power and voltage of the TEG can be seen in Equation 2.17 and if
each point is plotted, a quadratic function can be fitted into the points using the fit(x,y,’poly2’)
function in MATLAB. This function will return a general form of a quadratic with coefficients.
The general form of a quadratic and its derivative is given by Equation 3.8 and 3.9 respectively.

f (x) = ax2 + bx + c (3.8)

f ′ (x) = 2ax + b = 0 (3.9)

The x-coordinate of the maximum is given by Equation 3.10, and plugging this value back
into f(x) will give the y-coordinate of the maximum and it is simplified to Equation 3.12.

−b
x= (3.10)
2a

−b 2 −b
f (x) = a( ) + b( ) + c (3.11)
2a 2a
b2
f (x)max = c − (3.12)
4a

Now, it is possible to always find the maximum power value using just the coefficients returned
by the fit(x,y,’poly2’) function. This MATLAB program is extremely important because it
can process all the simulations extremely fast and automatically, whereas using excel would be
impractical. MATLAB was preferred over different software due to its user-friendly environment.

3.3.2 Preprocessing MATLAB Output Data


The MATLAB output data would be the maximum power value resulting from each set of
input parameters. This data can be appended to the file which contains the input parameters.
The simulations where the temperature of the hot-side is greater than 700K needs to be replaced
with new simulations because the temperature dependent variables of the TE legs do not have
data above 700K in the materials section. The dataset should now just be 5000 simulations of
the TEG and its corresponding maximum power.

25
3.4 Artificial Neural Network
This section covers the method used to build an ANN.

3.4.1 High-Level ANN


The high-level overview of the ANN used in this report can be seen in Figure 3.11. The
rectangular boxes show the state of the program, and they are labelled both by name inside
the box and by number at the top right corner. The diamond shapes represent decision-making
branches with “yes” or “no” questions and answers. Each of the states 1-9 in Figure 3.11 will
be explored more in detail in subsections 3.4.2 to 3.4.8.

Figure 3.11: High level flow chart of the ANN

The ANN was fully coded in Python as it has numerous libraries for ML tasks. Pytorch was
used as the deep learning framework in this project because of its robustness, online community,
and resourceful documentation.

26
3.4.2 Read & Preprocessing Data (High-Level State 1, 2)
The ANN dataset was stored in an excel file, and the “Pandas” library was used to read the
file and separate inputs and outputs. The library “Scikit Learn” was used to separate inputs &
outputs into 80% “training”, 10% “validation”, and 10% “testing” datasets, which is 4000, 500,
500 simulations respectively. All the outputs were converted to a logarithmic scale (explained
in Section 4.2). All the inputs were normalized as they were uniformly distributed, and all the
outputs were standardized as they were transformed to a Gaussian distribution after converting
to a logarithmic scale.

Figure 3.12: Reading and Preprocessing Data for Neural Network

3.4.3 Neural Network Model (High-Level State 3, 4)


Since Optuna is used to optimize the hyper-parameters later, the hyper-parameters of the
ANN need to be specified a range. The range can be seen in Table 3.3, and a big range was
chosen for each of the hyper-parameters to guarantee that the optimal set of hyper-parameter
is within the search range.

Table 3.3: Hyper-parameter range

Hyper-parameter Range
Learning Rate 1e-5 – 1e-1
Number of Hidden Layers 1–5
Number of Neurons 100 – 700

After defining the hyper-parameters, the NN reads in the structure-based hyper-parameters


(see Subsection 2.4.6). The NN creates an input layer with the correct neuron number for the
input features, then it gets passed through a ReLU activation function. The hidden layers and
ReLU activation function is created through a loop that keeps creating hidden layers until it
matches the number of hidden layers passed into the NN from the hyper-parameters. Finally,
an output layer is created, but there is no activation function after the output layer because of
the regression nature of the problem. The NN structure is now complete and can output data.

27
Figure 3.13: Hyper-parameters and Neural Network Model

3.4.4 Training Neural Network (High-Level State, 5)


Although the NN in Subsection 3.4.3 can output data, the weights and biases are not at the
optimal values so the NN needs to be trained as shown in Figure 3.14. PyTorch NN needs to be
explicitly set in training mode which allows the program to update weights & biases. Only the
inputs & outputs of the training dataset should be used during training. Firstly, the original
weights and gradients of the NN need to be initialized, then the training inputs are passed into
the NN and the outputs are set as the predicted training outputs of the NN. The loss between
the predicted and true values are calculated, then use backpropagation to calculate the gradients
from the loss. Using the newly calculated gradients, we can try to reduce the loss by updating
the weights and biases. Finally, the training loss at this epoch is saved for graphing purposes
(Note, all these steps are for 1 epoch).

Figure 3.14: Training Neural Network

28
3.4.5 Validation Neural Network (High-Level State 6)
Figure 3.15 shows the validation of the NN. The PyTorch NN needs to be set to validation
mode to prevent it from updating the weights and biases. Only the validation inputs and
outputs must be used for this part. The validation inputs need to be passed into the NN,
and the outputs are set as the predicted validation outputs. The validation loss is calculated
from the predicted validation outputs and the true validation outputs, and the loss is saved for
graphing and analysis purposes later.

Figure 3.15: Validation Neural Network

3.4.6 Early Stopping (High-Level State 7)


Figure 3.16 shows the “Early Stopping” state. The best validation loss needs to be initialized
to a relatively big value and a patience value needs to be chosen. The best validation loss used
for this project is 10, and the patience value is 150. A counter also needs to be created and set
to 0. If the current validation loss is less than the best loss, it becomes the new best loss, the
counter resets to 0, the NN model for that new best loss is saved, and the program goes back
to the beginning of Training NN. If the current validation loss is greater than the best loss, the
network has not improved so increase the counter value by 1 then check if the current epoch
is greater than 15 and if the counter equals the patience value. If either one is not true, then
go back to the start of Training NN, but if they are both true then break out of the Training,
Validation, and Early Stopping loop.

3.4.7 Testing Neural Network (High-Level State 8)


Figure 3.17 shows the “Testing NN”. The testing loads the best NN model found from using
early stopping. Only the testing inputs and outputs must be used for this part. The test inputs
need to be passed into the NN, and the outputs are set as the predicted test outputs and stored
in a list for easier data manipulation later. The standardization must be removed first for
both the true and predicted test outputs, and then they need to be transformed back into a
linear scale by removing the logarithm. Finally, the NN quality needs to be evaluated, and the
methods used were the accuracy, R2 , MSE. The Accuracy is given by Equation 3.14.

|predicted − true|
Errorrelative = (3.13)
true

Accuracy = 1 − Errorrelative (3.14)

29
Figure 3.16: Early Stopping

Figure 3.17: Testing Neural Network

3.4.8 Optuna Hyper-parameter Tuning (High-Level State 9)


So far only 1 set of hyper-parameters have been put through the NN to give a set of features
that evaluate the quality of the NN. To automatically tune and test multiple sets of hyper-
parameters, Optuna Hyper-parameter Tuning is used as seen in Figure 3.18. The accuracy is
the most important test quality measure, so it needs to be saved along with the set of hyper-
parameters used. The first accuracy becomes the best accuracy, but in later iterations, it
compares the current accuracy with the saved best accuracy. If the current accuracy is greater
than the best accuracy, it saves it as the new best accuracy, then uses Bayesian optimization
techniques to predict new promising set of hyper-parameters. If the current accuracy is less
than the best accuracy, it just goes straight to Bayesian optimization and suggestion of new
hyper-parameters.

30
Figure 3.18: Optuna Hyper-parameter Tuning

3.4.9 Saving Network & Deployment: Neural Network to predict


PD (High-Level State 10, 11)
150 Optuna trials were used in this project, and before it reaches 150 trials it will keep
suggesting new hyper-parameters and going back to state 3 of the high-level ANN. After 150
trials, it recovers the set of hyper-parameters that gave the highest accuracy and saves that
model in a new file. The saved NN model can now be used to make accurate and fast predictions
for TEG geometric designs and operating conditions. Figure 3.19 shows the NN model being
used to forward model TEG. To begin, the best NN model needs to be loaded, then a new
dataset to be investigated must be read and pre-processed. The new dataset can be any set
of input parameters within the specification of Table 3.2 to ensure high accuracy. These pre-
processed inputs go through the neural network once, and the feature scaling & log scale of the
outputs need to be removed. Finally, the outputs can be printed to show the predicted P Dmax
values of the new dataset.

Figure 3.19: Using Neural Network to predict maximum power density

31
Chapter 4

Results and Discussions

4.1 COMSOL/MATLAB
The MATLAB program outputs Pmax , however, to evaluate the TEG performance from this
project compared to other TEGs, a power density is used as it shows the output power per area.
The P Dmax is found after dividing Pmax by 0.0002m, which is the total area of the TEG, and
can be seen in Figure 4.1a. Most of the random TEG structures have very low P Dmax , and very
few structures produce high P Dmax which is reflected by the lack of histogram frequency at
higher PD. Figure 4.1b shows the log scale version of Figure 4.1a, and will be explained further
in Section 4.2.

(a) Linear Scale (b) Log Scale

Figure 4.1: Histogram of P Dmax in linear scale and log scale

4.2 Artificial Neural Network (ANN)


Figure 4.1a does not work well with feature scaling techniques mentioned in Subsection 2.5.3.
Too much of the data is concentrated at very low values, so normalization would just transform
most numbers close to 0, and very few close to 1. The distribution resembles an exponential
decay rather than a Gaussian curve, so standardization would also result in a poor feature scaling
because the mean and standard deviation would not be a good fit. Using the log scale for P Dmax
as seen in Figure 4.1b results in a Gaussian shaped curve which is perfect for standardization.
Transforming to the log scale is done in the program as shown in Subsection 3.4.2.

32
The ANN results are shown in Table 4.1. The final Optuna model took 2 hours to train, and
was able to achieve a 96.2% accuracy on the test dataset. The coefficient of determination (R2 )
value was very high and close to 1, so it also shows great prediction accuracy over the entire
range. The MSE and relative error were also very low, hence the accuracy is high. The ANN’s
accuracy in this project is 2% less than the ANN from Zhu et al. because of the greater number
of parameters and range of parameters investigated in this project, which effectively reduces the
available training data at every particular range.
Table 4.1: ANN Results

Evaluation Method Value


R2 0.995
MSE 0.0784
Relative Error 0.038
Accuracy 96.2%

Figure 4.2 compares the P Dmax from COMSOL with the P Dmax from the ANN for the test
dataset. It displays high consistency between the COMSOL and ANN outputs with a R2 value
of 0.99568, showing high accuracy over the entire P Dmax range.

Figure 4.2: Scatter Plot of ANN True P Dmax vs Predicted P Dmax from Test dataset with R2 value

The hyper-parameters which gave this ANN are shown in Table 4.2. The number of epochs,
hidden layers, neurons, and learning rate were all automatically chosen using early stopping and
Optuna Hyper-parameter optimization as mentioned in Subsection 3.4.6 and 3.4.8 respectively.
The batch size, regularization, and dropout were chosen manually. Reducing the batch size
can become significantly computationally expensive as it determines the number of training
examples that are passed in the NN at 1 iteration. Regularization and dropout are usually used
to prevent overfitting, however the accuracy worsens by about 7% when using regularization and
dropout. Furthermore, Figure 4.3 shows that the training loss and validation loss are extremely
close without any regularization and dropout, meaning the NN is not overfitting or underfitting.

33
Table 4.2: The Hyper-parameters used to build the ANN Model

Hyper-parameter Value
Number of Epochs 551
Learning Rate 0.0012077816128235345
Number of Hidden Layers 1
Number of Neurons 663
Batch Size 32
Regularization 0
Dropout 0

Figure 4.3 shows the training and validation loss for the 96.2% ANN model during training.
The epoch stopped at 701 because after 150 epochs (the patience value used for this model)
the validation loss did not improve, hence the best model was at epoch 551. Setting a longer
patience value would force the ANN to scan for a larger epoch range, and could potentially
increase the accuracy, however it will become computationally expensive. Setting the patience
to 150 showed a good balance between range of search and computational speed.

The small bumps in Figure 4.3 shows the ADAM optimizer adjusting the learning rate to
reach the minima using gradient descent. Setting a larger epoch does not necessarily guarantee
a lower validation loss as we can see spikes in the validation loss at higher epochs. However,
using “Early Stopping” will always guarantee the best validation loss after the NN is trained.
Without “Early Stopping” the best ANN accuracy found after hundreds of trials was 92%,
however, after implementing “Early Stopping” in the ANN, the accuracy increased by over 4%.
It is usually difficult to increase the accuracy of an ANN by a few percentages once it is already
high, however, “Early Stopping” has shown that it can upgrade the ANN even at high accuracy.

Figure 4.3: Training and Validation Loss for ANN Model

34
The hyper-parameter importance weightings given by Optuna can be seen in Figure 4.4.
The learning rate was consistently the most important hyper-parameter for building a highly
accurate ANN. This is because the learning rate needs to be small enough to not diverge from
the global minimum but also needs to be large enough to get to the global minimum without
getting stuck at local minimums, making it very susceptible to small changes. The number of
neurons and layers had less impact because the weights of the ANN can always be updated to
perform best for that specific number of neuron and layer.

Figure 4.4: Hyper-parameter Importance for ANN Model

The Parallel Coordinate Plot in Figure 4.5 shows the history of all the combinations of
hyper-parameters used to find the best set of hyper-parameters. Since Optuna uses a Bayesian
optimization technique, there is a trend of high performing set of hyper-parameters as shown
by the more populated areas in the plot. It also shows that Optuna has tried other sets of
hyper-parameters, but spends less time on unpromising combinations which saves computational
resources.

Figure 4.6 shows the history of the accuracy values at each Optuna trials. The red line shows
the best value, and it can be seen that at the start the best value was increasing more frequently,
but towards the end, the best value would only increase after significantly more trials, and the
increase value was smaller. At the start, it is easier for the ANN to discover many minimums,
but when it discovers a very good minimum (not necessarily the global minimum) it is difficult
to discover other minimums which are as good. Trial 83 gave the best set of hyper-parameters,
and the Optuna optimization kept running until trial 150 to ensure a thorough search of hyper-
parameters.

35
36
Figure 4.5: Parallel Coordinate Plot for ANN Model
37
Figure 4.6: History of Accuracy values
Figure 4.7a shows the accuracy of the ANN at different P Dmax in the log scale for the test
dataset. The accuracy tends to be higher near the middle of the Log(P Dmax ), and lower at the
sides. This is because the Log(P Dmax ) output as shown in Figure 4.1b has more data at the
middle and less at the sides, so the ANN has more training examples at the middle and less at
the sides. The 4-5 Log(P Dmax ) range in Figure 4.7a deviates from then trend, but this is an
outlier as the 4-5 Log(P Dmax ) range of the test dataset only has 2 examples as shown in Figure
4.7b.

(a) Power Density (Log) vs Accuracy (b) Histogram of Power Density (Log) vs Accuracy

Figure 4.7: ANN accuracy at different Power Density (Log) for Test Dataset

The time taken for COMSOL simulation and ANN simulation is shown in Table 4.3. The
exact COMSOL time for 5000 and 32761 simulations is extrapolated from the time results in
Table 3.1 but it would take longer in real life due to CPU stress. The ANN time is found from
the time it takes to execute the program. A 3D contour map such as Figure 4.12a required
32761 simulations, so creating such a figure would take over a month in COMSOL but only a
couple of seconds with the ANN. This ANN tool will be a necessity to researchers that wish
to produce complex graphs for TEG analysis, as the 1,000,000 times increase in computational
speed far outweighs the few percentage loss in accuracy (1,000,000 times increase is calculated
from the 34 days 3 hours and 2.78 secs).
Table 4.3: Time Taken for COMSOL and ANN simulations

Number of TEG COMSOL simulation ANN simulation time


simulations time
10 15 mins 0.0277 secs
5000 5 days 5 hours 0.462 secs
32761 34 days 3 hours 2.78 secs

The computer specifications used for COMSOL and ANN are as followed:
• COMSOL: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3192 Mhz 6 Core(s) 12 Logical
Processor(s)
• ANN: Apple M1 Pro 10-core CPU with 8 performance cores and 2 efficiency cores
The different computer specifications may have resulted in a less precise comparison, however,
the time difference is too significant and using the same computer would have resulted in similar
proportions.

38
4.3 TEG Geometric Design Parameter Sweep
This section covers the results and evaluation of when a single geometric parameter of the
TEG is varied and all the other geometric parameters and operating conditions are kept constant
at their median value within their range.

4.3.1 Height of TE Legs


The maximum power density vs height of TE legs is shown in Figure 4.8. The height was
sampled every 0.05mm for every curve to give a high resolution, and this level of resolution was
only possible (in terms of computational efficiency) because of the ANN. The different curves
represent different variations of P Dmax vs HT E when the width of the hot side TE legs are both
varied to the same value. Both WN and WP are kept at the same value when changing the
width, and the widths were chosen at the 0th percentile, 25th percentile, 50th percentile, 75th
percentile, and 100th percentile of the full TE leg width range. It can be observed that the
general trend is that P Dmax increases as HT E increases, and smaller values for WP = WN result
in higher power performances, but when WP = WN is too small the TEG performs better at
lower HT E but the rate of increase decreases as HT E increases. A mathematical analysis will be
needed to understand and explain the results seen in Figure 4.8.

The electrical resistance of the TE legs is given by Equation 4.1, and the thermal resistance
of the TE legs is given by Equation 4.2. These are variations of Equation 2.3 and 2.4 as the
cross-sectional area of the asymmetric TE legs are non-uniform. The length for both electrical
and thermal resistance is given by the HT E , and A’ will be used instead of 4 · a · b for the sake
of clarity.
L HT E
R= = (4.1)
σ·4·a·b σ · A′
L HT E
Rθ = = (4.2)
κ·4·a·b κ · A′

Qin after substituting Rθ is given by Equation 4.3, and ∆T is given by Equation 4.4 after
rearranging Equation 4.3.

∆T κ · A′ · ∆T
Qin = = (4.3)
Rθ HT E
Qin · HT E
∆T = (4.4)
κ · A′

The Seebeck voltage is given in Equation 2.1, and the new value of ∆T from Equation 4.4 can
be plugged in to the Seebeck voltage. The new Seebeck voltage formula is shown in Equation
4.5. This Seebeck voltage can be plugged into the maximum power formula of the TEG, and
the internal resistance of the TEG, given by Equation 4.1, can also be plugged into the formula
giving Equation 4.6.
S · Qin · HT E
V = (4.5)
κ · A′
V2 S 2 · Q2in · HT2 E σ · A′
P = = · (4.6)
4 · RT EG κ2 · A′2 4 · HT E

39
After simplifying, the maximum power is given by Equation 4.7. Although this equation is
showing the power, and the graph is showing the PD, the relationship is the same as the PD
is the power divided by the area of the TEG (0.0002m). The power and HT E are proportional
because S, Qin , σ, κ, A’ are constants. Therefore, it explains the general trend that the P Dmax
increases as HT E increases. Furthermore, it is expected for the HT E to be linearly correlated
to the power, and the curves in Figure 4.8 should be positive linear lines, but they are not.
This is because S, σ, κ are temperature dependent values, and their values would be changing
when HT E is changing. This also shows how a mathematical analysis can be very fast, but it
would only be possible with simplified models such as S, σ, κ being constant values. Finite
element analysis (COMSOL) is able to take into account the temperature dependence and
interdependence of all the variables, resulting in higher accuracy. Lastly, the ANN was able
to calculate over 1,000 simulations for Figure 4.8 in 1 second while maintaining high accuracy,
whereas COMSOL would take over a day to simulate the results for Figure 4.8.

S 2 · Q2in · σ
P = · HT E (4.7)
4 · κ2 · A′

As seen in Equation 4.1 and 4.2, when HT E increases, the electrical resistance and thermal
resistance both increase. A higher electrical resistance causes less current, and therefore reduces
power. A higher thermal resistance causes greater ∆T as seen in Equation 4.3, and this tem-
perature difference increases the Seebeck voltage which also increases the power. As the results
show that P Dmax increases with increasing HT E , it can be concluded that the increase in ther-
mal resistance affects the TEG more than the increase in electrical resistance. This conclusion
can be made for WP = WN = 3.125mm, WP = WN = 5.25mm, WP = WN = 7.375mm, WP =
WN = 9.5mm. When WP = WN = 1mm the rate of increase for P Dmax decreases when HT E
increases, and this is because the electrical resistance impacts the TEG more than the thermal
resistance at this condition. In general, a lower WP = WN results in greater power performances,
and this is because the area given by A’ in Equation 4.7 is inversely related to the power. The
effect of the width will be covered more in detail in the next section.

Figure 4.8: Maximum Power Density vs Height of TE Legs

40
4.3.2 Width of TE Legs
The P Dmax vs TE leg width is shown in Figure 4.9. Figure 4.9a shows the results when WN
is varied with different conditions of WP at different percentiles. Figure 4.9b shows the opposite
of Figure 4.9a where WP is varied and the different curves represent different conditions of WN .

For both the figures, the initial observation is that for all the curves, the P Dmax increases,
then decreases after a certain point. From a mathematical perspective, smaller width means
smaller area, and larger width means larger area. The area, A’, is inversely related to the
electrical and thermal resistance as seen in equations 4.1 and 4.2. This means a larger width
corresponds to smaller electrical and thermal resistance, and a smaller width corresponds to
a larger electrical and thermal resistance. As WN and WP increase, the Rθ decreases causing
P Dmax to be lower. Conversely, a very small WN and WP causes large interconnect resistance
which also deteriorates P Dmax .

In Figure 4.9a, the maximum P Dmax of the curves increases when WP becomes smaller, but
when WP is very small the maximum P Dmax actually decreases which is as expected because of
the large interconnect resistance of WP . Figure 4.9b also shows similar behavior, except when
WN is very small, the maximum P Dmax continues to increase which was not expected. This
means WN is still big enough that the interconnect resistance is having minimal effect. The
peak P Dmax for the N-Type tends to occur at smaller values of WN , on the other-hand, the
peak P Dmax for the P-Type occurs at larger values of WP and the peaks are wider compared
to the N-Type.

(a) N-Type (b) P-Type

Figure 4.9: Maximum Power Density vs Width of N-Type and P-Type TE Legs

Figure 4.10a shows a 3D contour of WN and WP where the Z-axis is the P Dmax , and Figure
4.10b shows the equivalent figure in a 2D heat map contour. The P Dmax peaks around the
medium of WP and at smaller values for WN . This is because of the difference in electrical con-
ductivity and thermal conductivity of the P and N-Type material of the TE legs. Furthermore,
WP is able to produce a higher P Dmax for a larger range than WN as seen in Figure 4.10b which
is consistent with Figure 4.9.

41
(b) 2D Contour
(a) 3D Contour

Figure 4.10: Maximum Power Density vs Width of N-Type and P-Type TE Legs

4.3.3 Ratio of TE Legs


The P Dmax vs ratio (γ) is shown in Figure 4.11, and the different conditions of WP = WN
are represented by different curves. For both N and P-Type TE legs, the P Dmax starts low
for small ratios, and as the ratio increases P Dmax also increases until a threshold point and
then it begins to deteriorate again as the ratio increases. At low ratios, the area of the TE
leg at the cold side is very small so it induces very high interconnect resistance, and at higher
ratios the thermal resistance decreases causing ∆T to decrease and finally the P Dmax also
decreases. The deteriorating rate at larger ratios is higher for the N-Type TE leg compared
to P-Type, due to the greater thermal conductivity of the N-Type material compared to the
P-Type material (average of κ = 2.954[W m−1 K −1 ] for N-type and κ = 1.124[W m−1 K −1 ] for
P-type). As expected for both N and P-Type TE legs, the smaller WP = WN produces greater
P Dmax because it increases Rθ , and when WP = WN is too small the P Dmax deteriorates again
because of the large interconnect resistance.

(a) N-Type (b) P-Type

Figure 4.11: Maximum Power Density vs Ratio of N-Type and P-Type TE Legs

42
Figure 4.12a shows a 3D contour of γN and γP where the Z-axis is the P Dmax , and Figure
4.12b shows the equivalent figure in a 2D heat map contour. In both the figures, WP = WN is
kept constant at 5.25mm. The observations show that γP has a bigger range of values where
P Dmax is high, but only small values of γN lead to high P Dmax . This is due to the difference
in the characteristics of the N and P-Type material used for the TE legs such as the thermal
conductivity mentioned earlier. A symmetric TEG would be when γP = γN = 1, but as seen
in Figure 4.12b the P Dmax is not at its peak when both ratio equals 1. The asymmetric TEG
benefits from the constantly varying cross-sectional area of the TE legs, and as the area becomes
smaller towards the cold side, the thermal resistance increases causing ∆T to be bigger, which
increases output power.

(b) 2D Contour
(a) 3D Contour

Figure 4.12: Maximum Power Density vs Width of N-Type and P-Type TE Legs

4.4 TEG Operating Condition Parameter Sweep


This section covers the results and evaluation of when a single operating condition of the TEG
is varied and all the other geometric parameters and operating conditions are kept constant at
their median value within their range. Figure 4.13, 4.14, 4.15 all have 3 sub-figures where (a)
varies HT E , (b) varies WP = WN , and (c) varies γP = γN at the 0th , 25th , 50th , 75th , 100th
percentiles within their range.

4.4.1 Thermal Contact Layer Thickness


The maximum power density vs the thermal contact layer thickness (dT ) is shown in Figure
4.13. Figure 4.13a shows P Dmax vs dT at different HT E . As expected the lower HT E have
lower P Dmax and increasing HT E also increases P Dmax . The P Dmax is constant for lower HT E ,
but slightly decreases as dT increases for higher HT E . This is because when dT increases, Rθ
decreases and temperature difference decreases, resulting in a lower P Dmax . Figure 4.13b shows
P Dmax vs dT at different WP = WN . As expected, for greater WP = WN , the P Dmax decreases,
and for smaller WP = WN , the P Dmax increases. Furthermore, when WP = WN becomes too
small, the P Dmax starts to decrease again as seen by the black line being lower than the red
line. For different γP = γN conditions, when dT is varied, the P Dmax is generally constant
meaning the dT does not affect the ratios much. The dT only deteriorates the P Dmax when
γP = γN is very small. Moreover, the P Dmax range is close for the different γP = γN conditions

43
as compared to HT E and WP = WN conditions. Figure 4.13c is also showing as expected that
decreasing γP = γN would increase P Dmax , but very small γP = γN would decrease P Dmax .
Besides the outlier for γP = γN = 1 in Figure 4.13c, the thermal contacts generally show that
it does not have significant effect on P Dmax , and Ouyang et al. also had similar conclusions
about a TEG’s thermal contacts[14].

(a) Height (b) Width (c) Ratio

Figure 4.13: Maximum Power Density vs Thermal Contact Layer Thickness for different values of
height, width, ratio

4.4.2 Electrical Contact Resistivity


The maximum power density vs the electrical contact resistivity (ρC ) is shown in Figure 4.14.
Equation 4.8 is the rewritten form of Equation 4.7 where the σ is replaced by ρ1 . As expected,
all the graphs show that the P Dmax ∝ ρ1 . Figure 4.14a shows P Dmax vs ρC for different heights.
As expected, the larger the HT E , the greater the P Dmax . The different widths in Figure 4.14b
turnout as expected with larger WP = WN producing smaller P Dmax , and very small WP = WN
(black line) also producing slightly lower P Dmax . Finally, the different ratios in Figure 4.14c also
turnout as expected with smaller γP = γN producing higher P Dmax , and very small γP = γN
(black line) producing much lower P Dmax . This is because the electrical contact resistivity adds
to the already high interconnect resistance causing even more electrical resistance.

S 2 · Q2in · HT E 1
P = · (4.8)
4 · κ2 · A′ ρ

(a) Height (b) Width (c) Ratio

Figure 4.14: Maximum Power Density vs Electrical Contact Resistivity for different values of height,
width, ratio

44
4.4.3 Input Heat Flux Density
The maximum power density vs the input heat flux density is shown in Figure 4.15. All the
curves in Figure 4.15 show parabolic nature as expected because P ∝ Q2in as seen in Equation
4.7. Figure 4.15a confirms once again that increasing HT E also increases P Dmax . Figure 4.15b
shows that increasing WP = WN decreases P Dmax , but when WP = WN is too low, the P Dmax
also decreases slightly again, and this is consistent with the results in the earlier sections. Finally,
Figure 4.15c shows as expected that decreasing γP = γN would increase the P Dmax , and when
γP = γN is too small, the P Dmax decreases significantly. HT E affects the Q2in /A the most as a
greater HT E is able to sustain a greater ∆T which increases power. This is confirmed by the
range of Figure 4.15a being the biggest compared to the width and ratio.

(a) Height (b) Width (c) Ratio

Figure 4.15: Maximum Power Density vs Input Heat Flux Density for different values of height,
width, ratio

45
Chapter 5

Conclusion

5.1 Conclusion
The application of an ANN as a forward modeller for asymmetric TEGs has been demon-
strated for the first time. Furthermore, the consideration of thermal contact layer thickness as
an input to the ANN, and the wide range of TEG inputs to the ANN has never been attempted
before. The ANN had an extremely high prediction accuracy of over 96% while taking into
account the heat flux condition, electrical contact resistivity, thermal contact layer thickness,
and other thermoelectric effects. It can be a replacement for analytical and numerical models
as it accounts for the temperature dependent variables, and it can be a replacement for FEM as
the computational speeds are over 1,000,000 times faster. The successful implementation of an
ANN as a modeller for TEGs shows many future possibilities for machine learning to be applied
to different TEG structures and even other renewable energy technologies. Artificial intelligence
in the renewable energy sector could really be the next step we need to take to meet the Net
Zero aim in 2050.

5.2 Further Work


A few ways the project could be expanded is: test different asymmetric TEG structures,
include temperature of the hot-side as an output for the ANN, optimize the geometric design of
the TEG using the ANN modeller. For the first case, the TEG and ANN have already been built
so only changing the TE leg shape in COMSOL is needed, then it would not take long to have an
ANN modeller ready for the new asymmetric TEG. For the second case, the current COMSOL
output dataset already has the hot-side data, but due to time constraints, it was not used in this
project. The ANN would just need to be retrained using Optuna hyper-parameter optimization
while having the temperature as output, and that could be achieved in a few hours. Finally,
the design optimization is the most obvious extension to this project. The original project was
completed slightly ahead of schedule, so the optimization was attempted.

Zhu et al used a genetic algorithm (GA) to optimize the ANN, however building a GA itself
would take a lot of time. The same Bayesian optimization technique used for hyper-parameters
was used to optimize the TEG input parameters, this required a rewiring of Optuna so that
it targets the input parameters instead of hyper-parameters. Table 5.1 shows the results of
using Optuna to optimize the TEG inputs. Although this is not the correct way of optimizing
the geometric design, it shows that Bayesian optimization has the potential to be used as an
optimizer. The correct way would be to optimize the geometric design under different operating
conditions, instead of optimizing the operating conditions as well. The program predicted

46
a P Dmax of 335.188 W/m2 for the input parameters, but the COMSOL result was 233.322
W/m2 , which meant it had a 56.34% accuracy. The accuracy was very low because the randomly
generated dataset did not have enough data for TEGs which produce such high P Dmax as can
be seen from Figure 4.1a. The ANN was predicting P Dmax values that are over double the
P Dmax in the dataset it was trained with.

Table 5.1: TEG Optimization attempt using Bayesian optimizer

Optuna Study Statistics Value


Number of Trials 10,000
Best P Dmax 335.188 W/m2
Parameter Value
Height 10mm
Width of N-Type TE Leg 1.7mm
Width of P-Type TE Leg 3.8mm
Ratio of N-Type TE Leg 1
Ratio of P-Type TE Leg 0.45
Electrical Contact Resistivity 1e-8 Ωm
Thermal Conductivity Layer Thickness 0.1mm
Input Heat Flux Density 6000 W/m2

To increase accuracy, the ANN needs to be trained with more data that have high P Dmax
potential, and looking at the parallel coordinate plot in Figure 5.1 can tell us the general input
parameter ranges needed in the new dataset.

5.3 Project Management


A Gantt chart of the project schedule can be seen in Figure 5.2, each box represents a week
and Monday is set as the start of every week. A meeting was arranged every week with the
supervisor, and if one party was busy, it was always rearranged to a different day in the week.
Before meetings, a powerpoint slideshow is made for the supervisor to present the progress made
during the week. In total there were 18 meetings and 351 slides, so an average of 19.5 slides
were presented to the supervisor weekly. The meetings start by going over the progress targets
set in the previous week, followed by the presentation and then a discussion about issues in the
project and potential solutions. The meetings always end with bullet point notes of progress
goals to be made before the next meeting. The audio of every meeting is recorded for later use.
This organized method of meeting the supervisor ensured the project is always progressing at
a good pace and problems are identified and solved promptly. COMSOL files were regularly
saved into new versions to ensure the protection of every milestone. In total 75 COMSOL files
were created and saved throughout the project, and they were saved in a computer and on the
cloud as backup. The MATLAB and ANN code also had multiple files as a backup, and they
were saved both on the computer and Github.

47
48
Figure 5.1: Parallel Coordinate Plot of TEG input parameter optimization
Gantt Chart for Individual Project
By: Chotiya Mahittigul Mon, 11/10/2021
Project Start:
Monday October November December January Feburary March April May
Day in Week:
11 18 25 1 8 15 22 29 4 11 18 25 1 8 15 22 29 4 11 18 25 4 11 18 25 4 11 18 25 1

TASK PROGRESS START END M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M

COMSOL Multiphysics

Learn COMSOL 100% 11/10/21 10/2/22

Build Geometry of TEG 100% 11/10/21 16/12/21

TE Leg Material (Get Data) 100% 16/11/21 23/11/21

Setting up TEG circuit/heat transfer 100% 19/10/21 1/11/21

Setting up Load resistance of TEG 100% 26/10/21 5/2/22

Test simulations 100% 1/11/21 15/2/22

COMSOL simulation 100% 16/2/22 18/2/22

MATLAB/Python

Build MATLAB Max power finder 100% 30/11/21 4/11/21

Python Random number generator 100% 11/12/21 12/12/21

Preprocess COMSOL input data 100% 25/1/22 30/1/22

Artificial Neural Network

Learn Python 100% 10/1/22 27/3/22

Data Preprocessing for ANN 100% 19/2/22 22/2/22

Read Data/Split training set 100% 12/2/22 25/2/22

Build Neural Network 100% 18/2/22 4/3/22

Build Train/Val/Test Loops 100% 20/2/22 1/3/22

Build Hyper-parameter Tuning 100% 2/3/22 11/3/22

Early Stopping 100% 12/3/22 14/3/22

Train Final ANN 100% 15/3/22 15/3/22

Make tests to verify ANN 100% 16/3/22 20/3/22

Results/Report Writing

Make datasets to feed into ANN 100% 21/3/22 25/3/22

Produce ANN results 100% 26/3/22 27/3/22

Plot Results in Origin 100% 28/3/22 30/3/22

Report Writing 100% 31/3/22 25/5/22

Editing Report 100% 26/5/22 3/5/22

Figure 5.2: Gantt Chart of project. Each box represents a week that starts on Monday

49
5.4 Reflection
This was my first proper research project and report, and I found the experience very in-
tellectually stimulating. Before the project, I have never used COMSOL before and I found it
extremely difficult to set up a simulation because of the lack of COMSOL TEG documentation
on the internet. Most of my time in semester 1 was spent on testing COMSOL simulations and
learning about the environment, however, those tests are not included in the report because
it was just for my understanding. I have also never coded in Python before this project, so
the beginning was very difficult because of the syntax errors that I was getting. This project
has not only made me confident in using COMSOL and coding in Python but also made me
confident in conducting individual research and finding relevant journals and articles to support
my project. I have also learned other software such as DataThief, Origin, and Latex for the
first time for this project, and I am sure they would help me with future reports.

My supervisor, Dr. Huang, has recently informed me that my findings from my 3rd year
individual project have been included in the abstract, along with my name as one of the authors,
of a conference abstract written by his Ph.D. student, Yuxiao Zhu, which will be submitted to
the “European Thermoelectric Conference” this year. I am very delighted about this and look
forward to helping Dr. Huang’s research group. I also strongly believe the ANN created in
my project can greatly assist future projects in the research group because it can automatically
optimize the hyper-parameters, which would save a lot of time.

All in all, this was a very challenging, but precious experience that I will remember for the
rest of my life.

50
Bibliography

[1] BP, “Primary energy: Energy economics: Home.” [Online]. Available: https:
//www.bp.com/en/global/corporate/energy-economics/statistical-review-of-world-energy
/primary-energy.html

[2] J. Hansen, P. Kharecha, M. Sato, V. Masson-Delmotte, F. Ackerman, D. J. Beerling,


P. J. Hearty, O. Hoegh-Guldberg, S. L. Hsu, C. Parmesan, J. Rockstrom, E. J. Rohling,
J. Sachs, P. Smith, K. Steffen, L. V. Susteren, K. V. Schuckmann, and J. C. Zachos,
“Assessing ”dangerous climate change”: Required reduction of carbon emissions to protect
young people, future generations and nature,” PLoS ONE, vol. 8, 2013.

[3] M. Z. Jacobson, M. A. Delucchi, Z. A. Bauer, S. C. Goodman, W. E. Chapman, M. A.


Cameron, C. Bozonnat, L. Chobadi, H. A. Clonts, P. Enevoldsen, J. R. Erwin, S. N. Fobi,
O. K. Goldstrom, E. M. Hennessy, J. Liu, J. Lo, C. B. Meyer, S. B. Morris, K. R. Moy,
P. L. O’Neill, I. Petkov, S. Redfern, R. Schucker, M. A. Sontag, J. Wang, E. Weiner, and
A. S. Yachanin, “100% clean and renewable wind, water, and sunlight all-sector energy
roadmaps for 139 countries of the world,” Joule, vol. 1, 2017.

[4] U. Nations, “Paris agreement text english - unfccc,” 2015. [Online]. Available:
https://unfccc.int/sites/default/files/english paris agreement.pdf

[5] M. Bhattacharya, M. Ranjan, N. Kumar, and T. Maiti, “Performance analysis and opti-
mization of a snse-based thermoelectric generator,” ACS Applied Energy Materials, vol. 4,
2021.

[6] Y. Zhu, D. W. Newbrook, P. Dai, C. K. de Groot, and R. Huang, “Artificial


neural network enabled accurate geometrical design and optimisation of thermoelectric
generator,” Applied Energy, vol. 305, p. 117800, 2022. [Online]. Available: https:
//www.sciencedirect.com/science/article/pii/S030626192101134X

[7] Q. H. Zhang, X. Y. Huang, S. Q. Bai, X. Shi, C. Uher, and L. D. Chen, “Thermoelectric


devices for power generation: Recent progress and future challenges,” Advanced Engineering
Materials, vol. 18, 2016.

[8] A. Koutsoukas, K. J. Monaghan, X. Li, and J. Huan, “Deep-learning: Investigating deep


neural networks hyper-parameters and comparison of performance to shallow methods for
modeling bioactivity data,” Journal of Cheminformatics, vol. 9, 2017.

[9] O. Y. Titov and Y. G. Gurevich, “Temperature gradient and transport of heat and charge
in a semiconductor structure,” Low Temperature Physics, vol. 47, 2021.

[10] X. Wang, J. Qi, W. Deng, G. Li, X. Gao, L. He, and S. Zhang, “An optimized design
approach concerning thermoelectric generators with frustum-shaped legs based on three-
dimensional multiphysics model,” Energy, vol. 233, 2021.

51
[11] K. S. Ong, L. Jiang, and K. C. Lai, “Thermoelectric energy conversion,” Comprehensive
Energy Systems, vol. 4-5, 2018.
[12] N. Jaziri, A. Boughamoura, J. Müller, B. Mezghani, F. Tounsi, and M. Ismail, “A com-
prehensive review of thermoelectric generators: Technologies and common applications,”
Energy Reports, vol. 6, 2020.
[13] S. Shittu, G. Li, X. Zhao, X. Ma, Y. G. Akhlaghi, and Y. Fan, “Comprehensive study
and optimization of concentrated photovoltaic-thermoelectric considering all contact resis-
tances,” Energy Conversion and Management, vol. 205, 2020.
[14] Z. Ouyang and D. Li, “Modelling of segmented high-performance thermoelectric generators
with effects of thermal radiation, electrical and thermal contact resistances,” Scientific
Reports, vol. 6, 2016.
[15] X. Zhou, Y. Yan, X. Lu, H. Zhu, X. Han, G. Chen, and Z. Ren, “Routes for high-
performance thermoelectric materials,” Materials Today, vol. 21, 2018.
[16] B. Cai, H. Hu, H. L. Zhuang, and J. F. Li, “Promising materials for thermoelectric appli-
cations,” Journal of Alloys and Compounds, vol. 806, 2019.
[17] N. Neophytou, S. Foster, V. Vargiamidis, G. Pennelli, and D. Narducci, “Nanostructured
potential well/barrier engineering for realizing unprecedentedly large thermoelectric power
factors,” Materials Today Physics, vol. 11, 2019.
[18] G. J. Snyder and E. S. Toberer, “Complex thermoelectric materials,” Nature Materials,
vol. 7, 2008.
[19] S. Perumal, P. Bellare, U. S. Shenoy, U. V. Waghmare, and K. Biswas, “Low thermal con-
ductivity and high thermoelectric performance in sb and bi codoped gete: Complementary
effect of band convergence and nanostructuring,” Chemistry of Materials, vol. 29, 2017.
[20] L. Yang, Z. G. Chen, M. S. Dargusch, and J. Zou, “High performance thermoelectric
materials: Progress and their applications,” Advanced Energy Materials, vol. 8, 2018.
[21] Z. Liu, S. Zhu, Y. Ge, F. Shan, L. Zeng, and W. Liu, “Geometry optimization of two-stage
thermoelectric generators using simplified conjugate-gradient method,” Applied Energy,
vol. 190, 2017.
[22] H. Tian, X. Sun, Q. Jia, X. Liang, G. Shu, and X. Wang, “Comparison and parameter op-
timization of a segmented thermoelectric generator by using the high temperature exhaust
of a diesel engine,” Energy, vol. 84, 2015.
[23] U. Erturun, K. Erermis, and K. Mossi, “Effect of various leg geometries on thermo-
mechanical and power generation performance of thermoelectric devices,” Applied Thermal
Engineering, vol. 73, 2014.
[24] D. R. Karana and R. R. Sahoo, “Influence of geometric parameter on the performance of
a new asymmetrical and segmented thermoelectric generator,” Energy, vol. 179, 2019.
[25] O. I. Ibeagwu, “Modelling and comprehensive analysis of tegs with diverse variable leg
geometry,” Energy, vol. 180, 2019.
[26] H. Jouhara, A. Żabnieńska Góra, N. Khordehgah, Q. Doraghi, L. Ahmad, L. Norman,
B. Axcell, L. Wrobel, and S. Dai, “Thermoelectric generator (teg) technologies and appli-
cations,” International Journal of Thermofluids, vol. 9, 2021.

52
[27] B. Şişik and S. LeBlanc, “The influence of leg shape on thermoelectric performance under
constant temperature and heat flux boundary conditions,” Frontiers in Materials, vol. 7,
2020.

[28] H. Yang, G. Shu, H. Tian, X. Ma, T. Chen, and P. Liu, “Optimization of thermoelectric
generator (teg) integrated with three-way catalytic converter (twc) for harvesting engine’s
exhaust waste heat,” Applied Thermal Engineering, vol. 144, 2018.

[29] M. A. Zoui, S. Bentouba, J. G. Stocholm, and M. Bourouis, “A review on thermoelectric


generators: Progress and applications,” Energies, vol. 13, 2020.

[30] L. C. Ding, N. Meyerheinrich, L. Tan, K. Rahaoui, R. Jain, and A. Akbarzadeh, “Thermo-


electric power generation from waste heat of natural gas water heater,” Energy Procedia,
vol. 110, 2017.

[31] W. He, G. Zhang, X. Zhang, J. Ji, G. Li, and X. Zhao, “Recent development and application
of thermoelectric generator and cooler,” Applied Energy, vol. 143, 2015.

[32] G. Bennett and E. Skrabek, “Power performance of us space radioisotope thermoelectric


generators,” in Fifteenth International Conference on Thermoelectrics. Proceedings ICT
’96, 1996, pp. 357–372.

[33] G. Min and D. M. Rowe, “Improved model for calculating the coefficient of performance of
a peltier module,” Energy Conversion and Management, vol. 41, 2000.

[34] D. W. Newbrook, R. Huang, S. P. Richards, S. Sharma, G. Reid, A. L. Hector, and C. H.


de Groot, “Mathematical model and optimization of a thin-film thermoelectric generator,”
JPhys Energy, vol. 2, 2020.

[35] S. Qing, A. Rezania, L. A. Rosendahl, and X. Gou, “An analytical model for performance
optimization of thermoelectric generator with temperature dependent materials,” IEEE
Access, vol. 6, 2018.

[36] G. Liang, J. Zhou, and X. Huang, “Analytical model of parallel thermoelectric generator,”
Applied Energy, vol. 88, 2011.

[37] W. H. Chen, Y. X. Lin, X. D. Wang, and Y. L. Lin, “A comprehensive analysis of the


performance of thermoelectric generators with constant and variable properties,” Applied
Energy, vol. 241, 2019.

[38] T. Seetawan, U. Seetawan, A. Ratchasin, S. Srichai, K. Singsoog, W. Namhongsa, C. Rut-


tanapun, and S. Siridejachai, “Analysis of thermoelectric generator by finite element
method,” Procedia Engineering, vol. 32, 2012.

[39] G. Wu and X. Yu, “A holistic 3d finite element simulation model for thermoelectric power
generator element,” Energy Conversion and Management, vol. 86, 2014.

[40] R. A. Kishore, R. L. Mahajan, and S. Priya, “Combinatory finite element and artificial
neural network model for predicting performance of thermoelectric generator,” Energies,
vol. 11, 2018.

[41] J. Brownlee, “14 different types of learning in machine learning,” Nov 2019. [Online].
Available: https://machinelearningmastery.com/types-of-learning-in-machine-learning/

53
[42] J. Nathaniel, “Understanding pytorch loss functions: The maths and algorithms (part
1),” Medium, Aug 2021. [Online]. Available: https://towardsdatascience.com/understandi
ng-pytorch-loss-functions-the-maths-and-algorithms-part-1-6e439b27117e

[43] V. Trevisan, “Comparing robustness of mae, mse and rmse,” Medium, Mar 2022. [Online].
Available: https://towardsdatascience.com/comparing-robustness-of-mae-mse-and-rmse-
6d69da870828

[44] J. Jordan, “Setting the learning rate of your neural network.” Jeremy Jordan, Aug 2020.
[Online]. Available: https://www.jeremyjordan.me/nn-learning-rate/

[45] K. Khalil, O. Eldash, A. Kumar, and M. Bayoumi, “An efficient approach for neural net-
work architecture,” 2018 25th IEEE International Conference on Electronics Circuits and
Systems, ICECS 2018, 2019.

[46] L. Shukla, “Designing your neural networks,” Medium, Sep 2019. [Online]. Available:
https://towardsdatascience.com/designing-your-neural-networks-a5e4617027ed

[47] S. Sharma, S. Sharma, and A. Athaiya, “Activation functions in neural networks,” Inter-
national Journal of Engineering Applied Sciences and Technology, vol. 04, 2020.

[48] V. Luhaniwal, “Forward propagation in neural networks-simplified math and code


version,” Medium, Oct 2020. [Online]. Available: https://towardsdatascience.com/forwa
rd-propagation-in-neural-networks-simplified-math-and-code-version-bbcfef6f9250

[49] A. Al-Masri, “How does back-propagation in artificial neural networks work?” Jan 2019.
[Online]. Available: https://towardsdatascience.com/how-does-back-propagation-in-arti
ficial-neural-networks-work-c7cad873ea7#:∼:text=Back\%2Dpropagation\%20is\%20just
\%20a,lower\%20weights\%20and\%20vice\%20versa

[50] T. Shah, “About train, validation and test sets in machine learning,” Medium, Jul 2020.
[Online]. Available: https://towardsdatascience.com/train-validation-and-test-sets-72cb
40cba9e7

[51] S. Singh, “Understanding the bias-variance tradeoff,” Oct 2018. [Online]. Available:
https://towardsdatascience.com/understanding-the-bias-variance-tradeoff-165e6942b229

[52] A. Gupta, “A comprehensive guide on deep learning optimizers,” Oct 2021. [Online].
Available: https://www.analyticsvidhya.com/blog/2021/10/a-comprehensive-guide-on-de
ep-learning-optimizers/\#:∼:text=An\%20optimizer\%20is\%20a\%20function,loss\%20
and\%20improve\%20the\%20accuracy

[53] aniruddha, “Feature scaling: Standardization vs normalization,” Aug 2021. [Online].


Available: https://www.analyticsvidhya.com/blog/2020/04/feature-scaling-machine-lea
rning-normalization-standardization/

[54] I. Jindal, M. Nokleby, and X. Chen, “Learning deep networks from noisy labels with
dropout regularization,” Proceedings - IEEE International Conference on Data Mining,
ICDM, 2017.

[55] J. Brownlee, “A gentle introduction to early stopping to avoid overtraining neural


networks,” Aug 2019. [Online]. Available: https://machinelearningmastery.com/early-sto
pping-to-avoid-overtraining-neural-network-models/

54
[56] W. Koehrsen, “A conceptual explanation of bayesian hyperparameter optimization for
machine learning,” Jul 2018. [Online]. Available: https://towardsdatascience.com/a-conce
ptual-explanation-of-bayesian-model-based-hyperparameter-optimization-for-machine-le
arning-b8172278050f

[57] A. Elvers, “Hyperparameter optimization,” Apr 2022. [Online]. Available: https:


//en.wikipedia.org/wiki/Hyperparameter optimization#:∼:text=Bayesian\%20optimizat
ion\%20is\%20a\%20global,evaluated\%20on\%20a\%20validation\%20set

[58] W. Liu, H. S. Kim, S. Chen, Q. Jie, B. Lv, M. Yao, Z. Ren, C. P. Opeil, S. Wilson, C. W.
Chu, and Z. Ren, “n-type thermoelectric material mg2sn0.75ge0.25 for high power gener-
ation,” Proceedings of the National Academy of Sciences of the United States of America,
vol. 112, 2015.

55
Appendix A

Project Brief

Student Name: Chotiya Mahittigul


Project Title: Forward Modelling of Thermoelectric Generators via Artificial Neural Network
Supervisor Name: Ruomeng Huang
Agreed Project Description:

Climate change is one of the biggest problems in the 21st century, and when left unattended
it can lead to droughts, heatwaves, melting glaciers, rising sea levels, which will adversely affect
humans, animals, and even plants. The biggest cause of climate change is greenhouse gases
trapped in the atmosphere which absorbs the infrared radiation from the sun and warms up
the surface of the Earth. The largest sources of greenhouse gases comes from burning fossil
fuel, coal, and oil for electricity, transportation, and heat. Although these natural resources
are abundant in nature, they are also limited in availability and their by-product is detrimental
to the planet. Renewable energy, or sustainable energy, is a form of energy which is infinitely
available for generation as it is naturally replenished, and in most cases does not come with
consequences for the environment. In recent times, the research into renewable energy has been
growing at an astronomical rate, the main sources coming from solar, hydro, and wind energy.
However, there are other renewable energy generation methods that are less known to the
world and are underdeveloped in terms of research, one of those methods being thermoelectric
generators (TEG). This project will be investigating deeper into thermoelectric generators, more
specifically forward modelling TEG, in hope of contributing to the current research within the
field. Forward modelling is important because it is used to simulate and predict an outcome
based on input parameters, and these predictions could inform researchers and industry people
of more efficient ways of building TEGs, improving the contribution of renewable energy sources
to the global energy usage.

To forward model TEG, there are 3 possible methods: an analytical model, finite element
method (FEM) using COMSOL Multiphysics (simulation software for finite element analysis),
and lastly using machine learning via artificial neural network (ANN). The analytical model
method is usually computationally fast, but not very accurate as it requires a lot of assumptions.
The FEM is accurate, but can be computationally slow because the simulations would become
computationally expensive as the number of simulations increase. To achieve a compromise
between the analytical model and the FEM, ANN can be utilized to forward model the TEG
as it can be both accurate and highly efficient in terms of computational time. For an ANN to
work, it needs a dataset to train the network, therefore COMSOL will be used to model TEG
and produce an output dataset for given input parameters. The outputs monitored are power,
efficiency, and voltage. The main variable for the inputs will be the geometry of the TEG,
specifically the leg width, leg height, and fill factor of the p-type and n-type materials at the

56
top contacts and bottom contacts which will be varied in COMSOL to replicate and simulate
asymmetric TEG. The inputs will be simulated repeatedly in different operating parameters
such as different heat flux and contact resistance. A fixed material selection will be used for the
components of the TEG. The hyperparameters of the ANN need to be optimized for the network
in order to increase the accuracy, and the accuracy of the ANN needs to be evaluated using a
test set. With the TEG network, it is possible to perform analytical studies in an accurate and
computationally efficient manner.

57
Appendix B

Additional Information

B.1 Semiconductors
Materials that are neither good conductors, such as metals, or insulators, such as ceramic,
are known as semiconductors. Some examples of these materials are silicon and germanium
etc. Semiconductors have a crystalline structure and the movement of free electrons and holes,
which represents the absence of an electron, within the structure causes current conduction[B1].
Semiconductors can be mixed with impurities, a process called doping, to control the conductiv-
ity of the material. A pure semiconductor, one which has not been doped, is called an intrinsic
semiconductor, and a semiconductor which has been doped with other elements is called an
extrinsic semiconductor. A semiconductor which is doped mainly with free electrons is called
a N-type semiconductor, and one which is doped mainly with free holes is called a P-type
semiconductor[B1].

B.2 Thermocouples
Figure B.1 shows a thermocouple which is being used as a temperature sensor based on voltage
gain. The wires are of different materials (N-type and P-type), and the wires are connected
at the hot junction and not connected at the cold junction. Connecting the hot side of the
2 different types of wires is essentially creating a circuit where electrons flow from the P-type
semiconductor into the N-type semiconductor, and this electron flow creates electricity. The
difference in voltage of the 2 cold junctions as seen in figure B.1 can be read by a volt meter
and can be used for sensing the temperature of the hot side by using equation 2.1.

Figure B.1: Thermocouple used to sense temperature based on voltage gain[B2]

58
Besides sensing temperature, a thermocouple can be used in a thermoelectric generator
(TEG) to generate electricity. This will be explored more in depth in the next section.

B.3 Conditions for good performing TEG


For a good performance of a TEG, the TE legs need to be a ”good” heat insulator so that the
temperature gradient does not change fast, and it needs to be a ”good” electric conductor so
that the electrons and holes can flow more freely. The insulator layers also need to be a ”good”
heat conductor so that the TE legs can get the highest temperature difference, and it needs
to be a ”good” electric insulator so that the full circuit does not get destroyed. The spaces in
between the TCs need to be a ”good” heat insulator so that the temperature gradient does not
dissipate fast, and it also needs to be a ”good” electric insulator so that the electrons and holes
only diffuse through the TE legs. The electrodes, which are the metal contacts, need to be a
”good” conductor in order to reduce the internal resistance of the TEG as much as possible.

B.4 Efficiency of TEG


A simple derivation can be carried out to find the figure of merit for TEGs, which allows for
an evaluation of the quality of a TEG. Efficiency is the work done over the net thermal energy,
which can be written as the output power over the input power as seen in equation B.1.
W Pout
η= = (B.1)
Q Pin
The maximum output power was given in equation 2.17, and the input power is essentially
the thermal conductivity multiplied by the area and change in temperature divided by the
length of the device. These values are substitute into equation B.1 to get equation B.2
V2
4·RT EG V2 L
.η = κ·A·∆T = · (B.2)
L
4 · RT EG κ · A · ∆T

V is given by equation 2.1, and RT EG is given by equation 2.3, so substituting those values gives
equation B.3.
S 2 · ∆T 2 · σ · A L S2 · σ
η= · = · ∆T (B.3)
4·L κ · A · ∆T 4·κ

The Seebeck coefficient, electrical conductivity, and thermal conductivity can be set as Z,
giving equation B.5. The value of Z is the figure of merit that can determine the quality factor
of a material. Equation B.5 can also be used to find the efficiency based on the Z value. However,
this equation only holds true for Z << 1, and that is because the Peltier effect was not taken
into consideration in the simple derivation (the Peltier effect will not be investigated further in
this report).
S2 · σ
Z= (B.4)
κ
Z ∆T ZT
η= · ∆T = · (B.5)
4 T 4

59
The ZT value can be seen in equation 2.6, where S is the Seebeck coefficient, σ is the electrical
conductivity, κ is the thermal conductivity, and T is the temperature. As the figure of merit
is dependent on the temperature, ZT is used as the dimensionless figure of merit. A higher
Seebeck coefficient value, a higher electrical conductivity, and a lower thermal conductivity of
the TE material gives a higher ZT value and increases the performance of a TEG. When the
electrical conductivity is higher, the electrical resistance is lower as seen in equation 2.3 and the
electrons and holes will be able to flow more freely through the TEG which increases power.
When the thermal conductivity is lower, the thermal resistance is higher as seen in equation 2.4
and the TE legs will maintain a higher temperature difference between the hot side and cold
side of a TEG. This increases the value of ∆T , which increases the Seebeck voltage[12].

S2 · σ
ZT = ·T (B.6)
κ

B.5 COMSOL: Power and Voltage vs Load Resistor


To find the Power and Voltage vs Load Resistor, probes are needed. 3 Global variable probes
were used to monitor the power, voltage, and temperature of the TEG as seen in figure B.2.
The “Expression” needs to be correct for the probe.

(a) Power Probe (b) Voltage Probe

(c) Temperature Probe

Figure B.2: Global Variable Probes: (a) Power, (a) Voltage, (a) Temperature

An example of the Power and Voltage vs Load resistance for different simulations can be seen
in figure B.3. The load resistance does a sweep, and the voltage and power values are captured
by the probes.

60
Figure B.3: Example of Power and Voltage vs Resistance Graph in COMSOL

B.6 Appendix Bibliography


[B1] M. A. Rahman, “A review on semiconductors including applications and temperature ef-
fects in semiconductors,” American Scientific Research Journal for Engineering, Technology,
and Sciences (ASRJETS) ISSN (Print), vol. 7, 2014.

[B2] O. Engineering, “Thermocouple probes,” Dec 2021. [Online]. Available: https://www.


omega.com/en-us/resources/thermocouple-hub

61
Appendix C

Project Archive Guide

There are 9 files in the project archive and they are as follows

• IP COMSOL (Contains all final COMSOL files used in project)

• IP Excel Files (Contains all Excel files used for ANN and plotting for report)

• IP Material Data (Contains material data for the P and N-type TE legs in the report)

• IP MATLAB (Contains MATLAB file to automatically find the maximum power)

• IP Notes (Contains handwritten notes and calculations made during project)

• IP Origin (Contains all graphs made in Origin)

• IP output text and excel (Contains all COMSOL outputs in text files and Excel files)

• IP Project Management (Contains weekly powerpoint slide made throughout the project)

• IP Python (Contains all the Python code made during the project)

62

You might also like