numerical - himpub.com
TRANSCRIPT
NUMERICALAND
STATISTICAL METHODS
Prof. Bhupendra T. KesariaAssistant Professor,
SVKM’s Usha Pravin Gandhi College of Management,Vile Parle, Mumbai,Maharashtra, India.
ISO 9001:2008 CERTIFIED
© AuthorNo part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by anymeans, electronic, mechanical, photocopying, recording and/or otherwise without the prior written permission of theauthor and the publisher.
First Edition : 2018
Published by : Mrs. Meena Pandey for Himalaya Publishing House Pvt. Ltd.,“Ramdoot”, Dr. Bhalerao Marg, Girgaon, Mumbai - 400 004.Phone: 022-23860170, 23863863; Fax: 022-23877178E-mail: [email protected]; Website: www.himpub.com
Branch Offices :
New Delhi : “Pooja Apartments”, 4-B, Murari Lal Street, Ansari Road, Darya Ganj, NewDelhi - 110 002. Phone: 011-23270392, 23278631; Fax: 011-23256286
Nagpur : Kundanlal Chandak Industrial Estate, Ghat Road, Nagpur - 440 018.Phone: 0712-2738731, 3296733; Telefax: 0712-2721216
Bengaluru : Plot No. 91-33, 2nd Main Road, Seshadripuram, Behind Nataraja Theatre,Bengaluru - 560 020. Phone: 080-41138821; Mobile: 09379847017, 09379847005
Hyderabad : No. 3-4-184, Lingampally, Besides Raghavendra Swamy Matham,Kachiguda, Hyderabad - 500 027. Phone: 040-27560041, 27550139
Chennai : New No. 48/2, Old No. 28/2, Ground Floor, Sarangapani Street, T. Nagar,Chennai - 600 012. Mobile: 09380460419
Pune : “Laksha” Apartment, First Floor, No. 527, Mehunpura, Shaniwarpeth
(Near Prabhat Theatre), Pune - 411 030. Phone: 020-24496323, 24496333;Mobile: 09370579333
Lucknow : House No. 731, Shekhupura Colony, Near B.D. Convent School, Aliganj,Lucknow - 226 022. Phone: 0522-4012353; Mobile: 09307501549
Ahmedabad : 114, “SHAIL”, 1st Floor, Opp. Madhu Sudan House, C.G. Road, NavrangPura, Ahmedabad - 380 009. Phone: 079-26560126; Mobile: 09377088847
Ernakulam : 39/176 (New No. 60/251) 1st Floor, Karikkamuri Road, Ernakulam,
Kochi - 682 011. Phone: 0484-2378012, 2378016; Mobile: 09387122121
Bhubaneswar : Plot No. 214/1342, Budheswari Colony, Behind Durga Mandap,Bhubaneswar - 751 006. Phone: 0674-2575129; Mobile: 09338746007
Kolkata : 108/4, Beliaghata Main Road, Near ID Hospital, Opp. SBI Bank, Kolkata - 700 010.
Phone: 033-32449649; Mobile: 07439040301
DTP by : OM Grahics, Bhandup
Printed at : Geetanjali Press Pvt. Ltd., Nagpur. On behalf of HPH.
PREFACE
Dear Students,
I am extremely happy to come out with this book on “Numerical and Statistical Methods”. Thetopics within the chapters have been arranged in a proper sequence to ensure smooth flow of thesubject. Large number of solved examples are included in all chapters for better understanding ofstudents. I sincerely hope that this book will cater to all your needs in this subject.
I thank my daughter Ekta B. Kesaria for her help in preparing and solving the problems. I alsothank my family for their encouragement and support.
I also thank Mr. Srivastava of Himalaya Publishing House Pvt. Ltd. and his entire staff for theirefforts in publishing this book. We have jointly made every possible effort to eliminate all the errors inthe book, however if you find any, please let us know, because that will help us to improve further.
I am grateful to Dr. Mrs. Anju Kapoor (Principal, Usha Pravin Gandhi College of Management)for her constant encouragement, influence and relentless support.
I thank Prof. Hirendand (Coordinator, B.Sc. I.T., Mulund College of Commerce), Prof. SmrutiNanavaty (Coordinator, M.Sc., I.T., Usha Pravin Gandhi College of Management) and Prof. SwapnaliLotlikar (Coordinator, B.Sc. I.T., Usha Pravin Gandhi College of Management) for their inspirationand support.
I also thank my friends and colleagues for their encouragement and patience.
- Author
CONTENTSNo. Chapter Name Page No.
1 Mathematical Modeling and Engineering Problem Solving1.0 Introduction1.1 Objectives1.2 A Simple Mathematical Model1.3 Conservation Laws
1-6
2 Approximations and Round-off Errors2.0 Introduction2.1 Objectives2.2 Significant Figures (Digits)2.3 Accuracy and Precision2.4 Error Definitions2.5 Round-off Errors2.6 Summary
7-14
3 Trunction Errors and the Taylor Series3.0 Introduction3.1 Objectives3.2 The Taylor Series3.3 Error Propagation3.4 Total Numerical Errors3.5 Formulation Errors and Data Uncertainty3.6 Summary
15-30
4 Solution of Algebraic and Transcendental Equations4.0 Introduction4.1 Objectives4.2 Iterative Methods for Locating Roots
4.2.1 Bisection Method4.2.2 Regula-Falsi Method4.2.3 Newton Raphson Method4.2.4 Secant Method
4.3 Iterative Methods and Convergence Criteria4.3.1 Order of Convergence of Iterative Methods like Bisection and
Regula-Falsi Method4.3.2 Convergence of Newton Raphson Method4.3.3 Rate of Convergence of Secant Method
4.4 Programs and Algorithms4.4.1 Program and Algorithm of Bisection Method4.4.2 Regula-Falsi Method4.4.3 Newton Raphson Method4.4.4 Secant Method
4.5 Summary
31-60
5 Interpolation5.0 Introduction5.1 Objectives5.2 Forward Difference
61-93
5.3 Backward Difference5.4 Newton’s Forward Difference Interpolation5.5 Newton’s Backward Difference Interpolation5.6 Lagrange’s Interpolation5.7 Summary
6 Solution of Simultaneous Algebraic Equation (Linear) using Iterative Methods6.0 Introduction6.1 Objectives6.2 Gauss-Jordan Method6.3 Gauss-Seidel Method6.4 Summary
94-115
7 Numerical Differentiation and Integration7.0 Introduction7.1 Objectives7.2 Numerical Differentiation7.3 Numerical Integration
7.3.1 Trapezoidal Rule7.3.2 Simpson’s 1/3rd Rule7.3.3 Simpson’s 3/8th Rule
7.4 Summary
116-139
8 Numerical Solution of 1st and 2nd Order Differential Equations8.0 Introduction8.1 Objectives8.2 Taylor’s Series8.3 Euler’s Method8.4 Modified Euler’s Method8.5 Runge Kutta Method for 1st and 2nd Order Differential Equations8.6 Summary
140-169
9 Least-Squares Regression9.0 Introduction9.1 Objectives9.2 Linear Regression9.3 Polynomial Regression9.4 Multiple Linear Regression9.5 General Linear Least Squares9.6 Non-linear Regression9.7 Summary
170-187
10 Linear Programming (Graphical Method)10.0 Introduction10.1 Objectives10.2 Meaning of Linear Programming10.3 Basic Requirements10.4 Basic Assumptions10.5 Application of Linear Programming in Business and Industry10.6 Advantages and Disadvantages (Limitations)10.7 Standard Form of Linear Programming Problem
188-221
10.8 Graphical Solution to Linear Programming Models10.9 Special Cases of Linear Programming Problems
10.10 Summary11 Random Variables
11.0 Introduction11.1 Objectives11.2 Discrete Random Variables
11.2.1 Random Variables11.2.2 Discrete Random Variables
11.3 Continuous Random Variables11.4 Probability Density Function11.5 Probability Distribution of Random Variable11.6 Expected Value11.7 Variance11.8 Summary
222-245
12 Distributions12.0 Introduction12.1 Objectives12.2 Discrete Distribution12.3 Continuous Distribution12.4 Normal (or Gaussian) Distribution12.5 Summary
246-274
(1)
STRUCTURE:
1.0 Introduction
1.1 Objectives
1.2 A Mathematical Model
1.3 Conservation Laws
1.0. INTRODUCTION
Knowledge and understanding are prerequisites for the effective implementation of any tool.
This is particularly true when using computers to solve engineering problems. Although they have
great potential utility, computers are practically useless without a fundamental understanding of how
engineering system works.
This understanding is initially gained by empirical means that is by observation and experiment.
However, while such empirically derived information is essential, it is only half the story. Over years
and years of observation and experiments; engineers and scientists have noticed that certain aspects of
their empirical studies occur repeatedly.
The primary objective of this chapter is to introduce you to mathematical modeling and its role
an engineering problem solving. We will also illustrate how numerical methods figure in the process.
1.1 OBJECTIVES
To provide a concrete idea of what numerical methods are and how they relate to engineering
and scientific problem solving.
• Learning how mathematical models can be formulated on the basis of scientific principles
to simulate the behaviour of a simple physical system.
• Understanding how numerical methods afford a means to generalize solutions in a manner
that can be implemented on a digital computer.
• Understanding the different types of conservation laws that lie beneath the models used in
the various engineering disciplines and appreciating the difference between steady-state and
dynamic solutions of these models.
• Learning about the different types of numerical methods we will cover in next section.
MATHEMATICAL MODELING
AND ENGINEERING
PROBLEM SOLVING 1
2 Numerical and Statistical Methods
1.2 A SIMPLE MATHEMATICAL MODEL
• A mathematical model can be broadly defined as a formulation or equation that expresses
the essential features of a physical system or process in mathematical terms.
• Models can be represented by a functional relationship between dependent variables,
independent variables, parameters, and forcing functions.
Dependent Variables = f (independent variables, parameters, forcing functions)
• Dependent variable – a characteristic that usually reflects the behaviour or state of the system.
• Independent variables – dimensions such as time and space, along which the systems
behaviour is being determined.
• Parameters – constants reflective of the systems properties or composition.
• Forcing functions – external influences acting upon the system.
Modeling : Newton’s second Low motion.
• Statement: The time rate of change of momentum of a body is equal to the resultant force
acting on it.
F = ma
⇒ a = m
f ← forcing function
Dependent variable Parameter
(acceleration) (mass of object)
• No independent variable is involved.
• Eg. it can be used to determine the terminal velocity of a free-falling body near the earth’s
surface.
• It describes a natural process or system in mathematical terms.
• It represents an idealization and simplification of reality.
• Ignore negligible details of the natural process and focus on its essential manifestations.
• Exclude the effects of “relativity” that are minimal importance when applied to object and forces
that interact on or about the earth’s surface at velocities and on scales visible to humans.
• It yields reproducible results and can be used for predictive purposes.
• Have generalization capabilities.
Bungee – jumping
• For a body falling within the vicinity of the earth, the net force is composed of two
opposing forces.
F = fD + fu
• The downward Pull of gravity FD.
- The force due to gravity can be formulated as:
FD = mg
- g is the acceleration due to gravity (9.81 m/s2)
Mathematical Modeling and Engineering Problem Solving 3
• The upward force of air resistance fu
- A good approximations is to formulate it as:
Fu = – CdV2
- V is the velocity; Cd is the lumped drag coefficient, accounting for the properties of the
falling object like shape or surface roughness.
- >>The greater the fall velocity, the greater the upward force due to air resistance
Upward force due to air resistance
Downward force due to gravity
• The net force therefore is the difference between and upward force, we can have a
differential equation regarding the velocity of the object.
2v
m
cdg
dt
dv −=
• The exact solution of v cannot be obtained using simple algebraic manipulation but rather
using more advanced calculus techniques (when v(t) = 0, t = 0)
v(t) =
t
m
gedh
Cd
gm tan
Here t is independent variable, v(t) is dependent variable, Cd and m are parameters.
g is forcing function
tan h (x) = xx
xx
ee
ee−
−
+−
Example 1:
• A bungee jumper with a mass of 68.1 kg leaps from a stationary hot air balloon (the drag
coefficient is 0.25 kg/m).
- Compute the velocity for the first 12s of free fall.
Determine the terminal velocity that will attained for an infinite long cord.
V(t) =
t
m
gCdh
Cd
gm tan
4 Numerical and Statistical Methods
mg = CdV2
V = Cd
gm
V(t) =
1.68
)25.0( 8.9 tan
25.0
)1.68( 8.9 th = 51.6938 tan h (0.18977 t)
∴ V(12) = 50.6715
V(100) ≈ 50.6938
−10
−10
−5
−5
0
0
5
5
sin ( )h θcos ( )h θ
tan ( )h θ
10
10
Example 2:
• Using a computer (or a calculator), the model can be used to generate a graphical
representation of the system.
20
v 1 m
/s
4
t1 S
40
60
08
Terminal velocity
12
Example of Numerical Modeling
• Numerical methods are those in which the mathematical problem is reformulated so it can
be solved by arithmetic operations.
E.g., the time rate of change of velocity mentioned earlier:
mg = cdV2
V= Cd
gm
Mathematical Modeling and Engineering Problem Solving 5
ii
ii
tt
tvtv
t
v
dt
dv
−−
=∆∆≈
+
+
1
1 )()( (a finite-difference approximation of the derivate at time ti)
Notice that t
v
dt
dv
t ∆∆=
→∆ 0lim
v t( )i
ti
v t( )i+1
t i + 1
∆v
∆t
0
True slope
t
. • Substituting the finite difference into the differential equation gives,
2v
m
Cdg
dt
dv −=
⇒ 2
1
1 )()()(
iii
ii tvm
cdg
tt
tvtv−=−
−
+
+
⇒ Solve for
step
)(
)(
oldnew
)()( 12
1 iiiii tt
xSlopem
tvCdg
tvtv −
⋅−
+=
+= ++(ti + 1 – ti)
This approach is formally called Euler’s method.
Applying Euler’s method in 2s intervals yields
20
v1 m
/s
4
t1 S
40
60
08
Terminal velocity
Exact analytical solution
Approximatenumericalsolution
12
Approximate slope
ii
ii
tt
tvtv
t
v
−−
=∆∆
+
+
1
1 )()(
6 Numerical and Statistical Methods
How do we improve the solution?
- Smaller steps.
1.3 CONSERVATION LAWS
Conservation laws form the basis of a variety of complicated and powerful model and are
conceptually easy to understand.
Conservation laws provide the foundation for many model functions.
They boil down to
Change = increase – decreases
Can be used to predict changes with respect to time by given it a special name “the time-
variant (or transient)” computation
If no change occurs, the increases and decreases must be in balance.
Change = 0 = increases – decreases
• It is given a special name, the “steady-state” calculation
Example : Fluid flow
Pipe 1
flow in = 100
Pipe 2
flow in = 80
Pipe 3
flow out = 120
Pipe 4
flow out = ?
Fig : A flow balance for steady incompressible fluid flow at the junction of pipes.
For steady-state incompressible fluid flow in pipes flow in = Flow out
• The flow out of the fourth pipe must be 60.
Table 1: Devices and types of balances that are commonly used in the four major areas of
engineering.
For each case, the conservation law upon which the balance is based is specified.