Week 7 - موقع المهندس حماده شعبان · Week 7 Numerical Methods ... Which is...
Transcript of Week 7 - موقع المهندس حماده شعبان · Week 7 Numerical Methods ... Which is...
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (1) 26044449 م. حمادة شعبان
امنح الناس دائما أكثر مما
يتوقعون الحصول عليه.
Integration Formulas
Week 7
Numerical Methods
النوميركالنوت
. أجزاءعشرة تتكون النوت من
على كل أسبوع نوتيحتوي
من ألمثلة وتمارينشرح وحلول
سابقة.هوموركات وامتحانات
شرح النوت فيديو متوفر على قناتكم
HS Engineers
تابعونا ليصل لكم كل جديد
حقوق النوت
حقوق النسخ أتيحلتعميم الفائدة فإني
لكل وشروحات الفيديو وإعادة اإلصدار
لبعض األجزاء أو الكل. سواء البشر
(00965-26094444واتساب )
يتم تنقحة النوت وتحديثها
دوري.وإضافة الجديد إليها بشكل
.نتشوق النتقادك الهادف
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (2) 26044449 م. حمادة شعبان
Integration Formulas
The Newton–Cotes formulas are the most common numerical
integration schemes.
They are based on a strategy of replacing a complicated function or
tabulated data with an approximating function that is easy to integrate:
( ) ∫
( ) ( )
Where ( ) = a polynomial of the form
( )
Where ( ) is the order of the polynomial.
For example, in next figure ( ), a first-
order polynomial (a straight line) is used
as an approximation.
In the second figure, three straight-
line segments are used to approximate
the integral.
Higher-order polynomials can be utilized
for the same purpose.
الطريق الصقحيح أحيانقا البعض يختار
.لمجرد أن الطري الخاطئ ليس متاحا
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (3) 26044449 م. حمادة شعبان
21.1 THE TRAPEZOIDAL RULE
The trapezoidal rule is the first degree of the Newton-Cotes formulas.
It corresponds to the case where the polynomial is first order:
( ) ( ) ( )
( )
Which is called the trapezoidal rule.
21.1.1 Error of the Trapezoidal Rule
When we employ the integral under a straight-line segment to
approximate the integral under a curve, we obviously can face an error
that may be clearer in the next figure.
An estimate for the local truncation
error of a single application of the
trapezoidal rule is:
( )( ) ( )
Where lies somewhere in the interval from to .
Previous equation indicates that if the function being integrated is
linear, the trapezoidal rule will be exact. Otherwise, for functions with
second – and higher – order derivatives (that is, with curvature) will
have some error. كلما كان الرجل كسوال زادت
خططه في يوم الغد.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (4) 26044449 م. حمادة شعبان
EXAMPLE 21.1 Single Application of the Trapezoidal Rule
Problem Statement:
Use trapezoidal rule equation numerically to integrate:
( )
From to . Recall that the exact value of the integral can be
determined analytically to be 1.640533.
Solution:
The function values
( )
( )
Can be substituted into previous equation to yield
This represents an error of:
Which corresponds to a percent relative error of .
The reason for this large error is evident from the previous figure. Notice
that the area under the straight line neglects a significant portion of the
integral lying above the line.
يجتمع على الكاسل عقابان:
فشله ونجاح اآلخرين.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (5) 26044449 م. حمادة شعبان
One way to improve the accuracy of the trapezoidal rule is to divide
the integration interval from to into a number of segments and
apply the method of each segment.
The areas of individual segments can then be added to yield the
integral for the entire interval.
The resulting equations are called multiple-application.
Next figure shows the general format we will use to characterize
multiple-application integrals.
There are equally spaced base points
( ). Constantly, there
are segments of equal width:
( )
If a and b are designated as And , respectively, the total integral
can be represented as:
∫ ( )
∫ ( )
∫ ( )
( )⏟
( ) ∑ ( ) ( )
⏟
( )
If the number of segments is doubled, the truncation error will be quartered.
أن يقوم بتقويم اآلخرين. ينحنيال يمكن لمن
21.1.2 The Multiple–Application Trapezoidal Rule
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (6) 26044449 م. حمادة شعبان
EXAMPLE 21.2 Multiple–Application of Trapezoidal Rule Problem Statement:
Use the two-segment trapezoidal rule to estimate the integral of
( )
From a = 0 to b = 0.8. Recall that the correct value for the integral is
1.640533.
Solution:
( )
( ) ( ) ( )
( )
The results of the previous example,
along with three-through ten-segment
applications of the trapezoidal rule, are
summarized in table.
Notice how the error decreases as
the number of segments increases.
However, also notice that the rate of
decrease is gradual.
This is because the error is inversely related to the square of n.
Therefore, doubling the number of segments quarters the error.
البعض يرى الحياة مجرد تنافس في أن
تكون الجاني ليس المجني عليه.
( )
2 0.4 1.0688 34.9
3 0.2667 1.3695 16.5
4 0.2 1.4848 9.5
5 0.16 1.5399 6.1
6 0.1333 1.5703 4.3
7 0.1143 1.5887 3.2
8 0.1 1.6008 2.4
9 0.0889 1.6091 1.9
10 0.08 1.6150 1.6
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (7) 26044449 م. حمادة شعبان
21.2 SIMPSON’S RULES
another way to obtain a more accurate estimate of an integral is to
use higher-order polynomials to connect the points.
For Example, if there is an extra point
midway between ( ) And ( ), the
three points can be connected with a
parabola (figure a). If there are two
points equally spaced between ( ) And
( ), the four points can be connected
with a third-order polynomial (figure b).
The formulas that result from taking
the integrals under these polynomials
are called Simpson’s rules.
Simpson’s 1/3 rule can be expressed
using the format of the integral estimate:
( )⏟
( ) ( ) ( )
⏟
( )
Where , and the point midway between and ,
which is given by ( ) .
البعض يهمه االنضمام إلى الجمهور
أكثر من انضمامه إلى الح .
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (8) 26044449 م. حمادة شعبان
EXAMPLE 21.4 Single Application of Simpson’s 1/3 Rule Problem Statement:
Use Simpson’s Rule to integrate
( )
From a = 0 to b = 0.8. Recall that the exact integral is 1.640533.
Solution:
( ) ( ) ( )
Therefore, Eq. (21.15) can be used to compute
( )
Which is approximately 5 times more accurate than for a single
application of the trapezoidal rule.
21.2.2 The Multiple-Application Simpson’s 1/3 Rule
Just as with the trapezoidal rule, Simpson’s rule can be improved by
dividing the integration interval into a number of segments of equal width:
( )⏟
( ) ∑ ( ) ∑ ( ) ( )
⏟
( )
Notice that, as illustrated in
the previous figure, an even
number of segments must be
utilized to implement the method.
أنت اآلن مجموع خيارات عمرك السابقة.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (9) 26044449 م. حمادة شعبان
EXAMPLE 21.5 Multiple-Application Version of Simpson’s 1/3 Rule
Problem Statement:
Use Eq. with n = 4 to estimate the integral of (21.18)
( )
From a = 0 to b = 0.8. Recall that the exact integral is 1.640533.
Solution:
( )
( ) ( )
( ) ( )
( )
From Eq. (21.19),
( ) ( )
The previous example illustrates that the application version of
Simpson’s 1/3 rule yields very accurate results. For this reason, it is
considered superior to the trapezoidal rule for most applications.
However, it is limited to cases where the values are equispaced.
Further, it is limited to situations where there are an even number
of segments and an odd number of points. Consequently, an
oddsegment-even-point formula known as Simpson’s 8/3 rule is used in
conjunctions with the 1/3 rule to permit evaluation of both even and
odd numbers of segments. حتى إذا فعل مليون شخص فعال
أحمقا، سيزال هذا الفعل أحمقا؟
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (11) 26044449 م. حمادة شعبان
21.2.3 Simpson’s 3/8 Rule
[ ( ) ( ) ( ) ( )]
Where ( ) . This equation is called Simpson’s 3/8 rule
because h is multiplied by 3/8.
The 3/8 rule can also be expressed as:
( )⏟
( ) ( ) ( ) ( )
⏟
( )
Simpson’s 1/3 rule is usually the method of preferences because it
attains third-order accuracy with three points rather than the four
points required for the 3/8 version. However, the 3/8 rule has utility
when the number of segments is odd.
Suppose that you desired an estimate for
five segments. Apply Simpson’s 1/3 rule to
the first two segments and Simpson’s 3/8
rule to the last three (next fig.). In this way,
we could obtain an estimate with third-order
accuracy across the entire interval.
قد ال يحول ضميرك بين وقوعك في ظلم أحد،
لكن دعه يحولك من أن تتلذذ بهذا الظلم.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (11) 26044449 م. حمادة شعبان
EXAMPLE 21.6 Simpson’s 3/8 Rule Problem Statement: (a) Use Simpson’s 3/8 rule to integrate:
( )
From to .
(b) Use it in conjunction with Simpson’s 1/3 rule to integrate the same function for five segments.
Solution: (a) A single application of Simpson’s 3/8 rule requires four equally spaced points, (3 segments)
( ) ( )
( ) ( )
Using Eq. (21.20),
( )
The data needed for a five-segment application (h = 0.16) is:
( ) ( )
( ) ( )
( ) ( )
The integral for the first two segments is obtained using Simpson’s 1/3 rule:
( )
For the last three segments, the 3/8 rule can be used to obtain:
( )
The total integral is computed by summing the two results:
يخدع المظهر األول الكثيرين.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (12) 26044449 م. حمادة شعبان
21.3 INTEGRATION WITH UNEQUAL SEGMENTS
To this point, all formulas for numerical integration have been based
on equally spaced data points.
In practice, there are many situations where this assumption does
not hold and we must deal with unequal-sized segments.
Problem 21.13
The function ( ) Can be used to generate the following
table of unequally spaced data:
X 0 0.05 0.15 0.25 0.35 0.475 0.6
F(x) 2 1.8555 1.5970 1.3746 1.1831 0.9808 0.8131
Evaluate the integral from a = 0 to b = 0.6 using
(a) Analytical means,
(b) The trapezoidal rule,
(c) A combination of the trapezoidal and Simpson’s rules.
Employ Simpson’s rules whenever possible to obtain the highest
accuracy. For (b) and (c), compute the percent relative error ( .).
Solution
(a) Analytical solution:
∫
[ ] ( )
تعلققم اسققتخدام االختصققارات ألنققاء الكتابققة فققي
المحاضرات، وقم بعمل اختصارات خاصة بك.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (13) 26044449 م. حمادة شعبان
(b) Trapezoidal rule
( )
( )
( )
( )
( )
( )
|
|
(c) Trapezoidal/Simpson’s rules
( )
( ) ( )
( ) ( )
|
|
لن تبرح مكانك، إال بعد أن
تقرر إلي أين ستذهب.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (14) 26044449 م. حمادة شعبان
Problem 21.2
Evaluate the following integral:
∫ ( )
(a) Analytically.
(b) Single application of the trapezoidal rule.
(c) Multiple-application trapezoidal rule, with and 4.
(d) Single application of Simpson’s 1/3 rule.
(e) Multiple-application of Simpson’s 1/3 rule, with .
(f) Single application of Simpson’s 3/8 rule.
(g) Multiple-application of Simpson’s 3/8 rule, with .
For each of the numerical estimates (b) through (g), determine the
percent relative error based on (a).
Solution
(a) Analytical solution:
∫ ( ) ⁄
[ ] ⁄
( ⁄ ) ( ⁄ )
(b) Trapezoidal rule ( ):
( )
|
|
يمكنك أن تدفع ماال في شراء كلب ضخم، لكن
العطف وحده هو الذي يدفعه ليهز لك ذيله.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (15) 26044449 م. حمادة شعبان
Continue:
(c) Trapezoidal rule ( ):
( ) ( )
Trapezoidal rule ( ):
( ) ( )
(d) Simpson’s 1/3 rule:
( ) ( )
(e) Simpson’s rule ( ):
( ) ( ) ( )
(f) Simpson’s 3/8 rule:
( ) ( )
(g) Simpson’s 3/8 rules ( ):
( ) ( )
( ) ( )
إن العققققالم يفسققققح الطريقققق للمققققرء
الذي يعرف إلى أين هو ذاهب.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (16) 26044449 م. حمادة شعبان
Problem 21.10
Evaluate the integral of the following tabular data with
(a) The trapezoidal rule.
(b) Simpson’s rules.
X 0 0.1 0.2 0.3 0.4 0.5
F(x) 1 8 4 3.5 5 1
Solution
(a) Trapezoidal rule ( ):
( ) ( )
(b) Simpson’s rules ( ):
( ) ( )
( )
( )
ال يهم ما يحدث في حياتك طالما
أن ذلك ال يؤلر على أهدافك.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (17) 26044449 م. حمادة شعبان
22.2 Romberg Integration
Romberg integration is one technique that is designed to attain
efficient numerical integrals of functions. It is based on successive
applications of the trapezoidal rule. However, through mathematical
manipulation, superior results are attained for less effort.
Thus, we have developed an estimate of the truncation error in terms of
the integral estimates and their step sizes. This estimate can then be
substituted into:
( ) ( )
To yield an improved estimate of the integral:
( )
(
)
[ ( ) ( )] ( )
It can be shown that the error of this estimate is ( ). we can combine two trapezoidal rule estimates of ( ) to yield a new estimate of ( ). For the special case where the interval is halved
(
), this equation becomes:
EXAMPLE 22.1 Error Corrections of the Trapezoidal Rule Problem Statement:
Using trapezoid integration methods to evaluate
( ) from to
. Yielded the following results:
Segments h integral
1 0.8 0.1728 89.5
2 0.4 1.0688 34.9
4 0.2 1.4848 9.5
( )
( ) ( )
Use this information to improve estimates of the integral.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (18) 26044449 م. حمادة شعبان
Solution:
The estimates for one and two segments can be combined to yield:
( )
( )
which is superior to the estimates upon which it was based.
The estimates for two and four segments can be combined to give:
( )
( )
Equation (22.4) provides a way to combine two applications of the
trapezoidal rule with error ( ) to compute a third estimate with error
( ). This approach is a subset of a more general method for
combining integrals to obtain improved estimates.
For instance, in example 22.1, we computed two improved integrals
of ( ) on the basis of three trapezoidal rule estimates. These two
improved estimates can, in turn, be combined to yield an ever better
value with ( ).
For the special case where the original trapezoidal estimates are
based on successive halving of the step size, the equation used for
( ) accuracy is:
( )
where and are the more and less accurate estimates,
respectively.
Similarly, two ( ) results can be combined to compute an integral
that is ( ) using:
( )
الرجال يحلمون قبل الزواج،
ويستيقظون بعده.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (19) 26044449 م. حمادة شعبان
Problem 22.2
Use Romberg integration to evaluate
∫ (
)
to an accuracy of based on Eq. (22.9).Your results should be
presented in the form of fig.(22.3) Use analytical solution of the integral
to determine the percent relative error of the result obatained with
Romberg integration. Check that is less than the stopping criterion .
Solution
Analytical solution:
∫ (
)
[
]
The first iteration involves computing 1 and 2 segment trapezoidal rules
and combining them as
( )
The computation can be continues as in the following table until a < 0.5%.
1 2 3
n a 1.6908% 0.0098% 1 27.62500000 25.87500000 25.83456463 2 26.31250000 25.83709184 4 25.95594388
The true error of the final result can be computed as:
|
|
الرجل بين مصيبتين: إما أن
يبقى عازبا أو أن يتزوج.
April 2016
(HS Engineers( للعديد من المواد على قناتكم )مجاناشرح فيديو )
net.hs-eng ,com.hs-engبالموقعين مجانا النوتات متوفرة hs.com-enginfo@ (21) 26044449 م. حمادة شعبان
Problem 22.1
∫
Compare and .
Solution
Analytical solution:
∫
[ ]
1 2 3 4
t 5.8349% 0.1020% 0.0004%
n a 26.8579% 0.3579% 0.0015862% 1 90.38491615 43.57337260 41.21305531 41.17125852 2 55.27625849 41.36057514 41.17191160 4 44.83949598 41.18370307 8 42.09765130
Problem 22.3
Use Romberg integration to evaluate
∫
to an accuracy of .
Solution
1 2 3
n a 7.9715% 0.0997% 1 1.34376994 1.97282684 1.94183605 2 1.81556261 1.94377297 4 1.91172038
يتطلب األمقر أدلقة كثيقرة إللبقات ذكائقك،
لكن يكفي دليل واحد إللبات عكس ذلك.