Академический Документы
Профессиональный Документы
Культура Документы
Mansoura University
Faculty of Engineering
Computer Application
in Mechanical Power Engineering - III
by
Dr. Hossam S.S. AbdelMeguid
2013-2014
Mansoura University
Faculty of Engineering
Computer Application
In Mechanical Power Engineering - III
Dr. Hossam S.S. AbdelMeguid
2012-2013
ISBN: 978-977-6005-89-1
DEPOSIT NUMBER: 23598/2012
ii
Table of Contents
PREFACE .......................................................................................................... IX
PART 1: FUNDAMENTALS ................................................................................ 1
1 FUNDAMENTALS ......................................................................................... 1
1.1 Introduction ..................................................................................... 1
1.2 Incentives for process modelling ....................................................... 1
1.3 Systems ............................................................................................ 3
1.3.1
1.3.2
1.4
1.5
1.6
Classification of Models.................................................................... 5
State variables and state equations.................................................. 6
Classification of theoretical models .................................................. 6
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.7
1.8
1.8.1
1.8.2
1.8.3
1.8.4
.1.1
Thermodynamic relations ........................................................... 20
1.13
Phase Equilibrium ....................................................................... 21
1.14
Chemical kinetics ........................................................................ 24
1.15
Control Laws ............................................................................... 25
1.16
Degrees of Freedom .................................................................... 26
1.17
Model solution ............................................................................ 27
.1.1
Model validation ......................................................................... 28
1.19
Problems..................................................................................... 29
2 MATHEMATICAL MODELS FOR MECHANICAL AND CHEMICAL PROCESSES ................ 30
2.1 Lumped Parameter Systems ........................................................... 31
2.1.1
2.1.2
2.1.3
iii
2.1.4
2.1.5
2.1.6
2.2
2.2.1
2.2.2
2.2.3
2.2.4
11.2
11.2.1
11.3
Runge-Kutta with adaptive step size ......................................... 118
11.4
Matlab code for 4th order Runge-Kutta method ........................ 119
12 SYSTEM OF COUPLED ODE'S ............................................................ 121
12.1
Euler's method for system of coupled ODE's .............................. 122
iv
12.2
12.3
12.4
12.4.1
12.5
Matlab code or a coupled system of ODE using 4 th order RungeKutta 128
12.6
Stability of the integration methods .......................................... 129
12.7
Stiff differential equations......................................................... 131
12.8
Other solution techniques ......................................................... 133
13 BOUNDARY VALUE PROBLEM .................................................................. 135
13.1
Introduction .............................................................................. 135
13.2
Numerical methods for the solution of BVP problems................ 138
13.3
Shooting methods ..................................................................... 139
13.3.1
13.4
Matlabe code for 4th order Runge-Kutta shooting method for a
linear BVP .............................................................................................. 147
13.5
Finite-Difference Methods......................................................... 148
13.6
Finite-Difference Methods for Linear Problems ......................... 152
13.7
Handling different types boundary conditions ........................... 154
13.8
Other solution techniques ......................................................... 156
14 CASE STUDY (USING ODES TO ANALYZE THE TRANSIENT RESPONSE OF A REACTOR). 157
15 PROBLEMS ......................................................................................... 161
PART 4: PARTIAL DIFFERENTIAL EQUATIONS .............................................. 163
16 INTRODUCTION TO PARTIAL DIFFERENTIAL EQUATIONS .................................. 163
16.1
Introduction .............................................................................. 163
16.2
Basics ........................................................................................ 164
16.2.1
16.2.2
16.2.3
16.2.4
16.3
16.4
16.4.1
16.4.2
16.4.3
16.5
16.5.1
16.5.2
16.5.3
16.6
Basic Rules ................................................................................ 182
16.7
Summery .................................................................................. 183
17 FINITE DIFFERENCE METHODS ................................................................. 184
17.1
Introduction .............................................................................. 184
v
17.2
17.2.1
18.3
A Numerical Example for Elliptic (Laplace's) Equation ............... 195
18.4
Matlab Code and Script for Elliptic (Laplace's) Equation (Heat
Conduction) ........................................................................................... 201
18.5
Poisson's Equation (Steady Heat conduction with Generation) .. 206
18.6
A Numerical Example for Poisson's Equation ............................. 207
18.7
Matlab Code and Script for Poissons Equation ......................... 210
19 PARABOLIC EQUATION (UNSTEADY HEAT CONDUCTION) ............................... 219
19.1
Unsteady Conduction ................................................................ 219
19.2
Simple Explicit Scheme .............................................................. 220
19.3
Implicit Schemes ....................................................................... 223
19.4
Numerical example for unsteady 1D heat conduction ............... 224
19.4.1
19.5
19.5.1
Example and Matlab code for unsteady 1D heat conduction .................................. 226
19.6
Unsteady Conduction in 2D and 3D with Heat generation ......... 243
20 CONVECTION AND DIFFUSION (CONDUCTION)............................................. 247
20.1
Steady 1-D Convection and Diffusion (conduction) .................... 248
20.1.1
20.1.2
20.2
20.2.1
20.3
20.3.1
23.5
23.6
23.7
23.7.1
23.7.2
23.8
Animation ................................................................................. 287
REFERENCES ............................................................................................... 289
vii
viii
Preface
This book evolved from lecture notes developed last year of teaching this
material, mostly in computer application in mechanical power engineering and
process modelling and simulation at Mansoura University and NDETI. The
course is taken by graduate students, along with post graduate students.
Exercises and assignments are an important aspect of any such course and
many have been developed in conjunction with this book. Rather than
lengthening the text, they are available on the book's webpage:
Https://sites.google.com/site/hssaleh/
The webpage also contains Matlab m-files that illustrate how to implement
different numerical methods for soling ordinary and partial deferential
equations, and that may serve as a starting point for further study of the
methods. A number of the exercises require programming on the part of the
student, or making changes to the Matlab programs provided. Some of these
exercises are fairly simple, designed to enable students to observe first hand
the behaviour of numerical methods described in the text. Others are more
open-ended and could form the basis for a many project.
The book is organized into five main parts. Part 1 deals with fundamentals of
modelling and simulation. Part 2 deals with solving linear system of equation.
Part 3 concerns time-dependent problems, starting with the initial value
problem for ODEs and moving on to initial-boundary value problems. Part 4
concerns the finite difference solution of energy equation in 1, 2 and 3
dimensions, with an emphasis on systems arising from finite difference
approximations. Part 5 gives a brief introduction about the programming with
matlab and explores its main features that will be used in this book.
ix