July 2013
Chapter 25
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
Runge-Kutta Methods
July 2013
This chapter is devoted to solving ordinary differential equations of the
formdydx
=f (x , y )
We can use a numerical method to solve such an equation for the velocity
of the falling parachutist. The method is of the general form
New value = old value + slope × step size
or, in mathematical terms,y i+1= y i+∅ h
According to this equation, the slope estimate of ∅ is used to extrapolate
from an old value y i to a new value y i+1 over a distance h (next figure).
All one-step methods can be expressed in this general form, with the only
difference being the manner in which the slope is estimated. As in the
falling parachutist problem, the simplest approach is to use the differential
equation to estimate the slope in the form of the first derivative at xi.فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالة
اإللكتروني أو 9 4444 260 بالبريد Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
شعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرحeng-hs. net
July 2013
25.1 Euler’s Method
The first derivative provides a direct estimate of the slope at x i
(next figure)
∅=f (xi , y i )
where f (x i , y i ) is the differential equation evaluated at x i and y i.
This estimate can be substituted into
y i+1= y i+ f (x i , y i )h (25.2)
This formula is referred to as Euler’s Method. A new value of y is predicted
using the slope (equal to the first derivative at the original value of x)
to extrapolate linearly over the step size h. (previous figure)
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
دقيقه وأربعون خمسه احجزأسبوع كل أعمالك فىجدول
العميق . لالسترخاء
July 2013
EXAMPLE 25.1 Euler’s Method
Problem Statement:
Use Euler’s method to numerically integrate dydx
=−2 x3+12 x2−20 x+8.5
from x = 0 to x = 4 with a step size of 0.5. The initial condition at x = 0 is
y = 1. Recall that the exact solution is given by
y=−0.5x 4+4 x3+10 x2−8.5 x+1
Solution:
Equation (25.2) can be used to implement Euler’s Method:
y (0.5 )= y (0 )+ f (0 ,1 )0.5
where y(0) = 1 and the slope estimate at x = 0 is
f (0 ,1 )=−2(0)3+12(0)2−20 (0 )+8.5=8.5
y (0.5 )=1.0+8.5 (0.5 )=5.25
The true solution at x = 0.5 is
y=−0.5 (0.5 )4+4 (0.5 )3−10 (0.5 )2−8.5 (0.5 )+1=3.21875
Et=true−approximate=3.21875−5.25=−2.03125
Or, expressed as percent relative error, εt = -63.1%. For the second step,
y (1 )= y (0.5 )+ f (0.5 ,5.25 )
¿5.25+[−2 (0.5 )3+12 (0.5 )2−20 (0.5 )+8.5 ]0.5
¿5.875
The true solution at x = 1.0 is 3.0, and therefore, the percent relative error is -95.8%. The computation is repeated, and the results are compiled in the next table and the next figure. Note that the error can be reduced by using a smaller step size
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
الفلوريسون مصابيحتوفر مما% 80الحديثة
التقليدية المصابيح تستهلكه
July 2013
25.2 Improvements of Euler’s Method
A fundamental source of error in Euler’s method is that the derivative
at the beginning of the interval is assumed to apply across the entire
interval. Two simple modifications are available to help overcome this
shortcoming. Both modifications actually belong to a larger class of
solution techniques called Runge-Kutta methods.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
الربان هم كان إذاعلى المحافظة
السفينة، سالمه
July 2013
However, because they have a very straightforward graphical
interpretation, we will present them prior to their formal derivation as
Runge-Kutta methods.
25.2.1 Heun’s Method
One method to improve the estimate of the slope involves the
determination of two derivatives for the interval – one at the initial point
and another at the end point. The two derivatives are then averaged to
obtain an improved estimate of the slope for the entire interval.
This approach, called Heun’s method, is shown graphically in the next
figure.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
ممن ولو الحق اقبلوابغضالباطل تكرهه
July 2013
Recall that in Euler’s methods, the slope at the beginning of an interval
y i'=f (x i , y i)
is used to extrapolate linearly to y i+1 :
y i+10 = y i
❑+ f (x i , y i )h
For the standard Euler method we would stop at this point.
However, in Heun’s method the y i+10 calculated in the previous equation is
not the final answer, but an intermediate prediction.
This is why we have distinguished it with a superscript 0.
The previous equation is called a predictor equation. It provided an
estimate of yi+1 that allows the calculation of an estimated slope at the end
of the interval:
y i+1' =f (x i+ 1 , y i+10 )
Thus, the two slopes can be combined to obtain an average slope for the
interval:
y '=y i'+ y i+1
'
2 =f (x i , y i )+ f ( x i+1 , y i+10 )
2
This average slope is then used to extrapolate linearly from y i to y i+1using
Euler’s method:
y i+1= y i+f ( xi , y i )+f (x i+1 , y i+10 )
2 h
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
تعرف أن أردت إنبمجرد جيدا، نفسك
ما تذكر استيقاظكهو فهذا به تحلم كنت
July 2013
which is called a corrector equation.
The Heun method is a predictor-corrector approach.
The Heun method is the only one-step predictor-corrector method
described in this book. As derived above, it can be expressed concisely as
Predictor (previous figure a): y i+10 = y i+ f (x i , y i)h
Corrector (figure b): y i+1= y i+f ( xi , y i )+f (x i+1 , y i+10 )
2 h (25.16)
Note that because the previous equation has y i+1 on both sides of the
equal sign, it can be applied in an iterative fashion.
That is, an old estimate can be used repeatedly to provide an improved
estimate of y i+1. The process is shown in the next figure.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
لنفسك اجعلقصيرة راحة فترات
وقت خاللتنسى ال دراستك،
July 2013
It should be understood that this iterative process does not
necessarily converge on the true answer but will converge on an estimate
with a finite truncation error, as will be demonstrated in the following
example.
As with the similar iterative methods, a termination criterion for
convergence of the corrector is provided by
|εa|=| y i+1j − y i+1j−1
y i+1j |
where y i+1j−1 and y i+1j are the result from the prior and the present iteration of
the corrector, respectively.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
July 2013
EXAMPLE 25.5 Heun’s Method
Problem Statement:
Use Heun’s method to integrate y’ = 4e0.8x – 0.5y from x = 0 to x = 4 with a
step size of 1. The initial condition at x = 0 is y = 2.
Solution:
Before solving the problem numerically, we can use calculus to determine
the following analytical solution:
y= 413
(e0.8x−e−0.5 x )+2e−0.5x
This formula can be sued to generate the true solution values in the next
table
First, the slope at at (x0 , y0) is calculated as
y0'=4e0−0.5 (2 )=3
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
الخير، على غيرك دلأن تحب كما تماما
عليه اآلخرون يدلك
July 2013
This result is quite different from the actual average slope for the interval
from 0 to 1.0, which is equal to 4.1946, as
calculated from the differential equation.
Continue:
The numerical solution is obtained by using the predictor to obtain an
estimate of y at 1.0:
y10=2+3 (1 )=5
Note that this is the result that would be obtained by the standard Euler
method. The true value in the previous table shows that it corresponds to
a percent relative error of 19.3 percent.
Now, to improve the estimate for y i+1, we use the value y10 to predict
the slope at the end of the interval
y1'= f ( x1 , y10 )=4 e0.8 (1)−0.5 (5 )=6.402164
Which can be combined with the initial slope to yield an average slope
over the interval from x = 0 to 1
y '=3+6.4021642
=4.701082
which is closer to the true average slope of 4.1946.
This result can then be substituted into the corrector to give the prediction
at x = 1
y1=2+4.701082 (1 )=6.701082
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
التي الواجبات تكون غالباالتي الحقوق من أكثر عليك
بالواجبات أبدأ تستحقها،
July 2013
which represents a percent relative error of -8.18 percent.
Thus, the Heun method without iteration of the corrector reduces the
absolute value of the error by a factor of 2.4
as compared with Euler’s method.
Continue:
Now this estimate can be used to refine or correct the prediction of y1
by substituting the new result back into the right-hand side of equation
(25.16):
y1=2+[3+4e0.8(1)−0.5 (6.701082 )]
21=6.275811
which represents an absolute percent relative error of 1.31 percent.
This result, in turn, can be substituted back into equation (25.16) to
further correct:
y1=2+[3+4e0.8(1)−0.5 (6.275811)]
21=6.382129
which represents an |εt| of 3.03%.
Notice how the errors sometimes grow as the iterations proceed.
Such increases can occur, especially for large step sizes, and they prevent
us from drawing the general conclusion that an additional iteration will
always improve the result.
However, for a sufficiently small step size, the iterations should
eventually converge on a single value. For our case, 6.360865, which فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالة
اإللكتروني أو 9 4444 260 بالبريد Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
شعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرحeng-hs. net
تاريخ: يوافق اليوم الزوجة: الزوج سنفعل، ماذا زواجنا،
. حداد لنقفدقيقة
July 2013
represents a relative error of 2.68 percent, is attained after 15 iterations.
The previous table shows results for the remainder of the computation
using the method with 1 and 15 iterations per step.
In the previous example, the derivative is a function of both the
dependent variable y and the independent variable x.
For cases such as polynomials, where the ODE is solely a function of the
independent variable, the predictor step is not required and the corrector
is applied only once for each iteration. For such cases, the technique is
expressed concisely as
y i+1= y i+f ( xi )+ f (xi+1)
2h (25.18)
Notice the similarity between the right-hand side of the previous
equation and the trapezoidal rule. The connection between the two
methods can be formally demonstrated by starting with the ordinary
differential equationdxdy
=f (x)
This equation can be solved for y by integration:
∫yi
y i+1
dy=∫x i
x i+1
f ( x ) dx
which yields
y i+1− y i=∫x i
xi+1
f ( x )dx
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
هو الشخصالناجحاألساسشخص فييتخيل أن يستطيع
إلى خياله ويحول
July 2013
or
y i+1= y i+∫x i
x i+1
f ( x )dx (25.21)
Now, recall that the trapezoidal rule is defined as
∫x i
xi+1
f ( x )dx≅f ( xi )+ f (x i+1)
2h
where h = x i+1−x i. Substituting equations yields
y i+1= y i+f ( xi )+ f (xi+1)
2h
which is equivalent to equation 25.18
Because the previous equation is a direct expression of the
trapezoidal rule, the local truncation error is given by
Et=−f ' ' (ξ )12
h3
where ξ is between x i and x i+1.
Thus, the method is second order because the second derivative of
the ODE is zero when the true solution is quadratic.
In addition, the local and global errors are O(h3) and O(h2), respectively.
Therefore, decreasing the step size decreases the error at a faster rate
than for Euler’s method.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
مع محاضرة بيكتبوا طلبهيمسح ما كل الدكتور
الورقة يقطعوا السبورة
July 2013
The next figure, which shows the result of using Heun’s method to
solve the polynomial from example 25.1 demonstrates this behavior.
25.2.2 The Midpoint (or Improved Polygon) Method
The next figure illustrates another simple modification of Euler’s
method. Called the mid-point method, this technique uses Euler’s method
to predict a value of y at the midpoint of the interval (figure a):
y i+1 /2= y i+ f (x i, y i )h2
Then, this predicted value is used to calculate a slope at the midpoint:
y i+1 /2' =f (x i+1 /2 , y i+1/2 )
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
ما لكن شخصتحبه،كلمته وإذا تكلمه،
July 2013
which is assumed to represent a valid approximation of the average slope
for the entire interval. This slope is then used to extrapolate linearly from
x i to x i+1 (figure b):
y i+1= y i+ f (x i+1 /2 , yi+1/2 )h (25.27)
Observe that because y i+1 is not on both sides, the corrector cannot be
applied iteratively to improve the solution. This approach can also be
linked to Newton-Cotes integration formulas.
Recall that the simplest Newton-Cotes open integration formula,
which is called the midpoint method, can be represented as
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
من مكونة 24جملةالبد منقوط حرفغير
أكثر يوميا نكررها أنمرات؟ منعشر
July 2013
∫a
b
f ( x )dx=≅ (b−a ) f (x1 )
where x1 is the midpoint of the interval (a, b). Using the nomenclature for
the present case, it can be expressed as
∫x i
xi+1
f ( x )dx≅ h f (x i+1 /2)
Substitution of this formula into equation (25.21) yields the equation
(25.27). Thus, just as the Heun method can be called the trapezoidal rule,
the midpoint method gets its name from the underlying integration
formula upon which it is based.
The midpoint method is superior to Euler’s method because it utilizes
a slope estimate at the midpoint of the prediction interval.
25.3 Runge-Kutta Methods
Runge-Kutta (RK) methods achieve the accuracy of a Taylor series
approach without requiring the calculation of higher derivatives.
Many variations exist but all can be cast in the generalized form of
y i+ λ= y i+ϕ (xi , y i ,h )h
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
: أبناء عندها أحمد أم : برق، الثاني رعد، األول
فماذا: مطر، الثالثاسم يكون أن تتوقع
July 2013
where ϕ (x i , y i , h ) is called an increment function, which can be interpreted as
a representative slope over the interval.
The increment function can be written in general form asϕ=a1 k1+a2 k2+…+an kn
where the a’s are constants and the k’s are
k1=f (x i , y i )
k 2=f (x i+p1h , y i+q11k1h )
k3=f (x i+ p2h, y i+q21k1h+q22 k2h )
.
.
.
k n=f (x i+ pn−1h , y i+qn−1,1k1h+qn−1,2 k2h+…+qn−1 , n−1k n−1h )
where the p’s and q’s are constants.
Notice that the k’s are recurrence relationships. That is, k1 appears in
the equation for k2, which appears in the equation for k3, and so forth.
Because each k is a functional evaluation, this recurrence makes RK
methods efficient for computer calculations.
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
ذلك ومع تمكله أنت شيءأن دون اآلخرون يستخدمه
يستئذنوك؟
July 2013
Various types of Runge-Kutta methods can be devised by employing
different numbers of terms in the increment function as specified by n.
Note that the first-order RK method with n = 1 is, in fact, Euler’s method.
Once n is chosen, values for the a’s, p’s and q’s are evaluated by setting
equation (25.28) equal to terms in a Taylor series expansion.
Thus, at least for the lower-order versions,
the number of terms, n, usually represents the
order of the approach.
For example, second-order RK methods use an increment function with
two terms (n=2). These second-order methods will be exact if the solution
to the differential equation is quadratic, the local truncation error is O(h3)
and the global error is O(h2). The third- and forth- order RK methods
( n=3 and 4, respectively) are developed. For these cases, the global
truncation errors are O(h3) and O(h4) respectively.
25.3.1 Second-Order Runge-Kutta Methods
The second-order version of equation (25.28) is
y i+1= y i+ f (a1k1+a2k 2)h
where
k1=f (x i , y i )
k 2=f (x i+p1h , y i+q11k1h )
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
أبدا، ينتهي ال األمرالغاية دائما فهناك
التالي والهدف التالية،
July 2013
Values for a1, a2, p1, and q11 are evaluated by setting the previous equation
equal to a Taylor series expansion to the second-order term.
By doing this, we derive three equations to evaluate the four
unknown constants. The three equations area1+a2=1
a2 p1=12
a2q11=12
Because we have three equations with four unknowns, we must
assume a value of one of the unknowns to determine the other three.
Suppose that we specify a value for a2. Then the previous three equations
can be solved simultaneously fora1=1−a2
p1=q11=12a2
Because we can choose an infinite number of values for a2, there are
an infinite number of second-order RK methods. Every version would yield
exactly the same results if the solution to the ODE were quadratic, linear
or a constant. However, they yield different results when
(as is typically the case) the solution is more complicated. We present
three of the most commonly used and preferred versions:
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
ستفعله ما يكن لم إذاتفعله، فال صحيحا،
ما يكن لم وإذافال صادقا، ستقوله
July 2013
Heun Method with a Single Corrector (a2 = ½)
Thus, a1 = ½ and p1 = q11 = 1. These parameters when substituted, yield
y i+1= y i+( 12 k1+ 12 k 2)hwhere
k1=f (x i , y i )
k 2=f (x i+h , y i+k1h )
Note that k1 is the slope at the beginning of the interval and k 2 is the slope
at the end of the interval. Consequently, this second-order
Runge-Kutta is actually Heun’s technique without iteration.
The Midpoint Method (a2 = 1).
Thus, a1 = 0, p1 = q11 = ½, and that givesy i+1= y i+k2h
Where
k1=f (x i , y i )
k 2=f ( xi+ 12 h , y i+12 k1h)This is the midpoint method.
Ralston’s Method (a2 = 2/3)
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
اإلجابة يستطيع العقليجب ولكن األسئلة، على
أوال توجيهها الخيال على
July 2013
Choosing such value provides a minimal bound on the truncation error for
the second-order RK algorithms. For this version, a1 = 1/3, and p1 = 3/2 and
yields
y i+1= y i+( 13k¿¿1+ 2
3k¿¿2)h¿¿
Where
k1=f (x i , y i )
k 2=f ( xi+ 34 h , y i+ 34 k1h)
EXAMPLE 25.6 Comparison of Various Second-Order RK Schemes
Problem Statement:
Use the midpoint method and Ralston’s method to numerically integrate
f ( x , y )=−2 x3+12 x2−20 x+8.5
from x = 0 to x = 4 using a step size of 0.5. The initial condition at x = 0 is
y = 1. Compare the results with the values obtained using another
second-order RK algorithm, that is, the Heun method without corrector
iteration (next table).
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
الفرصفي تتخفى ما عادةلذلكال عملشاق، شكل
الناس معظم يتعرفعليها
July 2013
Solution:
The first step in the midpoint method is to compute
k1=−2 (0 )3+12 (0 )2−20 (0 )+8.5=8.5
However, because the ODE is a function of x only, this result has no
bearing on the second step, and compute
k 2=−2 (0.25 )3+12 (0.25 )2−20 (0.25 )+8.5=4.21875
Notice that this estimate of the slope is much closer to the average value
for the interval (4.4375) than the slope at the beginning of the interval
(8.5) that would have been used for Euler’s method.
The slope at the midpoint can then be substituted to predict
y (0.5 )=1+4.21875 (0.5 )=3.109375 εt=3.4 %
The computation is repeated, and the results are summarized in the next
figure and the previous table
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
أبدا، أستسلم إننياللي يقول عندما حتى
July 2013
For Ralston’s method, k1 for the first interval also equals 8.5 and
k 2=−2 (0.375 )3+12 (0.375 )2−20 (0.375 )+8.5=2.58203125
The average slope is computed by
ϕ=13
(8.5 )+ 23(2.58203125)
y (0.5 )=1+4.5546875 (0.5 )=3.27734375 εt=−1.82%
The computation is repeated, and the results are summarized in the
previous figure and table.
Notice how all the second-order RK methods are superior to Euler’s
method.
25.3.2 Third-Order Runge-Kutta Methods
For n = 3, a derivation similar to the one for the second-order method
can be performed. The result of this derivation is six equations with eight
unknowns. Therefore, values for two of the unknowns must be specified a
priori in order to determine the remaining parameters.
One common version that results is
y i+1= y i+16(k¿¿1+4 k¿¿2+k3)h¿¿
where
k1=f (x i , y i )
k 2=f ( xi+ 12 h , y i+12 k1h)فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالة
اإللكتروني أو 9 4444 260 بالبريد Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
شعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرحeng-hs. net
واحدة طريقة هناكبها، الفشل يمكنك
July 2013
k3=f (x i+h , y i−k1h+2k2h )
Note that if the derivative is a function of x only, this third-order
method reduces to Simpson’s 1/3 rule. The third-order RK methods have
local and global errors of O(h4) and O(h3), respectively, and yield exact
results when the solution is cubic. When dealing with polynomials, the
previous equations will be exact when the differential equation is cubic
and the solution is quadratic. This is because Simpson’s 1/3 rule provides
exact integral estimates for cubics.
25.3.3 Fourth-Order Runge-Kutta Methods.
The most popular RK methods are fourth order.
As with the second-order approaches, there are an infinite number of
versions. The following is the most commonly used form, and we
therefore call it the classical fourth-order RK method:
y i+1= y i+16(k¿¿1+2k¿¿2+2 k3+k4)h¿¿
where
k1=f (x i , y i )
k 2=f ( xi+ 12 h , y i+12 k1h)k3=f ( xi+ 12 h , y i+12 k2h)k3=f (x i+h , y i+k3h )
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
أفكاركهي من فكرة كل إنإلىقصر تضيفها لبنة
مشاريعك قبر إلى أو أحالمك
July 2013
Notice that for ODEs that are a function of x alone, the classical
fourth-order RK method is similar to Simpson’s 1/3 rule.
In addition, the fourth-order RK method is similar to the Heun approach in
that multiple estimates of the slope are developed in order to come up
with an improved average slope for the interval.
As shown in the next figure, each of the k’s represents a slope.
EXAMPLE 25.7 Classical Fourth-Order RK Method
Problem Statement:
(a) Use the classical fourth-order RK method to integrate
f ( x , y )=−2 x3+12 x2−20 x+8.5
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
, فادح والحرية الكرامة ثمنالسكوتعن ثمن ولكن
أفدح . واالستعباد الذل
July 2013
using a step size of = 0.5 and an initial condition of y = 1 at x = 0.
(b) Similarly, integrate
f ( x , y )=4 e0.8x−0.5 y
using h = 0.5 with y(0) = 2 from x = 0 to 0.5
Solution:
(a)Compute k1=8.5, k 2=4.21875, k3=4.21875 and k 4=1.25
y (0.5 )=1+{16 [8.5+2 (4.21875 )+2 (4.21875 )+1.25 ]}0.5 ¿3.21875
which is exact. Thus, because the true solution is a quartic, the
fourth-order method gives an exact result.
(b) The slope at the beginning of the interval is computed as
k1=f (0 ,2 )=4e0.8 (0 )−0.5 (2 )=3
This value is used to compute a value of u and a slope at the
midpoint,
y (0.25 )=2+3 (0.25 )=2.75
k 2=f (0.25 ,2.75 )=4e0.8(0.25 )−0.5 (2.75 )=3.510611
This slope in turn is used to compute another value of y and another
slope at the mid-point,
y (0.25 )=2+3.510611 (0.25 )=2.877653
k3=f (0.25,2 .877653 )=4e0.8 (0.25)−0.5 (2.877653 )=3.44678
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
تطيل أن تستطيع الأن يمكن ولكن حياتك
عرضا أكثر تجعلها
July 2013
Next, this slope is used to compute a value of y and a slope at the
end of the interval,
y (0.5 )=2+3.071785 (0.5 )=3.723392
k 4=f (0.5 ,3.723392 )=4 e0.8(0.5)−0.5 (3.723392 )=4.105603
Finally, the four slope estimates are combined to yield an average
slope. This average slope is then used to make the final prediction at
the end of the interval.
ϕ=16 [2+2 (3.510611 )+2 (3.446785 )+4.106603 ]=3.503399
y (0.5 )=2+3.503399 (0.5 )=3.751699
which compares favorably with the true solution of 3.751521.
Problem 25.7
Use the (a) Euler and (b) Heun (without iteration) methods to solved2 yd t2
=0.5 t+ y=0
where y(0) = 2 and y’(0) = 0. Solve from x = 0 to 4 using h = 0.1.
Solution
The second-order ODE is transformed into a pair of first-order ODEs as in dydt =z y (0 )=2
dzdt
=0.5 x− y z (0 )=0
(a) The first few steps of Euler’s method areفيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالة
اإللكتروني أو 9 4444 260 بالبريد Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
شعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرحeng-hs. net
July 2013
x y z dy/dx dz/dx0 2 0 0 -20.1 2 -0.2 -0.2 -1.950.2 1.98 -0.395 -0.395 -1.880.3 1.9405 -0.583 -0.583 -1.79050.4 1.8822 -0.76205 -0.76205 -1.68220.5 1.805995 -0.93027 -0.93027 -1.556
(b) For Heun (without iterating the corrector) the first few steps are
x y z dy/dx dz/dx yend zend dy/dx dz/dx ave slope0 2 0 0 -2 2 -0.2 -0.2 -1.95 -0.10.1 1.99 -0.1975 -0.1975 -1.94 1.97025 -0.3915 -0.3915 -1.87025 -0.29450.2 1.96055 -0.38801 -0.38801 -1.86055 1.921749 -0.57407 -0.57407 -1.77175 -0.481040.3 1.912446 -0.56963 -0.56963 -1.76245 1.855483 -0.74587 -0.74587 -1.65548 -0.657750.4 1.846671 -0.74052 -0.74052 -1.64667 1.772619 -0.90519 -0.90519 -1.52262 -0.822860.5 1.764385 -0.89899 -0.89899 -1.51439 1.674486 -1.05043 -1.05043 -1.37449 -0.97471
Problem 25.9
Solve from t = 0 to 3 with h = 0.1 using
(a) Heun (without corrector) and
(b) Ralston’s 2nd-order RK method:dydt
= y sin3(t) y (0 )=1
Solution
(a) The Heun method without iteration can be implemented as in the
following table:فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالة
اإللكتروني أو 9 4444 260 بالبريد Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
شعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرحeng-hs. net
July 2013
t y k1 yend k2
0 1 0 1 0.000995 0.000498
0.1 1.00005 0.000995 1.000149 0.007843 0.004419
0.2 1.000492 0.007845 1.001276 0.025841 0.016843
0.3 1.002176 0.025865 1.004762 0.059335 0.0426
0.4 1.006436 0.059434 1.012379 0.11156 0.085497
0.5 1.014986 0.111847 1.02617 0.184731 0.148289
2.9 3.784421 0.051826 3.789604 0.01065 0.031238
3 3.787545 0.010644 3.78861 0.000272 0.005458
Continue
(b) The Ralston 2nd order RK method can be implemented as in the
following table
t y k1 yint k2
0 1 0 1 0.000421 0.00028
0.1 1.000028 0.000995 1.000103 0.005278 0.003851
0.2 1.000413 0.007845 1.001001 0.020043 0.015977
0.3 1.002011 0.02586 1.00395 0.049332 0.041508
0.4 1.006162 0.059418 1.010618 0.096672 0.084254
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
ضرائب الكالم على كان لوثالثة عن الثرثارون لتخلى
July 2013
0.5 1.014587 0.111803 1.022972 0.164537 0.146959
2.9 3.785066 0.051835 3.788954 0.017276 0.028796
3 3.787946 0.010646 3.788744 0.001116 0.004293
Problem 25.10
Solve the following problem numerically from t = 0 to 3:dydt
=− y+t 2 y (0 )=1
Use the third-order RK method with a step size of 0.5
Solution
The solution results are as in the following table:
t y k1 k2 k3
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
الصحيحة األمور نعرفلكن بها، وننادي
بها نلتزم أن الصعب
July 2013
0 1 -1 -0.6875 -0.5625 -0.71875
0.5 0.640625 -0.39063 0.019531 0.144531 -0.02799
1 0.626628 0.373372 0.842529 0.967529 0.78517
1.5 1.019213 1.230787 1.735591 1.860591 1.67229
2 1.855358 2.144642 2.670982 2.795982 2.604092
2.5 3.157404 3.092596 3.631947 3.756947 3.562889
3 4.938848 4.061152 4.608364 4.733364 4.537995
فيرجى العام للنفع مجانية عن المساهمةالنوتات خطأ باإلبالغ ضرورية مالحظات أوأي نصية تراها برسالةاإللكتروني أو 9 4444 260 بالبريد
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economyشعبان. حمادة محلولة info@ eng-hs.com 260 4444 9م ومسائل , eng-hs. com بالموقعين مجاناشرح
eng-hs. net
: العبيد الناسأذالء معظموالسادة لسادتهم، أذالء
ألهوائهم أذالء