Download presentation
Presentation is loading. Please wait.
1
Akar Persamaan (Roots of Equations)
Mata Kuliah : Analisis Numerik Kode : CIV - 208 SKS : 3 SKS Akar Persamaan (Roots of Equations) Pertemuan – 2, 3
2
Sub Pokok Bahasan : Metode Biseksi Metode Regula Falsi Simple Fixed-Point Iteration Metode Newton-Raphson Metode Secant
3
Years ago, we learned to use the quadratic formula to solve The values calculated with Eq. (1) are called the “roots” of Eq. (2). They represent the values of x that make Eq. (2) equal to zero. (1) (2)
4
Bracketing Methods This topic on roots of equations deals with methods that exploit the fact that a function typically changes sign in the vicinity of a root. These techniques are called bracketing methods because two initial guesses for the root are required. As the name implies, these guesses must “bracket,” or be on either side of, the root. The particular methods described herein employ different strategies to systematically reduce the width of the bracket and, hence, home in on the correct answer Three methods classified as Bracketing Methods are : graphical method, bisection method and the false-position method
5
Graphical Method A simple method for obtaining an estimate of the root of the equation f(x)=0 is to make a plot of the function and observe where it crosses the x axis. This point, which represents the x-value for which f(x)=0, provides a rough approximation of the root.
6
Example 1 : Use the graphical approach to determine the real root of : Various values of x can be substituted into the right-hand side of this equation to compute f(x), for example if x = 0, then f(x) = 4(0)3 – 6(0)2 + 7(0) – 2,3 = − 2,3 Try for another value of x, and tabulated the results x f(x) -2,3 0,1 -1,656 0,2 -1,108 0,3 -0,632 0,4 -0,204 0,5 0,6 0,604 0,7 1,032
7
These points are plotted in Figure
These points are plotted in Figure. The x value as a horizontal axes, and f(x) as a vertical axes Resulting curve crosses the x axis between 0,4 and 0,5. Visual inspection of the plot provides a rough estimate of the root of 0,45. root location
8
The validity of the graphical estimate can be checked by substituting it
which is close to zero, and x = 0,45 said as a root of
9
Bisection Method When applying the graphical technique in Example 1, we have observed that f(x) changed sign on opposite sides of the root. In general, if f(x) is real and continuous in the interval from xl to xu and f(xl) and f(xu) have opposite signs, that is, f(xl)f(xu)<0 then there is at least one real root between xl and xu.
10
Algorithm for the bisection calculation
11
Termination Criteria and Error Estimates
an approximate percent relative error εa can be calculated, as in where xrnew is the root for the present iteration and xrold is the root from the previous iteration. The absolute value is used because we are usually concerned with the magnitude of εa rather than with its sign. When εa becomes less than a prespecified stopping criterion εs, the computation is terminated.
12
Example 2 : Use bisection to solve the same problem approached graphically in Example 1, until the approximate error falls below a stopping criterion of εs =0.5%. Root of equation
13
The False-Position Method
A shortcoming of the bisection method is that, in dividing the interval from xl to xu into equal halves, no account is taken of the magnitudes of f(xl) and f(xu). For example, if f(xl) is much closer to zero than f(xu), it is likely that the root is closer to xl than to xu. An alternative method that exploits this graphical insight is to join f(xl) and f(xu) by a straight line. The intersection of this line with the x axis represents an improved estimate of the root. The fact that the replacement of the curve by a straight line gives a “false position” of the root is the origin of the name, method of false position, or in Latin, regula falsi. It is also called the linear interpolation method.
14
Using similar triangles, the intersection of the straight line with the x axis can be estimated as
which can be solved for
15
Example 3 : Use the false-position method to determine the root of the same equation investigated in Example 1. Root of equation
16
Home work (Group) Kerjakan soal dari buku Chapra Soal no. 5.15 5.16 5.17 5.20
17
For the bracketing methods, the root is located within an interval prescribed by a lower and an upper bound. Repeated application of these methods always results in closer estimates of the true value of the root. Such methods are said to be convergent because they move closer to the truth as the computation progresses In contrast, the open methods are based on formulas that require only a single starting value of x or two starting values that do not necessarily bracket the root
18
As such, they sometimes diverge or move away from the true root as the computation progresses (Fig. b). However, when the open methods converge (Fig. c), they usually do so much more quickly than the bracketing methods.
19
Simple Fixed-Point Iteration
Open methods employ a formula to predict the root. Such a formula can be developed for simple fixed-point iteration (or, as it is also called, one-point iteration or successive substitution) by rearranging the function f(x)=0 so that x is on the left-hand side of the equation: x=g(x) (1)
20
This transformation can be accomplished either by algebraic manipulation or by simply adding x to both sides of the original equation. For example,
21
The utility of Eq. (1) is that it provides a formula to predict a new value of x as a function of an old value of x. Thus, given an initial guess at the root xi, Eq. (1) can be used to compute a new estimate xi+1 as expressed by the iterative formula xi+1= g(xi) (2) the approximate error for this equation can be determined using the error estimator
22
Use simple fixed-point iteration to locate the root of
Example 1 : Use simple fixed-point iteration to locate the root of The function can be separated directly and expressed in the form
23
Starting with an initial guess of x0=0, this iterative equation can be applied to compute
Root of equation
24
The Newton-Raphson Method
Perhaps the most widely used of all root-locating formulas is the Newton-Raphson equation. If the initial guess at the root is xi, a tangent can be extended from the point [xi, f(xi)]. The point where this tangent crosses the x axis usually represents an improved estimate of the root.
25
the first derivative at x is equivalent to the slope
Which can be rearranged to yield Newton-Raphson formula : (3)
26
Use the Newton-Raphson method to estimate the root of
Example 2 : Use the Newton-Raphson method to estimate the root of employing an initial guess of x0 = 0 The first derivative of the function can be evaluated as f’(x)= 12x2 – 12x + 7, which can be substituted along with the original function into Eq. (3) to give
27
Starting with an initial guess of x0=0, this iterative equation can be applied to compute
Root of equation
28
Although the Newton-Raphson method is often very efficient, there are situations where it performs poorly. Fig. a depicts the case where an inflection point [that is, f’’(x)=0] occurs in the vicinity of a root. Fig. b illustrates the tendency of the Newton-Raphson technique to oscillate around a local maximum or minimum. Fig. c shows how an initial guess that is close to one root can jump to a location several roots away. Obviously, a zero slope [f’(x)=0] is truly a disaster because it causes division by zero in the Newton-Raphson formula (see Fig d)
29
The Secant Method A potential problem in implementing the Newton-Raphson method is the evaluation of the derivative. Although this is not inconvenient for polynomials and many other functions, there are certain functions whose derivatives may be extremely difficult or inconvenient to evaluate. For these cases, the derivative can be approximated by a backward finite divided difference, as in the following figure
30
This approximation can be substituted into Eq
This approximation can be substituted into Eq. (3) to yield the following iterative equation: (4)
31
Equation (4) is the formula for the secant method.
Notice that the approach requires two initial estimates of x. However, because f(x) is not required to change signs between the estimates, it is not classified as a bracketing method.
32
Example 3 : Use the Secant method to estimate the root of
,employing an initial guess of x0 = 0. Start with initial estimates of x−1 =0 and x0= 1.0. Root of equation
33
The Difference Between the Secant and False-Position Methods
The Eqs. Above are identical on a term-by-term basis. Both use two initial estimates to compute an approximation of the slope of the function that is used to project to the x axis for a new estimate of the root. However, a critical difference between the methods is how one of the initial values is replaced by the new estimate. False-Position Formula Secant Formula
34
Recall that in the false-position method the latest estimate of the root replaces whichever of the original values yielded a function value with the same sign as f(xr). Consequently, the two estimates always bracket the root. Therefore, the method always converges In contrast, the secant method replaces the values in strict sequence, with the new value xi+1 replacing xi and xi replacing xi−1. As a result, the two values can sometimes lie on the same side of the root. For certain cases, this can lead to divergence.
35
RESUME Method xroot Siteration ea(%) Bisection 0,4512 10 0,4329
False Position 0,4506 4 0,3612 x=g(x) 0,44856 7 0,47396 Newton Raphson 0,4501 6 0,001 Secant 3 0,402
36
Homework 1 Frekuensi alami dari getaran bebas (free vibration) balok uniform yang terjepit pada salah satu ujungnya dan bebas pada ujung yang lain dapat dicari dari persamaan berikut cos(L)cosh(L) = 1 Dengan : L = panjang elemen balok = 2 meter = berat jenis elemen balok wn = frekuensi alami balok (rad/dt) EI = kekakuan lentur balok Tetapkan 3 buah nilai n dari persamaan di atas. kemudian gunakan nilai untuk menentukan frekuensi alami balok.
37
Homework 2 HItunglah panjang kurva (L), dari suatu lengkung / busur jalan dengan parameter – parameter : PC = titik kurvatur, PT = titik tangensial, PI = titik perpotongan. Kurva mempunyai 7 elemen : 1. Radius kurva, R 2. Sudut lengkung, I 3. Jarak tangensial, T 4. Panjang kurva, L 5. Panjang busur, Lc 6. Ordinat tengah, M 7. Jarak luar, E Hubungan antara kelengkungan dan jari – jari : Diketahui nilai : E = 195 m, Lc = 650 m,
38
Homework 3 Hubungan antara debit air Q penampang saluran terbuka berbentuk trapesium terhadap parameter geometri penampang adalah : dengan : b = lebar dasar penampang y = ketinggian air z = kemiringan dinding S = kemiringan saluran N = angka Manning jika S = 0,009, n = 0,025, z = 0,15, b = 50 cm dan Qrencana = 0,83 m3/dt. Hitung besarnya y! b y
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.