Professional Documents
Culture Documents
Report
Report
by
Chotiya Mahittigul
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 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
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
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
iii
Nomenclature
TE Thermoelectric
ML Machine Learning
NN Neural Network
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 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
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)
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
S2 · σ
Z= (2.5)
κ
S2 · σ
ZT = ·T (2.6)
κ
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])
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])
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
∂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:
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].
Vout = N · S · ∆T (2.19)
Figure 2.6: Typical thermoelectric generator: (a) Basic principle, (b) Equivalent electrical circuit.
(Reproduced from N.Jaziri [12])
10
2.3 Modellers for TEGs
This section covers the existing modellers used for TEGs.
11
2.4 Artificial Neural Network (ANN)
This section will cover the necessary theory to building an Artificial Neural Network (ANN).
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
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]
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].
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.
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].
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.
Figure 2.10: Hyper-parameter tuning using: (a) Random search, (b) Grid search, (c) Bayesian
optimization [57]
16
Chapter 3
Methods
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.
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◦ .
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.
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 ).
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
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
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
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.
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.
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.
25
3.4 Artificial Neural Network
This section covers the method used to build an 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.
Hyper-parameter Range
Learning Rate 1e-5 – 1e-1
Number of Hidden Layers 1–5
Number of Neurons 100 – 700
27
Figure 3.13: Hyper-parameters and Neural Network Model
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.
|predicted − true|
Errorrelative = (3.13)
true
29
Figure 3.16: Early Stopping
30
Figure 3.18: Optuna Hyper-parameter Tuning
31
Chapter 4
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.
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
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.
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.
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
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.
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.
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.
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
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
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].
Figure 4.13: Maximum Power Density vs Thermal Contact Layer Thickness for different values of
height, width, ratio
S 2 · Q2in · HT E 1
P = · (4.8)
4 · κ2 · A′ ρ
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.
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.
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.
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.
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
COMSOL Multiphysics
MATLAB/Python
Results/Report Writing
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
[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.
[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.
[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.
[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.
[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.
[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.
[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
[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.
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
[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
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.
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.
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)
κ
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
61
Appendix C
There are 9 files in the project archive and they are as follows
• 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 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