Numerical ch1

You might also like

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

July 2013

Numerical Methods
Chapter (1):
Mathematical Modeling and Engineering Problem Solving

Chapter (4):
Truncation Errors and the Taylor Series
Chapter (5):
Bracketing Methods
Chapter (6):
Open Methods
Chapter (9):
Gauss Elimination
Chapter (11):
Special Matrices and Gauss-Seidel

،‫ٍ يذهٕنح‬ٚ‫يركساخ شسح ٔذًاز‬


ِ‫د يٍ انًٕاد أدَا‬ٚ‫ايرذاَاخ ساتمح نهؼد‬
ِ‫ٍ انًركٕزٌ٘ أدَا‬ٛ‫يرادح يجاَا ًا ػهٗ انًٕلؼ‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Chapter 1

Mathematical Modeling and


Engineering Problem Solving

‫ ذثدأ‬ٙٓ‫ٍ ف‬ٛ‫ٍ ايسأذ‬ٛ‫إذا ُٔجدخ صدالح ت‬


.‫أٔ ذؤٔل انٗ اذذاد ضد ايسأج ثانثح‬

َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

The primary objective of this chapter is to introduce you to


mathematical modeling and its role in engineering problem solving.
A mathematical model can be defined as a formulation or
equation that expresses the essential features of a physical system or
process in mathematical terms.

𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑓𝑜𝑟𝑐𝑖𝑛𝑔
𝐷𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 , 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠,
=𝑓
𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑠
dependent variable: a characteristic that usually reflects the behavior
or state of the system.
independent variables: usually dimensions, such as time and space,
along which the system's behavior is being determined.
parameters: reflective of the system's properties or composition.
forcing functions: external influences acting upon the system.

Ex:
𝐹
𝑎= (𝟏. 𝟑)
𝑚

𝐚 = the dependent variable reflecting the system's


behavior.
F = the forcing function.
m = a parameter representing a property of the
system.
For this simple case there is no independent
variable because we are not yet predicting
،ٍٓ‫هؼٍ أشٔاج‬ٚ ‫أغهة انصٔجاخ‬
how acceleration varies in time or space. .‫هؼُٕا انصٔاج‬ٚ ‫ٔأغهة األشٔاج‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Other mathematical models of physical phenomena may be much


more complex, and either cannot be solved exactly or require more
sophisticated mathematical techniques than simple algebra for their
solution.
Ex:
To illustrate a more complex model of this kind,
Newton's second law can be used to determine the
terminal velocity of a free-falling body near the earth's
surface. Our falling body will be a parachutist (Fig.
1.2) A model for this case can be derived by expressing
the acceleration as the time rate of change of the
velocity (𝒅𝒗/𝒅𝒕) and substituting it into Eq. (1.3) to
yield
𝑑𝑣 𝐹
= (𝟏. 𝟒)
𝑑𝑡 𝑚
where 𝒗 is velocity (m/s) and t is time (s)
Thus, the mass multiplied by the rate of change of the velocity is
equal to the net force acting on the body. If the net force is positive, the
object will accelerate. If it is negative, the object will decelerate. If the
net force is zero, the object's velocity will remain at a constant level.
We will express the net force in terms of measurable variables and
parameters. For a body falling, the net force is composed of two
opposing forces: the downward pull of gravity 𝑭𝑫 and the upward force
of air resistance𝑭𝑼 : ‫إٌ انًسأج لد ذُمصٓا انشجاػح‬
F = FD + F U (1.5) ‫ح نالَرذاز نكُٓا ال ذصال ذهخ‬ٛ‫انكاف‬
.‫ ذفؼم أَد ذنك‬ٙ‫مك ك‬ٚ‫ك ٔذضا‬ٛ‫ػه‬
FD = mg (1.6)
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Air resistance can be formulated in:


𝐹𝑈 = −𝑐𝑣 (1.7)
Where c = a proportionality constant called the drag coefficient
(kg/s). Thus, the greater the fall velocity, the greater the upward force
due to air resistance.

The net force is the difference between the downward and upward
force. Therefore
𝑑𝑣 𝑚𝑔 − 𝑐𝑣
= (1.8)
𝑑𝑡 𝑚
Simplifying
𝑑𝑣 𝑐
=𝑔− 𝑣 (1.9)
𝑑𝑡 𝑚

Equation (1.9) is a model that relates the acceleration of a falling


object to the forces acting on it. It is a differential equation because it is
written in terms of the differential rate of change (𝒅𝒗/𝒅𝒕) of the
variable that we are interested in predicting.

calculus can be used to solve Eq. (1.9) for


𝑔𝑚
𝑣 𝑡 = 1 − 𝑒 − 𝑐/𝑚 𝑡 (1.10)
𝑐
where 𝒗 (t) = dependent variable
t = the independent variable
c and m = parameters
g = the forcing function

‫ إَٓا‬،ٙ‫ كاَد يغ شٔجر‬ٙ‫ألسٗ يؼازك‬


.‫ٍ ػايا‬ٚ‫يا شاند يسرًسج يُر ػشس‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Example 1.1 Analytical Solution to the Falling Parachutist Problem


Problem Statement: A parachutist of mass 68.1 kg jumps out of a
stationary hot air balloon. Use Eq. (1.10) to compute velocity prior to
opening the chute. The drag coefficient is equal to 12.5 kg/s.

Solution:
Inserting the parameters into Eq. (1.10) yields

9.8 (68.1)
𝑣 𝑡 = (1 − 𝑒 −(12.5/68.1) 𝑡 ) = 53.39 (1 − 𝑒 −0.18355 𝑡 )
12.5

which can be used to compute 𝒗

According to the model, A velocity of 44.87 m/s is attained after


10 s. after a sufficiently long time, a constant velocity, called the
terminal velocity, of 53.39 m/s is reached. This velocity is constant
because, the force of gravity will be in balance with the air resistance.
Thus, the net force is zero and acceleration has ceased.
ٍٚ‫ سٍ انؼشس‬ٙ‫ذظم انًسأج ف‬
.‫اذٓا‬ٛ‫درٗ آخس نذظح يٍ د‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Equation (1.10) is called an analytical, or exact, solution because


it exactly satisfies the original differential equation. Unfortunately,
there are many mathematical models that cannot be solved exactly. In
many of these cases, the only alternative is to develop a numerical
solution that approximates the exact solution.

Numerical methods are those in which the mathematical problem


is reformulated so it can be solved by arithmetic operations.

For Newton's second law by realizing that the time rate of change
of velocity can be approximated by (Fig. 1.4):

𝑑𝑣 ∆𝑣 𝑣 𝑡𝑖+1 − 𝑣 (𝑡𝑖 )
≅ = (1.11)
𝑑𝑡 ∆𝑡 𝑡𝑖+1 − 𝑡𝑖

Where ∆𝒗 and ∆𝒕 = differences in velocity and time, respectively,


computed over finite intervals, 𝒗 (𝒕𝒊 ) = velocity at an initial time 𝒕𝒊 ,
and 𝒗 (𝒕𝒊+𝟏 ) = velocity at some later time 𝒕𝒊+𝟏 . Note that 𝒅𝒗/𝒅𝒕 ≅
∆𝒗/∆𝒕 is approximate because ∆𝒕 is finite.

𝑑𝑣 ∆𝑣
= lim
𝑑𝑡 ∆𝑡→0 ∆𝑡 ْٕ ‫ذؼرمد تؼض انُساء أٌ انصٔاج‬
.‫دج نالَرماو يٍ انسجم‬ٛ‫انفسصح انٕد‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Equation (1.11) is called a finite divided difference approximation


of the derivative at time 𝒕𝒊 . It can be substituted into Eq. (1.9) to give

𝑣 𝑡𝑖+1 − 𝑣 𝑡𝑖 𝑐
=𝑔− 𝑣 𝑡𝑖
𝑡𝑖+1 − 𝑡𝑖 𝑚
This equation can then be rearranged to yield
𝑐
𝑣 𝑡𝑖+1 = 𝑣 𝑡𝑖 + 𝑔 − 𝑣 𝑡𝑖 (𝑡𝑖+1 − 𝑡𝑖 (1.12)
𝑚
If you are given an initial value for velocity at some time 𝒕𝒊 , you
can easily compute velocity at a later time 𝒕𝒊+𝟏 . This new value of
velocity at 𝒕𝒊+𝟏 can in turn be employed to extend the computation to
velocity at 𝒕𝒊+𝟐 and so on. Thus, at any time along the way:

New value = old value + slope × step size

Example 1.2
Problem Statement: perform the same computation as in example
1.1 but use Eq. (1.12) to compute the velocity. Employ a step size of 2 s
for the calculation.
Solution:
At the start of the computation (ti = 0), the velocity of the
parachutist is zero.
12.5
𝑣 = 0 + 9.8 − (0) 2 = 19.60 𝑚/𝑠
68.1

‫ٓا‬ٛ‫ًٕخ انسجم ف‬ٚ ٌ‫ذفضم انًسأج أ‬


.‫ًٕخ يُٓا تؼد ذنك‬ٚ ٌ‫ ٔأ‬،‫أٔالًا‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

For the next interval (from t = 2 to 4 s), the computation is


repeated
12.5
𝑣 = 19.60 + 9.8 − (19.60) 2 = 32.00 𝑚/𝑠
68.1
The calculation is continued in a similar fashion to obtain
additional values:

The results are plotted in Fig. 1.5 along with the exact solution.
There is some discrepancy between the two results. One way to
minimize such discrepancies is to use a smaller step size. For example,
applying Eq. (1.12) at 1-s intervals results in a smaller error. With the
aid of the computer, large numbers of calculations can be performed
easily. Thus, you can accurately model the velocity of the falling
parachutist without having to solve the differential equation exactly.

‫ذؼسف ػهٗ أفضم خًسح طسق‬


‫ ٔػًٕيا ًا‬،‫نهرؼايم يغ شٔجرك‬
.ٍٓ‫كهٓا ال ذجد٘ َفؼا يؼ‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Ex. Use calculus to solve Eq. (1.9) for the case where the initial
velocity. 𝒗(𝟎) is zero.

𝑑𝑣 𝑐
=𝑔− 𝑣 (1.9)
𝑑𝑡 𝑚

Solution:
𝑣 𝑡
𝑑𝑣
= 𝑑𝑡
𝑔 − 𝑐/𝑚 𝑣
0 0
1 𝑐 𝑣
ln 𝑔 − 𝑣 =𝑡
(−𝑐/𝑚) 𝑚 0
𝑐 𝑐𝑡
ln 𝑔 − 𝑣 − ln 𝑔 = −
𝑚 𝑚
𝑐
𝑔− 𝑣 𝑐𝑡
ln 𝑚 = −
𝑔 𝑚

𝑐
𝑔− 𝑣 𝑐𝑡
𝑚 = 𝑒− 𝑚
𝑔
𝑐 𝑐𝑡
𝑔− 𝑣 = 𝑔 𝑒− 𝑚
𝑚
𝑐 𝑐𝑡
𝑣 = 𝑔 − 𝑔 𝑒− 𝑚
𝑚
𝑚𝑔 𝑐𝑡
−𝑚
𝑣= 1−𝑒
𝑐
‫ٍ ػايا ًا نرذٕل‬ٚ‫ ايسأج ػشس‬ٙ‫ذمض‬
ٖ‫ ايسأج أخس‬،‫اتُٓا إنٗ زجم‬
.‫ٕيا‬ٚ ٍٚ‫ ػشس‬ٙ‫ذجؼهّ أدًك ف‬

َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Solution:

∆𝑡 = 1 𝑠 :

𝑐
𝑣 1 = 𝑣 0 + 𝑔− 𝑣 0 ∆𝑡
𝑚

12.5
𝑣 1 = 0 + 9.8 − 0 1 = 9.8 𝑚/𝑠
68.1

𝑣𝑡𝑟𝑢𝑒 = 53.39 1 − 𝑒 −0.18355 𝑡 1 = 8.933 𝑚/𝑠

𝑣𝑡𝑟𝑢𝑒 − 𝑣 𝑡𝑖+1
𝜀𝑡 = %
𝑣𝑡𝑟𝑢𝑒

8.953 − 9.8
= = 0.095 %
8.953

The calculations are continued in similar fashion:

step 𝑣 (10) 𝜀
2 47.969 6.9 %

1 46.364 3.32 %

0.5 45.604 1.63 %


ٌٕ‫ؼ‬ٛ‫سرط‬ٚ ‫ثالثح إَٔاع يٍ انسجال ال‬
‫ٕر‬ٛ‫ انشثاب ٔانش‬:‫فًٕٓا انًسأج‬ٚ ٌ‫أ‬
)‫ٍ؟‬ٛ‫ٔانكٕٓل (فاضم ي‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬
July 2013

Solution:

First jumper:

𝑔𝑚
𝑣= (1 − 𝑒 − 𝑐/𝑚 𝑡
)
𝑐
9.8 ∗ 70
= (1 − 𝑒 − (12/70) 10 )
12

= 46.87 𝑚/𝑠

Second jumper:
𝑔𝑚
𝑣= (1 − 𝑒 − 𝑐/𝑚 𝑡
)
𝑐

9.8 ∗ 75
46.87 = (1 − 𝑒 − (15/75) 𝑡 )
15

0.9566 = 1 − 𝑒 − 0.2 𝑡

𝑒 −0.2 𝑡 = 0.0435

− 0.2 𝑡 = ln 0.0435

𝑡 = 15.7 𝑠
ٍ‫ ٌء زائ ٌغ إذا نى ذك‬ٙ‫انؼهى ش‬
ٍٚ‫ُشرا‬ٚ‫ أنثسخ أ‬.ّٛ‫ذمراخ ػه‬
َٙٔ‫د اإلنكرس‬ٚ‫ أٔ تانثس‬9 4444 260 ‫ح‬ٛ‫ح تسسانح َص‬ٚ‫سجٗ انًساًْح تاإلتالؽ ػٍ أ٘ خطأ أٔ يالدظاخ ذساْا ضسٔز‬ٛ‫ح نهُفغ انؼاو ف‬َٛ‫انُٕذاخ يجا‬
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net ٍٛ‫شسح ٔيسائم يذهٕنح يجاَا ًا تانًٕلؼ‬ info@eng-hs.com 9 4444 260 ٌ‫ دًادج شؼثا‬.‫و‬

You might also like