You are on page 1of 71

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

net/publication/319135704

NUMERICAL SOLUTION FOR HEAT EQUATION

Thesis · April 2009


DOI: 10.13140/RG.2.2.12082.50882

CITATION READS

1 32,958

1 author:

Anis Zafirah Azmi


Universiti Teknologi MARA
12 PUBLICATIONS 35 CITATIONS

SEE PROFILE

All content following this page was uploaded by Anis Zafirah Azmi on 16 August 2017.

The user has requested enhancement of the downloaded file.


NUMERICAL SOLUTION FOR HEAT EQUATION

ANIS ZAFIRAH BTE AZMI

This thesis is presented to accomplish part of the regulations of the certification of


the Bachelor of Science (Industrial Mathematics)

FACULTY OF SCIENCE
UNIVERSITI TEKNOLOGI MALAYSIA

APRIL 2009
ii

“I declare that I have read through this thesis and according to my opinion this
thesis is appropriate in its scope and quality for the purpose of the certification
of Bachelor of Science (Industrial Mathematics)”.

Signature : ....................................................

Supervisor : PM Hjh Hazimah Abdul Hamid

Date : April 2009


iii

I declare that this thesis entitle “Numerical Solution for Heat Equation” is a
result of my own research except as cited in the reference. The thesis has not
been accepted for any degree and is not concurrently submitted in candidature
of any other degree.

Signature : ……………………………………….

Name : Anis Zafirah bte Azmi

Date : April 2009


iv

To my beloved parents

Love you all …


v

ACKNOWLEDGEMENT

Foremost, I would like to express sincere gratitude to my supervisor, PM Hjh


Hazimah Abdul Hamid, who always gives useful advices and guides me along my
final year project. I also like to thank her upon her thoughtful and constructive
criticism that leads me to achieve the objectives of my research.

Particular thanks, of course, to a number of friends who support me and lend


their ears to me when I was upset. They bring a colorful and joyful campus life to
me. I also wish to thank my parents for giving their care and support to me all the
time. For Ihzam too, thank you for being with me all the time no matter what I feel.
Without their support, I would not have today’s achievements.

Last but not least, I wish to express my gratitude to Universiti Teknologi


Malaysia (UTM) for providing chances and preparing all the resources for students
in doing our researches.
vi

ABSTRACT

The heat equation is of fundamental importance in diverse scientific fields.


Heat is a form of energy that exists in any material. For example, the temperature in
an object changes with time and the position within the object. Furthermore, this
equation can be applied in solving the heat flow that is related in science and
engineering. To solve the problem which involve heat equation in science or
engineering fields we can use the numerical method. The accuracy in using
numerical method is more reliable rather than using other method. Besides, maple
programming will be used to solve the solution and graph the equation clearly. Other
than that, the heat model will be discussed in this research. Some examples of the
heat question will be solved too.
vii

ABSTRAK

Persamaan haba adalah salah satu persamaan yang penting dalam dunia sains.
Haba wujud dalam semua benda. Contohnya, suhu bagi sesuatu objek berubah
mengikut masa dan tempat bergantung kepada objek itu. Selain itu, persamaan ini
boleh digunakan untuk menyelesaikan urutan haba yang wujud dalam bidang sains
dan kejuruteraan. Bagi menyelesaikan masalah yang melibatkan persamaan haba,
kaedah berangka adalah salah satu cara penyelesaian. Ini kerana penyelesaian
menggunakan kaedah berangka mempunyai kejituan yang lebih tinggi berbanding
cara penyelesaian yang lain. Program Maple akan digunakan bagi mendapatkan graf
untuk masalah haba dan jawapan yang lebih tepat dan cepat. Model unuk masalah
haba juga akan dibincangkan di dalam kajian. Contoh bagi soalan persamaan haba
turut disertakan dan diselesaikan bagi memudahkan pemahaman pembaca.
viii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

SUPERVISOR’S DECLARATION ii
DECLARATION iii
DEDICATION iv
ACKNOWLEDGEMENT v
ABSTRACT vi
ABSTRAK vii
TABLE OF CONTENTS viii
LIST OF TABLES x
LIST OF FIGURES xi

1 INTRODUCTION 1
1.1 Introduction 1
1.2 Statement of the Problem 3
1.3 Objectives of the Study 3
1.4 Scope of the Study 4
1.5 Significance of the Study 4

2 LITERATURE REVIEW 5
2.1 General Information about the Heat Equation 5
2.2 Heat Transfer 7
2.2.1 Importance of Heat Transfer 7
2.2.2 Heat Transfer Modes 9
2.2.3 The Laws of Heat Transfer 10
ix

3 HEAT EQUATION 14
3.1 Introduction 14
3.2 History of Calculus 15
3.3 Differential and Integral Calculus 16
3.4 Model of Heat Equation 18
3.4.1 The Inhomogeneous heat Equation 22
3.4.1.1 Subscript Notation for Derivatives 23
3.4.1.2 Initial Condition 23
3.4.1.3 Types of Boundary Conditions 24
3.4.1.4 Initial/ Boundary Value Problems 25

4 SOLVING HEAT EQUATION 26


4.1 Introduction 26
4.2 Explicit Method 27
4.3 Implicit Method 39
4.4 Two Dimensional Parabolic Equation 52

5 CONCLUSION AND RECOMMENDATIONS 54


5.1 Introduction 54
5.2 Conclusion 54
5.3 Recommendations 57

REFERENCES 58
x

LIST OF TABLE

TABLE NO. TITLE PAGE

2.1 Typical Values of Thermal Conductivity of Some 10


Materials in W/Mk at 200c

2.2 Typical Values Heat Transfer Coefficient in 11


W/M2k

5.1 Advantages and Disadvantages of Numerical 56


Methods
xi

LIST OF FIGURES

FIGURE NO. TITLE PAGE

3.1 Thin Rod with L Length 19

4.1 Molecule Diagram of Explicit Method 28

4.2 Molecule Diagram of Explicit Method for 32


Example 4.2

4.3 Molecule Model for Crank Nicolson Method 40


with r=1

4.4 Heat Equation for Two Dimensional 52


CHAPTER 1

INTRODUCTION

1.1 Introduction

Everyday people will learn and use mathematic since it is very useful in all time
and situation in our daily activities. Mathematic is a well wide subjects of itself. In
fact, engineering, physics, chemistry and other fields apply mathematic to show and
solve their problems. It shows that mathematics plays the role of producing the
model or solution for this entire field.

In primary school, students will learn the basic of differential and integration
since the subjects will be useful for the further subjects. A long time ago, the Greek
mathematicians had already known the concept of tangent to the curve and other
arcs. Unfortunately, before the 17th century there were no particular procedures to
find a tangent to the curve at a given point.
2

To solve this problem, Sir Isaac Newton (1642 – 1727) had used the same
method independently develop by Pierre de Fermat (1601 -1665). These approaches
give the definition of derivative.

Differential equation is an equation involving derivative of an unknown


function of one or more variables. There are two topic always be discuss in
differential equation which are ordinary differential equation that depends on only
one variable and partial differential equation which depends on more than one
variables.

Partial differential equations are important in many branches of science and


engineering because there are always more than one independent variables involve in
physical problem. The applications of the subject are many, and the types of
equations that arise have a great deal of variety. There are very few partial
differential equations that can be solved, mostly linear equation and some nonlinear
equation. The order of the partial differential equations is the order of the highest
derivative occurring in the equations. If a function u(x,y) satisfies the equation, then
it is the solution for the partial differential equation.

The heat equation is of fundamental importance in diverse scientific fields. In


mathematics, it is the prototypical parabolic partial differential equation. The
diffusion equation, a more general version of the heat equation, arises in connection
with the study of chemical diffusion and other related processes. It also describes the
distribution of heat (or variation in temperature) in a given region over time. The
numerical solution methods for the parabolic partial differential equations are
important in such fields as molecular diffusion, heat transfer, nuclear reactor
analysis, and fluid flow.
3

1.2 Statement of the Problem

Basically, this heat equation is always applied in the heat flow. Based on the
problem given, it is important to derive the problem and get the model of heat
equation with the boundary and initial conditions correctly. Then, the solution for the
equation can be done by using analytical mathematic methods such as separation of
variable, D-Alembert Method, or other. To make the solution become faster and
more accuracy, we use numerical methods which are explicit method and implicit
method or Crank – Nicolson method. In industry and real world, the problem will
consisted more than two variables. It is not easy to solve the problem using
calculation so to get the solution faster and more accurate we can use mathematical
software. In this research, I use Maple programming since the program more easily
to generate the codes.

1.3 Objectives of the Study

The research objectives are:


i. To develop an understanding of the concept and application of the partial
differential equation to derive the heat equation.
ii. To analyze the problem and solve the heat equation using numerical methods.
iii. To be able to implement numerical methods for the solution of heat equation
arises in the science and engineering field
4

1.4 Scope of the Study

This research is all about the heat equation that will be derive in the partial
differential equation. Then, this unsteady state equation will be solving using
numerical methods which are explicit method and implicit Crank-Nicolson method. I
will also use Maple programming to solve the heat equation.

1.5 Significance of the Study

Heat is a form of energy that exists in any material. For example, the
temperature in an object changes with time and the position within the object.
Furthermore, this equation can be applied in solving the heat flow that related in
science and engineering. The accuracy in using numerical method is more reliable
rather than using other method. We also can use the Maple programming to help us
get the answer as faster as the calculation. Besides, I also can gain more knowledge
and understand more about the heat equation and know how they get the unsteady
state equation that people use in their day life especially for those in science and
engineering fields.
5

CHAPTER 2

LITERATURE REVIEW

2.1 General Information about the Heat Equation

The heat equation is of fundamental importance in diverse scientific fields. In


mathematics, it is the prototypical parabolic partial differential equation. The
diffusion equation, a more general version of the heat equation, arises in connection
with the study of chemical diffusion and other related processes. It also describes the
distribution of heat (or variation in temperature) in a given region over time. The
equation for the heat equation for a function u, variable x and variable t, is as follow:
𝜕 𝜕
𝜕
= 𝜕

where c is a constant thermal conductivity with


boundary conditions : u(0,t) = 0, u(l,t) = 0,

initial condition : u(x,0) = f(x).


6

The heat equation is used to determine the change over time as heat spreads
throughout space. We need to determine the change in the function u over time. It
can be predicts that if a hot body is placed in a box of cold water, the temperature of
the body will decrease and after the past few time the temperature in the box will
equalize. One of the interesting properties of the heat equation is the maximum
principle which says that the maximum value of u is either earlier in time than the
region of concern or on the edge of the region of concern. This is essentially saying
that temperature comes either from some source or from earlier in time because heat
permeates but is not created from nothingness. This is a property of parabolic partial
differential equations.

The heat equation can be solving by many methods. In partial differential


equation, there is the easy way to solve the equation which is by using separable
method. The equation will be separate and put them with their same variable. Easy to
solve using separable method since it only need to know and apply integrating factor
and some derivative factor to get the exact solution. This solution also needs to apply
series solution to find un. This method is directly solution and just need knowledge
about differential equation and calculus since it will be apply in this solution.

For numerical method, Crank- Nicolson method can be use to solve the heat
equation. Crank-Nicolson method is invented by John Crank (1961) and Phyllis
Nicolson (1917-1968) based on numerical approximations for solutions at the point

u (x,t + ) that lies between the rows in the grid. Specifically, the approximation

used for ut (x,t + ) is obtained from the central- difference formula,

, + − ,
ut (x,t + ) = + 0 (k2) .
7

2.2 Heat Transfer

2.2.1 Importance of Heat Transfer

Heat transfer is fundamental importance in many branches of engineering. A


mechanical engineer may be interested in study the mechanism of heat transfers
involved in the operation of equipment, example boilers, condensers, air pre-heaters,
economizers, and so on, in a thermal power plant in order to improve their
performance. In designing the nuclear power it is important to precise information on
heat transfers, as safe operation. Besides, in our daily also apply the heat transfers.
Refrigeration and air-conditioning system involve heat exchanging devices, which
needs are careful design. For electrical engineers, they are enthusiastic to avoid
material damage due to hot sports, develop by improper heat transfer design, in
electric motors, generators and transformers. An electronic engineer is interested in
knowing the efficient method of heat dissipation from chips and semiconductor
devices so that they can operate within safe operating temperatures.

For a computer hardware engineer, they are interested in knowing the cooling
requirements of circuit boards, as the miniaturization of computing devices is
advancing at a rapid rate. Chemical engineers are interested in heat transfers process
in various chemical reactions. A metallurgical engineer would be interested in
knowing the rate of heat transfer required for a particular heat treatment process, for
example, the rate of cooling in a casting process has a profound influence on the
quality of the final product. Aeronautical engineers are interested in knowing the heat
transfer rate in rocket nozzles and in heat shields used in re-entry vehicles. An
agricultural engineer would be interested in the drying of food grains, food
processing and preservation. A civil engineer would need to be aware of the thermal
stresses develop in quick-setting concrete, the effect of heat and mass transfers on
building and building materials and also the effect of heat on nuclear containment,
and more. For an environmental engineer is concerned with the effect of heat on the
dispersion of pollutants in air, diffusion of pollutants in soils, thermal pollution in
lake and seas and their impact in our life. The global, thermal changes and associated
8

problems caused by El Nino are very well known phenomena, in which energy
transfers in the form of heat exists.

The solar system and the associated energy transfers are the principal factors
for existence of life on earth. It is true to say that it is extremely difficult, often
impossible, to avoid some form of heat transfer in any process on earth.

The study of heat transfers provides economical and efficient solutions for
critical problems encountered in many engineering items of equipment. For example,
let’s consider the development of heat pipes that can transport heat at a much greater
rate than copper or silver rods of the same dimensions, even at almost isothermal
conditions. The development of present day gas turbine blades, in which the gas
temperature exceeds the melting point of the material of the blade, is possible by
provide efficient cooling systems and it is another example of the success of heat
transfer design methods.

The design of computer chips, which encounter heat flux of the order
occurring in re-entry vehicles, especially when the surface temperature of the chips is
limited to less than 1000C, is again a success story for heat transfers analysis.
Although there are many successful heat transfer designs, further developments are
still necessary in order to increase the life span and efficiency of the many devices
discussed previously, which can lead to many more new inventions. Also, if we are
to protect our environment, it is essential to understand the many heat transfer
processes involved and, if necessary, to take appropriate action.
9

2.2.2 Heat Transfer Modes

Heat transfer is that section of engineering science the energy transport


between material bodies due to a temperature difference. The three modes of heat
transfer are conduction, convection and radiation.

The conduction mode of heat transport occurs either because of an exchange


of energy from one molecule to another, without the actual motion of the molecules,
or because of the motion of the free electrons if they are present. Therefore, this form
of heat transport depends heavily on the properties of the medium and takes place in
solids, liquids and gases if a difference in temperature exists.

Molecules present in liquids and gases have freedom of motion, and by


moving from a hot to a cold region, they carry energy with them. The transfer of heat
from one region to another region, due to such macroscopic motion in a liquid or gas,
added to the energy transfer by conduction within the fluid is called heat transfer by
convection. Convection may be free, forced or mixed. When fluid motion occurs
because of a density variation caused by temperature differences, the situation is said
to be a free, or natural, convection. When the fluid motion is caused by an external
force, such as pumping or blowing, the state is defined as being one of forced
convection. A mixed convection state is one in which both natural and forced
convection is present. Convection heat transfer also occurs in boiling and
condensation processes.

All bodies emit thermal radiation at all temperatures. This is the only mode
that does not require a material medium for heat transfers to be occurring. The nature
of thermal radiation is such that a propagation of energy, carried by electromagnetic
waves, is emitted from the surface of the body. When these electromagnetic waves
strike other body surface, a part is reflected, a part is transmitted and the remaining
part is absorbed.
10

All modes of heat transfer are generally present in varying degrees in a real
physical problem. The important aspects in solving heat transfer problems are
identifying the significant modes and deciding whether the heat transferred by other
modes can be neglected.

2.2.3 The Laws of Heat Transfer

Important to identifying the amount of energy being transferred per unit time
and for that we require the use of rate equations. For heat conduction, the rate
equation is known as Fourier’s law, which is expressed for one dimension as

qx = - k

where qx is the heat flux in the x direction (W/m2), k is the thermal conductivity
(W/mk), a property of material and dT/dx is the temperature gradient (K/m).

Table 2.1 Typical Values of Thermal Conductivity of Some Materials in W/mK


at 200C

MATERIAL THERMAL
CONDUCTIVITY
Metals:
Pure silver 410
Pure copper 385
Pure aluminium 200
Pure iron 73

Alloys:
Stainless steel (18% Cr, 8% Ni) 16
Aluminium alloy (4.5% Cr) 168
11

Non metals:
Plastics 0.6
Wood 0.2

Liquid:
Water 0.6

Gases:
Dry air 0.025 (at atmospheric
pressure)

For convective heat transfer, the rate equation is given by Newton’s law of cooling as
q = h (Tw - Ta)

where q is the convective heat flux (W/m2), (Tw - Ta) is the temperature difference
between the wall and the fluid and h is the convection heat transfer
coefficient(W/m2K).

Table 2.2 Typical Values of Heat Transfer Coefficient in W/m2K.

MATERIAL COEFFICIENT
Gases (stagnant) 15
Gases (flowing) 15-250
Liquids (stagnant) 100
Liquids (flowing) 100-2000
Boiling liquids 2000-35,000
Condensing vapors 2000-25,000
12

The convection heat transfer coefficient frequently appears as a boundary


condition in the solution of heat conduction through solids. Assume h to be known in
many such problems. In the analysis of thermal systems, one can again assume an
appropriate h if not available (e.g., heat exchangers, combustion chambers, etc.).
However, if required, h can be determined via suitable experiments, although this is a
difficult option.

The maximum flux that can be emitted by radiation from a black surface is given by
the Stefan-Boltzmann Law, that is

q = σ TW4

where q is the radiative heat flux, (W/m2), σ is the Stefan-Boltzmann constant


(5.669* 10-8), in W/m2K4 and Tw is the surface temperature, (K).

The heat flux emitted by a real surface is less than that of a black surface and is give
by

q = Є σ TW4

where Є is the radiative property of the surface and referred as the emissivity.

The net radiant energy exchange between any two surfaces 1 and 2 is given by
Q = FЄ FG σ A1 (T14 - T14)

where FЄ is a factor that takes into account the nature of the two radiating surfaces,
FG is a factor that takes into account the geometric orientation of the two radiating
surfaces and A1 is the area of surface 1.

When a heat transfer surface, at temperature T1, is completely enclosed by a


much larger surface at temperature T2, the net radiant exchange can be calculated by

Q = q A1 = Є1 σ A1 (T14 - T14).
13

With respect to the laws of thermodynamics, only the first law is of interest in heat
transfer problem. The increase of energy in a system is equal to the difference
between the energy transfer by heat to the system and the energy transfer by work
done on the surrounding by the system, that is

dE = dQ - dW

where Q is the total heat entering the system and W is the work done on the
surrounding. Since we are interested in the rate of energy transfer in heat transfer
processes, we can restate the first law of thermodynamics as

“The rate of increase of the energy of the system is equal to the difference
between the rate at which energy enters the system and the rate at which the system
does work on the surrounding”, that is
𝐸 𝑄 𝑊
= −

where t is the time.


14

CHAPTER 3

HEAT EQUATION

3.1 Introduction

Calculus is a branch of mathematics that includes the study of limits,


derivatives, integrals, and infinite series and it is important for a modern university
education since it relates with other subject such as physic and engineering.
Historically, it has been referred to as the calculus of infinitesimals or infinitesimal
calculus. Basically, calculus is the study of change. In more advanced mathematics,
calculus is usually called analysis and defined as the study of functions. Calculus has
usually use and apply in science and engineering and use to solve problems. Calculus
builds on algebra, trigonometry, and analytic geometry and includes two major
branches which are differential calculus and integral calculus, that are related by the
fundamental theorem of calculus.

Applications of differential calculus include the computations involving


velocity and acceleration, the slope of a curve and optimization. Applications of
integral calculus include computations involving area, volume, arc length, center of
15

mass, work and pressure. More advanced applications include power series and
Fourier series. Calculus is also used to gain a more precise understanding of the
nature of space, time, and motion. For centuries, mathematicians and philosophers
wrestled with paradoxes involving division by zero or sums of infinitely many
numbers. These questions arise in the study of motion and area. The ancient Greek
philosopher Zeno gave several famous examples of such paradoxes. Calculus
provides tools, especially the limit and the infinite series, which resolve the paradox.

3.2 History of Calculus

The history of calculus falls into several distinct time periods, most in the
ancient, medieval and modern periods. The ancient period introduced some of the
ideas of integral calculus but unfortunately it not developed well in that time.
Calculating volumes and areas which is the basic function of integral calculus is
come from the Egyptian Moscow Papyrus(1800 BC), in which an Egyptian
successfully calculated the volume of a pyramid frustum.

From the school of Greek mathematics, Eudoxus(c. 408-355 BC) used the
method of exhaustion, which prefigures the concept of the limit, to calculate areas
and volumes while Archimedes(c. 287-212 BC) develop this idea further, inventing
heuristics which resemble integral calculus. In the 3rd century AD China was used
the method of exhaustion to find the area of a circle. It was also used in 5th century
AD to find the volume of sphere.

Around AD 1000, the Islamic mathematician, Ibn Al-Haytham, was the first
derived the formula of the sum of the fourth powers of an arithmetic progression,
using a method that is readily generalize to finding the formula for the sum of any
higher integral powers, which can be used to perform an integration. In the 12th
century, the Indian mathematician, Bhaskara II, develop an early derivatives
16

representing infinite change and he described an early form of Rolle’s theorem. The
Persian mathematician discovered the derivative of cubic polynomials, an important
result in differential calculus. In the 14th century, Madhava of Sangamagrama, along
with other mathematician-astronomers of the Kerala school of astronomy and
mathematics, described special cases of Taylor series.

In the modern period, in early 17th century, mathematician in Japan was


expand the method of exhaustion. Calculus provided a new opportunity in
mathematical physic to solve long standing problems. Several mathematicians
contributed to these breakthroughs, notably John Wallis and Isaac Barrow. James
Gregory proved a special case of the second fundamental theorem of calculus in
AD1668. Leibniz and Newton pulled ideas together into a coherent whole and they
are usually credited with the independent and nearly simultaneous invention of
calculus. Newton was the first to apply calculus to general physics problem and
Leibniz develop much of the notation used in calculus today. The basic insight that
both Newton and Leibniz had was the fundamental theorem of calculus.

3.3 Differential and Integral Calculus

Differential calculus as introduced by Sir Isaac Newton and Gottfried


Wilhelm Leibniz in the late 17th century opened up a wealth of new possibilities for
mathematical modeling in the natural and later on in the life sciences and in
technology. It is the study of the definition, properties, and applications of the
derivatives or slope of a function. The process of finding the derivatives is called
differentiation. In technical language, the derivative is a linear operator, which input
a function and outputs a second function, so that at every point the value of the
output is the slope of the input. In mathematical notation, one common symbol for
17

the derivative of a function is an apostrophe-like mark called prime. Thus the


derivative of f is f′ which said as “f prime”.

Integral calculus is the study of the definition, properties and applications of


two related concepts, the indefinite integral and the definite integral. The process o
finding the value of an integral is called integration. In technical language, integral
calculus studies two related linear operator too. The indefinite integral is the
antiderivative, the inverse operation to the derivative. F is an indefinite integral of f
when f is a derivative of F. the definite integral inputs a function and outputs a
number, which gives the area between the graph of the input and the x-axis. The
technical definition of the definite integral is the limit of a sum of areas of rectangles,
called a Riemann sum.

The sum of integration is∫ , an elongated S (which stands for sum). The
definite integral is written as

∫ 𝑓

and read as “the integral from a to b of f-of-x with respect to x”. The indefinite
integral or antiderivatives is written as

∫𝑓 .

The fundamental theorem of calculus states that differentiation and integration are
inverse operations. If a function f is continuous on the interval [a,b] and if F is a
function whose derivatives is f on the interval (a,b), then

∫ 𝑓 =𝐹 − 𝐹 .
18

Furthermore, for every x in the interval (a,b),

∫ 𝑓 =𝑓 .

3.4 Model of Heat Equation

Heat is a form of energy that exists in any material. Like any other form of
energy, heat is measured in joules (1 J = 1 Nm). However, it is also measured in
calories (1 cal = 4.184 J).

The amount of heat within a given volume is defined only up to an additive


constant. It can be assume that the amount of heat is equal to 0 when the temperature
is equal to 0. Suppose that ∆𝑉 is a small volume in which the temperature u is
almost constant. It has been found experimentally that the amount of heat ∆ in ∆𝑉
is proportional to the temperature u and to the mass ∆ = 𝜌∆𝑉 , where 𝜌 is the mass
density of the material. Thus the amount of heat in ∆𝑉 is given by

∆ = 𝜌 ∆𝑉 (3.1)

The new constant c is called the specific heat. It measures the amount of heat
required to raise 1 unit of mass of the material 1 degree of temperature.

Let’s consider a thin rod that is insulated along its length, as seen in Figure
3.1. If the length of the rod is L, the position along the road is given by x, where ≤
≤ 𝐿. Since the road is insulated, there is no transfer of the heat from the rod except
at its two ends.
19

Therefore, we can assume that the temperature u depends only on x and on the time t.

0 L

Figure 3.1 Thin Rod with L length

Consider a small section of the rod between x and x+∆ . Let S be the cross
sectional are of the rod. The volume of the section is S∆ , so (3.1) becomes

∆ = 𝜌 S∆

Therefore, the amount of heat at time t in the portion U of the rod defined by ≤
≤ is given by the integral

Q(t) = ∫ 𝜌 , . (3.2)

The heat equation models the flow of heat through the material. Using differentiation
then the time rate of change of Q is

= ∫ 𝜌

If the specific heat and the density do not vary with time, this becomes

𝑄 𝜕
= ∫ 𝜌 (3.3)
𝜕

Another way to compute the time rate of change of Q is to notice that, in the absence
of heat sources within the rod, the quantity of heat in U can change only through the
flow of heat across the boundaries of U at x = a and x = b. Let consider the section
of the rod between x = a and a+∆ .
20

Experimental study of heat conduction reveals that the flow of heat across such a
section has the following properties:

 Heat flows from hot positions to cold positions at a rate proportional to the
difference in the temperatures on the two sides of the section. Thus the rate of
flow through the section is proportional to u(a+∆ , ) – u(a,t).
 The rate of flow through the section is inversely proportional to ∆ , the width
of the section.
 The rate of flow through the section is proportional to the area of S of the
boundary of the section.

Putting this three points together, we see that there is a constant C such that the rate
of flow of heat into U at x = a is given approximately by

+∆ , – ,
-CS (3.4)

The constant C is called the thermal conductivity. It is positive since, if u(a+∆ , ) >
u(a,t), then the temperature is hotter inside U than it is outside, and the heat flows out
of U at x = a.

If we let ∆ is approaching to 0 in (3.4), the difference quotient


𝜕
approaches , and it can see that the rate of flow into U at x = a is approximately
𝜕

𝜕
-CS , (3.5)
𝜕

The same argument at x =b shows that the rate of flow of heat into U across the
boundary at x= b is approximately

𝜕
-CS , .
𝜕
21

The total time rate of change of Q is the sum of the rates at the two ends. Using the
fundamental theorem of calculus, this is

𝑄 𝜕 𝜕 𝜕 𝜕
= CS [
𝜕
, −
𝜕
, ]= ∫
𝜕
𝐶𝜕 (3.6)

If the thermal conductivity is a constant, this becomes

𝑄 𝜕
= CS∫ (3.7)
𝜕

There are two formulas for the rate of heat of flow into U which is equation
(3.3) and (3.7). Setting them equal will get equation as below

𝜕 𝜕 𝜕 𝜕
∫ 𝜌 = C∫ or ∫ 𝜌 − = 0.
𝜕 𝜕 𝜕 𝜕

This is true for all a < b, which can be true only if the integrand is equal to 0.

Hence,

𝜕 𝜕
𝜌 − =
𝜕 𝜕

throughout the material. If we divide by c𝜌, and set k = C/ c𝜌, then the equation
becomes

𝜕 𝜕 𝜕 𝜕
− = or = . (3.8)
𝜕 𝜕 𝜕 𝜕

The constant k is called the thermal diffusivity of the material.


22

Equation (3.8) is called the heat equation. It models the flow of heat through
a material and is satisfied by the temperature. A similar derivation shows that the
diffusion of a substance through a liquid or a gas satisfies the same equation. In this
case it is the concentration u that satisfies the equation. For this reason equation (3.6)
is also referred to as the diffusion equation.

3.4.1 The Inhomogeneous Heat Equation

Equation (3.8) was derived under the assumption that there is no source of
heat within the material. If we considered the heat sources, the equation (3.8) can be
modified to accommodate them. For that, equation (3.6) must modify the right-hand
side to account for the internal sources. We will assume that the heat source is spread
throughout the material and that heat is being added at the rate of P(u,x,t) thermal
units per unit length per second.

Notice that we allow the rate of heat inflow to depend on the temperature u as
well as on x and t. An example would be a rod that is not completely insulated along
its length. Then heat would flow into or out of the rod along its length at a rate that is
proportional to the difference between the temperature in U and the ambient
temperature, so P(u,x,t) = [ − ], where T is the ambient temperature. Assuming
there is a source of heat, equation (3.6) becomes

𝑄 𝜕 𝜕
= CS [ , − , ]+=∫ , , dx.
𝜕 𝜕
23

The rest of the derivation is unchanged, and in the end we get the new equation with
variable P and make the equation become inhomogeneous heat equation which is as
follow:

𝜕 𝜕 𝜕 𝜕
𝜌 = + or = + P. (3.9)
𝜕 𝜕 𝜕 𝜕 𝜌

3.4.1.1 Subscript Notation for Derivatives.

It is more useful if we abbreviate the partial derivative by using subscripts to indicate


the variable of differentiation. For example, we can write

𝜕 𝜕 𝜕 𝜕
ux = , uy = 𝜕 , uyx = 𝜕 , and uxx = .
𝜕 𝜕 𝜕

Using this notation, we can write the homogeneous heat equation as

ut = kuxx .

3.4.1.2 Initial Condition

To solve a particular solution, we have to consider the condition given. It can be


initial, boundary or both initial and boundary condition given for the model.
Difference condition will give difference answer since the value is important to the
solution. For ordinary differential equation it easier to solve rather than partial
differential equation since partial got more condition than ordinary.

For example, specifying initial conditions for a temperature requires giving


the temperature at each point in the material at the initial time. In the case of the rod
this means that we give a function f(x) is defined for 0 ≤ x ≤ L and solution to the
heat equation also satisfies

u(x,0) = f(x), for 0 ≤ x ≤ L (3.10)


24

3.4.1.3 Types of Boundary Conditions

In addition to specifying the initial temperature, it will be necessary to specify


conditions on the boundary of the material. Example, the temperature may be fixed at
one endpoint of the rod as the result of the material being set in a source of heat kept
at a constant temperature. There will be a different temperature in the two ends of the
rod. Thus if the temperature at x = 0 is T0 and that at x = L is TL, then the temperature
u(x,t) satisfies

u(0,t) = T0 and u(l,t) = TL for all t. (3.11)

Boundary conditions of the form in (3.1) specifying the value of the temperature at
the boundary are called Dirichlet Conditions.

In other situation one or both ends of the rod might be insulated. This means
that there is no flow of heat into or out of the rod at these points. According to the
discussion leading to equation (3.5), this means that

𝜕
= (3.12)
𝜕

at an insulated point. This type of condition is called Neumann condition. A rod


could satisfy a Dirichlet at one boundary point and a Neumann condition at the other.
There is a third condition that occurs, for example, when one end of the rod is poorly
insulated from the exterior. According to Newton’s law of cooling, the flow of heat
across the insulation is proportional to the difference in the temperature on the two
sides of the insulation.

If this is true at the point x=0, then disagreeing along the same lines as we did in the
derivation of equation (1.5), we see that there is a positive number such that

𝜕
, = , − (3.13)
𝜕
25

where T is the temperature outside the insulation and u is the temperature at the
endpoint x = 0. Poor insulation at the endpoint x = L leads in the same way to a
boundary condition of the form

𝜕
𝐿, = − 𝐿, − (3.14)
𝜕

where > . Boundary conditions in (1.3) and (1.14) are called Robin conditions.

3.4.1.4 Initial/Boundary Value Problems

Put everything together, we can see that the temperature u(x,t) in an insulated rod
with Dirichlet boundary conditions must satisfy the heat equation together with
initial and boundary conditions. Thus, the complete function u(x,t) of the heat
equation is

ut (x,t) = kuxx , for 0 ≤ x ≤ L and t > 0,

u(0,t) = T0, and u(L,t) = TL, for t > 0,

u(x,0) = f(x), for 0 ≤ x ≤ L (3.15)

The function f(x) is the initial temperature distribution. We can replaced the Dirichlet
boundary with Neumann or a Robin condition.
26

CHAPTER 4

SOLVING HEAT EQUATION

4.1 Introduction

Most real mathematical problems do not have analytical solutions. However,


they do have the real answers for each of the problems. To obtain these solutions we
can use other methods such as graphical representations or numerical analysis.
Numerical analysis is the mathematic method that also considers the accuracy of an
approximation. The solution in partial differential equations arising in scientific and
engineering problems is very important to conclude the study of a physical situation.
In case of analytic solution of partial differential equation also, numerical values at
different intervals of variables are required. Therefore numerical solution of a
problem is very useful and important.

In this study, we will use numerical analytical to solve the parabolic partial
differential equations. Heat equation, diffusion problems are examples of parabolic
equations. There are two methods in solving these problems which are explicit
method and implicit method.
27

4.2 Explicit Method

Given the heat equation for One-dimensional,


𝜕 𝜕
= .
𝜕 𝜕

We also can write the equation in other way when (xi,tj) as

𝜕 𝜕 𝜕 , 𝜕 ,
𝜕
, =
𝜕
, or
𝜕
= 𝜕
.

𝜕
Using Forward Difference we can replace the original heat equation which by
𝜕
, + − ,

, where , denotes the temperature in the rod at xi = x0 + i∆ and after the

𝜕 + , − , + − ,
j interval of times tj = j∆ , and replace at xi by , then the
𝜕 ∆

heat equation can be written as

, + − , + , − , + − ,
=
∆ ∆


and let r = ,( ∆ = , ∆ = ℎ , we get

, + − , =𝑟 + , − , + − ,

or

, + =𝑟 − , + − 𝑟 , +𝑟 + ,

for each i = 0,1,2,3,… and j = 0,1,2,3,….


28

1 u i, j+1

k
h
r 1-2r r
u i-1,j u i, j u i+1,j

Figure 4.1 Molecule Diagram of Explicit Method

For stability of the solution equation above, r should satisfy the condition, 0 < r < .
29

Example 4.1 (For Steady State Equation)

A thin circular iron rod AB of 1 cm diameter, 50 cm length with insulated lateral side
is placed along the x-axis with end A (at origin) at 20oC and end B is kept at 100oC
temperature till it reaches steady state condition. Suddenly temperature at end A is
kept 300oC. Find the temperature distribution in the rod at time of intervals before it
reaches steady state condition.
Solution:

u = 300oC 100oC

A B
x=0 50 cm
Heat equation is

𝜕 𝜕
= ,
𝜕 𝜕

where u(x,t) is temperature of road at a distance x from end at A at he time t.

k = thermal conductivity = 0.16 cal/sec cm


c = specific heat = 0.15 cal/goc

𝜌 = 7.5 g/cm3 density.

The initial condition is u(x,0) = 20 + (1.6)x

and boundary condition are u(0,t) = 300o and u(50,t) = 100o.

Let the length 50 cm be divided into 10 equal subintervals, each of length ∆ = 5 cm


and the points of division be denoted by xo = 0 , x1 = 5, x2 = 10, … , x10 = 50 cms.

The temperature at xi after (j+1) intervals of times is average of temperatures at xi+1


and xi-1 of j interval of time. Each interval is of

𝜌 ∆
∆ = = 87.89 sec.
30

The solution of this problem can be presented in the table below:

x(cm) 0 5 10 15 20 25 30 35 40 45 50
u(oc) 300 28 36 44 52 60 68 76 84 92 100

Temperature distribution in the rod at distance x from end A, downward after an


interval of 87.89 seconds each.
X(cm)
0 5 10 15 20 25 30 35 40 45 50
t(sec)
0 300 28 36 44 52 60 68 76 84 92 100
87.89 300 28 106 44 52 60 68 76 84 92 100
175.78 300 203 106 79 52 60 68 76 84 92 100
263.67 300 203 141 79 69.5 60 68 76 84 92 100
351.56 300 220.5 141 105.25 69.5 68.75 68 76 84 92 100
439.45 300 220.5 162.87 105.25 87 68.75 72.38 76 84 92 100
527.34 300 231.44 162.87 124.94 87 79.68 72.38 78.19 84 92 100
615.23 300 231.44 178.19 124.94 102.31 79.68 78.94 78.19 85.09 92 100
703.12 300 239.94 178.19 140.25 102.31 90.63 78.94 82.01 85.09 92.55 100
31

Example 4.2 (For Unsteady State Problem)

Solve the heat equation below using explicit method with

𝜕 𝜕
= ,0≤x≤2,t≥0
𝜕 𝜕

and condition
u(x,0) = x(2-x)
u(0,t) = u(2,t)=0
with h = 0.5, k = 0.25 and stop the iteration at t= 0.5.

Solution:

From the condition u(0,t) = 0 given, we know that


u00 = u(0,0) =0
u01 = u(0,0.25) = 0
u02 = u(0,0.50) = 0.
32

For condition u(2,t) = 0, we know that


u40 = u(2,0) =0
u41 = u(2,0.25) = 0
u42 = u(2,0.50) = 0.

Last condition u(x,0) = x(2-x),


u00 = u(0,0) = 0(2-0) =0
u10 = u(0.5,0) = 0.5(2-0.5) = 0.75
u20 = u(1.0,0) = 1(2-1) =1
u30 = u(1.5,0) = 1.5(2-1.5) = 0.75
u40 = u(2.0,0) = 2(2-2) = 0.

To find for others u(x,t) we can use explicit method with given k = 0.25 and h = 0.5.
.
r= =1
.
will give us
Ui,j+1 = Ui-1,j – Ui,j + Ui+1,j.

1 u i, j+1

k=0.25
h= 0.5
1 -1 1
u i-1,j u i, j u i+1,j

Figure 4.2 Molecule Diagram of Explicit Method for Example 4.2


33

For j =0,

i=1

u11 = u(0.5,0.25) = u00 – u10 + u20 = 0 – 0.75 + 1 = 0.25

i=2

u21 = u(1.0,0.25) = u10 – u20 + u30 = 0.75 – 1 + 0.75 = 0.5

i=3

u31 = u(1.5,0.25) = u20 – u30 + u40 = 1 – 0.75 + 0 = 0.25

For j =1,

i=1

u12 = u(0.5,0.5) = u01 – u11 + u21 = 0 – 0.25 + 0.5 = 0.25

i=1

u22 = u(1.0,0.5) = u11 – u21 + u31 = 0.25 – 0.5 + 0.25 = 0

i=1

u32 = u(1.5,0.5) = u21 – u31 + u41 = 0.5 – 0.25 + 0 = 0.25.


34

Example 4.3 (For Unsteady State Problem)

Solve the heat equation below using explicit method with

𝜕 𝜕
= ,0≤x≤1,t≥0
𝜕 𝜕

and condition
u(x,0) = sin (πx)
u(0,t) = u(1,t)=0
with h = 0.2, k = 0.01 and stop the iteration at t= 0.02

Maple Programming for the Solution:

> restart;
> interface( displayprecision=4);

> p_haba:=diff(u(x,t),t)=diff(u(x,t),x$2);

2
v v
p_haba := u (x, t ) = u (x, t )
vt 2
vx

> BC1:=u(0,t)=0; BC2:=u(1,t)=0;

> IC:=u(x,0)=sin(Pi*x);

> u_t:=(i,j)->(u[i,j+1]-u[i,j])/k;

> u_xx:=(i,j)->(u[i+1,j]-2*u[i,j]+u[i-1,j])/h^2;
35

> p_beza:=eval(
p_haba,{diff(u(x,t),t)=u_t(i,j),diff(u(x,t),x$2)=u_xx(i,j
)} );
u i, jC 1 K u i, j ui C 1, j K 2 u i, j C u i K 1, j
p_beza := =
k 2
h

> p_beza:=algsubs(k*c^2/h^2=r,k*p_beza):
> p_beza:=lhs(p_beza)-rhs(p_beza)=0;
k ( ui C 1, j K 2 u i, j C u i K 1, j )
p_beza := u i, jC 1 K u i, j K 2
= 0
h

> p_beza:=collect(p_beza,[u[i,j+1],u[i-
1,j],u[i,j],u[i+1,j]]);
k ui K 1, j æ
p_beza := u i, jC 1
K C K 1
h
2 è
2 kö k ui C 1, j
C u i, j K = 0
h ø
2 2
h

> u[i,j+1]=solve(p_beza,u[i,j+1]);
2
K k ui K 1, j K u i, j h C 2 u i, j k K k u i C 1, j
u i, jC 1
= K
2
h

> c:=1;k:=0.01; t_maks:=0.02; h:=0.2; L:=1; r:=k*c^2/h^2;


c := 1

k := 0.0100

t_maks := 0.0200

h := 0.2000

L := 1

r := 0.2500

> u[i,j+1]=solve(p_beza,u[i,j+1]);
u i, jC 1
= 0.2500 u i K 1, j
C 0.5000 u i, j C 0.2500 u i C 1,

> N:=round(L/h); M:=round(t_maks/k);


N := 5

M := 2

> for i from 0 to N do x[i]:=i*h od;


36

x 0 := 0.0000

x 1 := 0.2000

x 2 := 0.4000

x 3 := 0.6000

x 4 := 0.8000

x 5 := 1.0000

> for j from 0 to M do t[j]:=j*k od;


t 0 := 0.0000

t 1 := 0.0100

t 2 := 0.0200

> for j from 0 to M do


u[0,j]:=evalf(subs(t=t[j],rhs(BC1))) od;
u 0, 0
:= 0.0000

u 0, 1
:= 0.0000

u 0, 2
:= 0.0000

> for j from 0 to M do


u[N,j]:=evalf(subs(t=t[j],rhs(BC2))) od;
u 5, 0
:= 0.0000

u 5, 1
:= 0.0000

u 5, 2
:= 0.0000

> for i from 1 to N-1 do


u[i,0]:=evalf(subs(x=x[i],rhs(IC))) od;
u 1, 0
:= 0.5878

u 2, 0
:= 0.9511

u 3, 0
:= 0.9511
37

u 4, 0
:= 0.5878

> penye_[0]:=[seq([x[i],u[i,0]],i=0..N)];
penye_ 0
:= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 0.5878 ] , [ 0.4000 ,
0.9511 ] , [ 0.6000 , 0.9511 ] , [ 0.8000 , 0.5878 ] , [ 1.0000 ,
0.0000 ] ]

> for j from 0 to M-1 do


> for i from 1 to N-1 do
> u[i,j+1]:=solve(p_beza,u[i,j+1]);
> od;
> penye_kbt:=[seq([x[i],u[i,j+1]],i=0..N)];
> print(penye_[j+1]=penye_kbt):
> penye_[j+1]:=penye_kbt:
> od:
penye_ 1
= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 0.5317 ] , [ 0.4000 ,
0.8602 ] , [ 0.6000 , 0.8602 ] , [ 0.8000 , 0.5317 ] , [ 1.0000 ,
0.0000 ] ]

penye_ 2
= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 0.4809 ] , [ 0.4000 ,
0.7781 ] , [ 0.6000 , 0.7781 ] , [ 0.8000 , 0.4809 ] , [ 1.0000 ,
0.0000 ] ]

> A:=array(0..N,0..M):
> for j from 0 to M do
for i from 0 to N do
A[i,j]:=u[i,j];
od;
od;
> u:=convert(A,matrix);

> G1:=plots[matrixplot](u,axes=boxed,
orientation=[-20,55],
style=point,color=black,symbol=CIRCLE):
> G2:=plots[matrixplot](u,axes=boxed,
orientation=[-20,55], style=wireframe,color=black):
> plots[display](G1,G2);
38
39

4.3 Implicit Method

𝜕
In implicit method second partial derivative can be expressed using
𝜕
Central Difference at xi and tj and for ,
𝜕 + , − , + − , + ,+ − ,+ + − ,+
𝜕
ij = − +
∆ ∆

with = then it is called Crank-Nicolson method for each i,j = 0,1,2,3,…

Therefore the heat equation will become

, + − , ∆ + , − , + − , + , + − , + + − , +
= +
∆ ∆ ∆ ∆

or

, + − , =

𝑟
( + , − , + − , )+( + , + − , + + − , + ).


For simplicity of calculation take r = = 1, then we have

2( , + − , )=( + , − , + − , )+( + , + − , + +

− , + )

4 , + = + , + − , + + , + + − , +

Therefore the heat equation for implicit can be written as

, + = + , + − , + + , + + − , + .
40

-1 u i-1,j+1 4 u i, j+1 -1 u i+1,j+1

1 h 1
u i-1,j u i+1,j

Figure 4.3 Molecule Diagram for Crank-Nicolson Method with r =1


41

Example 4.4 (For Unsteady State Problem)

Solve the heat equation below using implicit method with


𝜕 𝜕
= ,0≤x≤2,t≥0
𝜕 𝜕

and condition
u(x,0) = x(2-x)
u(0,t) = u(2,t)=0
with h = 0.5, k = 0.25 and stop the iteration at t= 0.5.
(Take u0 = 0 and do calculation in 3 decimal places)

Solution:

From the condition u(0,t) = 0 given, we know that


u00 = u(0,0) =0
u01 = u(0,0.25) = 0
u02 = u(0,0.50) = 0.
42

For condition u(2,t) = 0, we know that


u40 = u(2,0) =0
u41 = u(2,0.25) = 0
u42 = u(2,0.50) = 0.

Last condition u(x,0) = x(2-x),


u00 = u(0,0) = 0(2-0) =0
u10 = u(0.5,0) = 0.5(2-0.5) = 0.75
u20 = u(1.0,0) = 1(2-1) =1
u30 = u(1.5,0) = 1.5(2-1.5) = 0.75
u40 = u(2.0,0) = 2(2-2) = 0.
To find others u(x,t) using Crank-Nicolson, we can convert the heat equation to the
new equation with k = 0.25 and h = 0.5.
.
r= =1
.
thus we will get
-Ui-1,j+1 + 4 Ui,j+1 - Ui+1,j+1 = Ui-1,j + Ui+1,j.

-1 u i-1,j+1 4 u i, j+1 -1 u i+1,j+1

1 h 1
u i-1,j u i+1,j

For j=0,
i =1
-u01 + 4u11 – u21 = u00 + u20
0 + 4u11 – u21 = 0 + 1
4u11 – u21 = 1 ………….(i)
43

i =2
-u11 + 4u21 – u31 = u10 + u30
-u11 + 4u21 – u31 = 0.75 + 0.75
-u11 + 4u21 – u31 = 1.5 ………….(ii)

i =3
-u21 + 4u31 – u41 = u20 + u40
-u21 + 4u31 – 0 = 1 + 0
-u21 + 4u31 = 1 …………..(iii)

We can find u11 , u21 and u31 by using matrix


A u = b

[− − ][ ] =[ . ]

using Gauss- Seidel elimination method
𝑛
+
u11(n+1) =

𝑛+ 𝑛
+ + .
u21(n+1) =

𝑛+
+
u31(n+1) = .

As given u0 = 0 with calculation in 3 decimal places and ε = 0.005,

n 𝑛 𝑛 𝑛

0 0 0 0
1 0.250 0.438 0.360
2 0.360 0.555 0.389
3 0.389 0.570 0.393
4 0.393 0.572 0.393
44

Iteration | − |= . < ε.
Then the solution for
u11 = u(0.5,0.25) = 0.393
u21 = u(1.0,0.25) = 0.572
u31 = u(1.5,0.25) = 0.393.

Meanwhile to find for u12 , u22 and u32 we can do as the calculation before,
For j=1,
i =1
-u02 + 4u12 – u22 = u01 + u21
0 + 4u12 – u22 = 0 + 0.572
4u12 – u22 = 0.572 ………….(iv)
i =2
-u12 + 4u22 – u32 = u11 + u31
-u12 + 4u22 – u32 = 0.393 + 0.393
-u12 + 4u22 – u32 = 0.786 . ………….(v)
i =3
-u22 + 4u32 – u42 = u21 + u41
-u22 + 4u32 – 0 = 0.572 + 0
-u22 + 4u32 = 0.572 …………..(vi)

We can find u12 , u22 and u32 by using matrix

A u = b
− .
[− − ][ ] =[ . ]
− .
45

using Gauss-Seidel elimination method


𝑛
(n+1)
+ .
u12 =

𝑛+ 𝑛
(n+1)
+ + .
u22 =

𝑛+
+ .
u32 (n+1)
= .
As given u0 = 0 with calculation in 3 decimal places and ε = 0.005,

n 𝑛 𝑛 𝑛

0 0 0 0
1 0.143 0.232 0.201
2 0.201 0.297 0.217
3 0.217 0.305 0.219
4 0.219 0.306 0.220

Iteration | − |= . < ε.
Then the solution for
u12 = u(0.5,0.5) = 0.219
u22 = u(1.0,0.5) = 0.306
u32 = u(1.5,0.5) = 0.220.
46

Example 4.5 (For Unsteady State Problem)

Solve the heat equation below using Crank Nicolson method with

𝜕 𝜕
= ,0≤x≤1,t≥0
𝜕 𝜕

and condition
u(x,0) = 2 sin (2πx)
u(0,t) = u(1,t)=0
with h = 0.2, k = 0.1 and stop the iteration at t= 0.2.

Maple Programming for the Solution:


> restart;
> interface( displayprecision=4);

> p_haba:=diff(u(x,t),t)=1/16*diff(u(x,t),x$2);
2
v 1 æv ö
p_haba := u (x, t ) = ç u ( x , t ) ÷
vt 16 è vx 2 ø

> BC1:=u(0,t)=0; BC2:=u(1,t)=0;


BC1 := u ( 0, t ) = 0

BC2 := u ( 1, t ) = 0

> IC:=u(x,0)=2*sin(2*pi*x);

> p_beza:=eval(p_haba,{diff(u(x,t),t)=(u[i,j+1]-
u[i,j])/(2*k/2),diff(u(x,t),x$2)=(1/2)*((u[i+1,j+1]-
2*u[i,j+1]+u[i-1,j+1])/h^2+(u[i+1,j]-2*u[i,j]+u[i-
1,j])/h^2)});
u i, jC 1 K u i, j
p_beza :=
k
1 ui C 1, j C 1
K 2 u i, jC 1
C ui K 1, j C 1
=
32 2
h
1 ui C 1, j
K 2 u i, j C u i K 1, j
C
32 2
h
47

> p_beza:=algsubs(c^2*k/h^2=r,expand(k*p_beza));

> p_beza:=collect(2*p_beza,[u[i-
1,j+1],u[i,j+1],u[i+1,j+1],
u[i-1,j],u[i,j],u[i+1,j]]);
1 k ui K 1, j C 1 1 k u i, jC 1
p_beza := 2 u i, jC 1
K 2 u i, j = K
16 2 8 2
h h
1 k ui C 1, j C 1 1 k ui K 1, j 1 k u i, j
C C K
16 2 16 2 8 2
h h h
1 k ui C 1, j
C
16 2
h

> p_beza:=lhs(p_beza)-rhs(p_beza)=0;
1 k ui K 1, j C 1
p_beza := 2 u i, jC 1
K 2 u i, j K
16 2
h
1 k u i, jC 1 1 k ui C 1, j C 1 1 k ui K 1, j
C K K
8 2 16 2 16 2
h h h
1 k u i, j 1 k ui C 1, j
C K = 0
8 2 16 2
h h

> p_beza:=collect(p_beza,[u[i-1,j+1],u[i,j+1],u[i+1,j+1],
u[i-1,j],u[i,j],u[i+1,j]]);
1 k ui K 1, j C 1 æ1 k
p_beza := K C
16 2 è 8 h2
h
ö 1 k ui C 1, j C 1 1 k ui K 1, j æ
C 2 u jC 1
K K C K 2
ø i, 16 h
2 16 h
2 è
1 k ö 1 k ui C 1, j
C u i, j K = 0
8 h2 ø 16 h
2

> c:=1;k:=0.1; h:=0.2;pi:=22/7;r:=c^2*k/h^2;


c := 1

k := 0.1000

h := 0.2000
48

r := 2.5000

> p_beza:=p_beza;
p_beza := K 0.1563 u i K 1, j C 1
C 2.3125 u i, jC 1
K 0.1563 u i C 1, j C 1
K 0.1563 u i K 1, j
K 1.6875 u i, j K 0.1563 u i C 1, j
= 0

> L:=1; tmax:=0.2;


L := 1

tmax := 0.2000

> N:=round(L/h); M:=round(tmax/k);


N := 5

M := 2

> for i from 0 to N do x[i]:=i*h od;


x 0 := 0.0000

x 1 := 0.2000

x 2 := 0.4000

x 3 := 0.6000

x 4 := 0.8000

x 5 := 1.0000

> for j from 0 to M do t[j]:=j*k od;


t 0 := 0.0000

t 1 := 0.1000

t 2 := 0.2000

> for i from 0 to N do


u[i,0]:=evalf(subs(x=x[i],rhs(IC))) od;
u 0, 0
:= 0.0000
49

u 1, 0
:= 1.9024

u 2, 0
:= 1.1739

u 5, 0
:= 0.0051

> for j from 0 to M do


u[0,j]:=evalf(subs(t=t[j],rhs(BC1))) od;
u 0, 0
:= 0.0000

u 0, 1
:= 0.0000

u 0, 2
:= 0.0000

> for j from 0 to M do


u[N,j]:=evalf(subs(t=t[j],rhs(BC2))) od;
u 5, 0
:= 0.0000

u 5, 1
:= 0.0000

u 5, 2
:= 0.0000

> for j from 0 to M-1 do


> for i from 1 to N-1 do
> pers[i]:=eval(p_beza);
> print(pers[i]):
> od:
> penye_kbt:=fsolve({seq(pers[i],i=1..N-
1)},{seq(u[i,j+1],i=1..N-1)});
> print(penye=penye_kbt):
> assign(penye_kbt);
> od:
K 3.3938 C 2.3125 u 1, 1
K 0.1563 u 2, 1
=0

K 0.1563 u 1, 1
C 2.3125 u 2, 1
K 0.1563 u 3, 1
K 2.0942 = 0

K 0.1563 u 2, 1
C 2.3125 u 3, 1
K 0.1563 u 4, 1
C 2.1015 = 0
50

penye = { u 3, 1 = K .9483 , u 2, 1 = 0.9450 , u 4, 1 = K 1.5308 ,


u 1, 1 = 1.5314 }

K 2.7319 C 2.3125 u 1, 2
K 0.1563 u 2, 2
=0

K 0.1563 u 1, 2
C 2.3125 u 2, 2
K 0.1563 u 3, 2
K 1.6858 = 0

K 0.1563 u 2, 2
C 2.3125 u 3, 2
K 0.1563 u 4, 2
C 1.6918 = 0

K 0.1563 u 3, 2
C 2.3125 u 4, 2
C 2.7314 = 0

penye = { u 3, 2 = K .7635 , u 2, 2 = 0.7607 , u 4, 2 = K 1.2327 ,


u 1, 2 = 1.2328 }

> for j from 0 to M do


penye_[j]:=[seq([x[i],u[i,j]],i=0..N)];
od;
penye_ 0
:= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 1.9024 ] , [ 0.4000 ,
1.1739 ] , [ 0.6000 , K 1.1780 ] , [ 0.8000 , K 1.9009 ] , [ 1.0000 ,
0.0000 ] ]

penye_ 1
:= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 1.5314 ] , [ 0.4000 ,
0.9450 ] , [ 0.6000 , K .9483 ] , [ 0.8000 , K 1.5308 ] , [ 1.0000 ,
0.0000 ] ]

penye_ 2
:= [ [ 0.0000 , 0.0000 ] , [ 0.2000 , 1.2328 ] , [ 0.4000 ,
0.7607 ] , [ 0.6000 , K .7635 ] , [ 0.8000 , K 1.2327 ] , [ 1.0000 ,
0.0000 ] ]

> A:=array(0..N,0..M):
> for j from 0 to M do
for i from 0 to N do
A[i,j]:=u[i,j];
od;
od;
> u:=convert(A,matrix);
51

é 0.0000 0.0000 0.0000 ù


ê ú
ê 1.9024 1.5314 1.2328 ú
ê ú
ê 1.1739 0.9450 0.7607 ú
u := ê ú
êK 1.1780 K .9483 K .7635 ú
ê ú
K 1.9009 K 1.5308 K 1.2327
ê ú
ê ú
ë 0.0000 0.0000 0.0000 û

> G1:=plots[matrixplot](u,axes=boxed,orientation=[-
15,70], style=point,color=black,symbol=CIRCLE):
> G2:=plots[matrixplot](u,axes=boxed,orientation=[-
15,70], style=wireframe,color=black):
> plots[display](G1,G2);

>
52

4.4 Two Dimensional Parabolic Equation

The two dimensional heat equation can be written as

𝜕 𝜕 𝜕
= +
𝜕 𝜕 𝜕

over the rectangular region 0 ≤ x ≤ a, 0 ≤ y ≤ b, where u is known initially at all


points within and on the boundary of the rectangle, and its known subsequently at
all points on the boundary.

Figure 4.4 Heat Equation for Two Dimensional

Define the coordinate,(x,y,t) of the mesh points of the solution domain by

x = i𝜕 , y = j𝜕 , t=n𝜕 ,

where i, j, n are positive integer and denote the values of u at theses mesh point by

u(i𝜕 , j𝜕 , n 𝜕 )= u i,j,n .
53

The explicit finite-difference can represent the two dimensional of heat equation as

, ,𝑛+ − , ,𝑛 − , ,𝑛 – , ,𝑛 + + , ,𝑛
= ( )+
∆ ∆

, − ,𝑛 − , ,𝑛 + , + ,𝑛

with condition for its validity c{ + }∆ ≤ and the value of ∆ must be


∆ ∆

in small value.

For most problem, it is an impractical method.

Then we can use Crank-Nicolson Method,

, ,𝑛+ − , ,𝑛 𝜕 𝜕 𝜕 𝜕
= { + ,, + + ,, + }
∆ 𝜕 𝜕 𝜕 𝜕

that can be written as

, ,𝑛+ = , ,𝑛
𝑟
+ [ + , ,𝑛+ + − , ,𝑛+ + , + ,𝑛+ + , − ,𝑛+

− , ,𝑛+ ]
+[ + , ,𝑛 + − , ,𝑛 + , + ,𝑛 + , − ,𝑛 − , ,𝑛 ]

assuming that a square grid is used so that Δx = Δy. This equation can be simplified

by rearranging terms and let r = ,

𝑟
− 𝑟 , ,𝑛+ − + , ,𝑛+ + − , ,𝑛+ + , + ,𝑛+ + , − ,𝑛+

𝑟
= − 𝑟 , ,𝑛 + ( + , ,𝑛 + − , ,𝑛 + , + ,𝑛 + , − ,𝑛 ).

For Crank-Nicolson numerical scheme, a low value of r is not required for stability,
however it is required for numerical accuracy.
54

CHAPTER 5

CONCLUSION AND RECOMMENDATIONS

5.1 Introduction

This chapter summarizes the study that was done on the research about heat
equation and the solution using numerical methods. Recommendations are further
given for consideration for other researches to be done in the future.

5.2 Conclusion

As we can see, mathematics is a well wide subject of itself. It can be seen in


the physic fields, engineering fields or even in the daily activities. There are many
methods that can be used to solve the mathematical question. Even in heat equation
55

that was discussed in this research, there are many solutions that can be used to get
the exact solution either using analytical or numerical. Separation of variables is the
oldest and most efficient solution technique for a certain class of Partial Differential
Equation (PDE) problems.

The basic idea of this method is to assume that the original function of two
variables can be written as a product of two functions, each of which is dependent
upon a single independent variable. Based on the assumed solution form, the PDE is
converted into two Ordinary Partial Equations that can be solved separately. Then,
combining the two solutions will get the solution for the corresponding PDE.

For this research, I am more interested in solving the unsteady state problem
which consider the time for heat equation using numerical methods which are the
explicit method and the implicit method (Crank Nicolson). The original heat
equation can be written as

𝜕 𝜕
=
𝜕 𝜕

for one dimensional heat equation and

𝜕 𝜕 𝜕
= + )
𝜕 𝜕 𝜕

for two dimensional heat equation.

Then, these original equation will be converted to the new equation using forward
and backward difference method that was learnt from calculus.

For explicit method the heat equation can be written as

, + =𝑟 − , + − 𝑟 , +𝑟 + ,

for one dimensional heat equation.


56

For two dimensional heat equation is as follow:

, ,𝑛+ − , ,𝑛 − , ,𝑛 − , ,𝑛 + + , ,𝑛
=c ( )+
∆ ∆

, − ,𝑛 − , ,𝑛 + , + ,𝑛
( )

Then, for implicit method or Crank-Nicolson can be written as

, + = + , + − , + + , + + − , + )

for one dimensional heat equation and

𝑟
− 𝑟 , ,𝑛+ − ( + , ,𝑛+ + − , ,𝑛+ + , + ,𝑛+ + , − ,𝑛+

𝑟
= − 𝑟 , ,𝑛 + ( + , ,𝑛 + − , ,𝑛 + , + ,𝑛 + , − ,𝑛 )

for two dimensional heat equation.

Like other method, using the numerical method also has its advantages and
disadvantages that can shown in table below:

Table 5.1 : Advantages and Disadvantages of Numerical Methods

METHOD ADVANTAGES DISADVANTAGES


1-Dimensional
Explicit method Simplicity ∆t must be smaller than a
stability limit

Implicit method Unconditionally stable Needs the tridiagonal


(Crank-Nicolson) solution scheme

2-Dimensional
Explicit method Simplicity For stability, ∆t must be
less than a certain criterion

Implicit method Unconditionally stable Needs simultaneous


(Crank-Nicolson) solution in each time step
57

In this research, I also used the Maple Programming to solve the heat equation. It
will reduce your time in calculating the value of u(x,t) since the number of variables
become bigger and bigger in the real world problems. Besides, we can check the
accuracy of the solution too.

5.3 Recommendations

In order to further the research in this field, a few remarks are made in this
subtopic and the recommendations can be taken into future account.

Besides solving heat equation problem there are other equation can also be
faced by scientists or engineers in the real world problems. Wave equation is also
widely used since it is related with the vibration that usually occurs in the real world.
We can see many applications of wave equation occurring in the science and
engineering fields. Future research can also be done in the wave equation using
numerical method to solve it.

In this research, the examples given are only for one and two dimensional
problems. As we know in the real world solutions involve more than two variables. It
is advised that future research in those problems is recommended with more
examples that usually occur in real situations.

Other than that, real world problems involve more than two variables. For
future research it is encouraged to use the other mathematical software such as C
Programming, C++ Programming, and Matlab. Using these programming not only
saves time but also gives accurate solution.
58

REFERENCES

1. Che Rahim Che Teh, Kaedah Berangka (Matematik untuk Sains dan
Kejuruteraan Menggunakan Maple), Universiti Teknologi Malaysia, 2005

2. L.C. Evans, Partial Differential Equations, Grad. Stud. Math., Amer. Math.
Soc., Providence, RI, 1998

3. R. Spiegel, Murray, Applied Differential Equations, Third Edition, Prentice-


Hall, New Jersey, 1991

4. Edmund Milne, William, Numerical Solution for Differential Equation,


Dover Publications, New York, 2000

5. L. Rabenstein, Albert, Elementary Differential Equations with Linear


Algebra, Academic Press, Inc. London, 1990

6. Shintani, Hisayoshi, “Explicit and Implicit Difference Formulas Of Higher


Order Accuracy For One-Dimensional Heat Equation”, Hiroshima
Mathematical Journal. Volume 34, Number 2 259-270 (Cornell University
Library), 1970
59

7. J. Biazar and Z. Ayati, “An Approximation to the Solution Of Parabolic


Equation by Adomian Decomposition Method and Comparing the Result with
Crank-Nicolson Method”, International Mathematical Journal, Number 39,
1925-1933, 2006

8. L. C. Wang, Richard, Linz, Peter, Exploring Numerical Methods (An


Introduction to Scientific Computing Using MATLAB ) Jones and Barlett
Publishers, America, 2003

9. Prasad, Devi, Introduction to Numerical Analysis, Second Edition, Alpha


Science International Ltd., Harrow, U.K., 2005

10. Shoichiro Nakamura, Applied Numerical Methods with Software, Prentice


Hall, New Jersey, 2000

11. W. Lewis, Roland, Nithiarasu, Perumal, Fundamental of the Finite Element


Method for Heat and Fluid Flow, John Wiley & Sons, Ltd, 2004

12. A.B. Tayler, Mathematical Models in Applied Mechanics, Oxford, 2004

13. David, J. Logan, Applied Partial Equations, Second Edition, Springer, New
York, 2004

14. Zafar Ahsan, Differential Equations and Their Applications, Second Edition,
Prentice Hall of India, New Delhi, 2004

15. G.D. Smith, Numerical Solutions of Partial Differential Equations, Oxford


University Press, 1969

16. Solin, Pavel, Partial Differential Equations and the Finite Element Method,
Willey Interscience, A JOHN WILEY & SONS , INC., 2006

View publication stats

You might also like