Forum chapter two Civil B

Forum chapter two Civil B

Number of replies: 3

Discuss the following basic idea of the chapter 

  1. Write the algorithms of all methods
  2. List the similarity and difference between all methods 



In reply to First post

Re: Forum chapter two Civil B

by Sinshawu Abate -

(1),

(a)algorithm of bisection method

Start

  1. Decide initial values for x1 and x2 and stopping criterion, E.
  2. Compute f1 = f(x1) and f2 = f(x2).
  3. If f1 * f2>0, x1 and x2 do not bracket any root and go to step 7;
    Otherwise continue.
  4. Compute x0 = (x1+x2)/2 and compute f0 = f(x0)
  5. If f1*f0 < 0 then
    set x2 = x0
    else
    set x1 = x0
    set f1 = f0
  6. If absolute value of (x2 – x1)/x2 is less than error E, then
    root = (x1 + x2)/2
    write the value of root
    go to step 7
    else
    go to step 4
  7. Stop
(b)algorithm of false position method

  1. Start
  2. Read values of x0, x1 and e
    *Here x0 and x1 are the two initial guesses
    e is the degree of accuracy or the absolute error i.e. the stopping criteria*
  3. Computer function values f(x0) and f(x1)
  4. Check whether the product of f(x0) and f(x1) is negative or not.
    If it is positive take another initial guesses.
    If it is negative then goto step 5.
  5. Determine:
    x = [x0*f(x1) – x1*f(x0)] / (f(x1) – f(x0))
  6. Check whether the product of f(x1) and f(x) is negative or not.
    If it is negative, then assign x0 = x;
    If it is positive, assign x1 = x;
  7. Check whether the value of f(x) is greater than 0.00001 or not.
    If yes, goto step 5.
    If no, goto step 8.
    *Here the value 0.00001 is the desired degree of accuracy, and hence the stopping criteria.*
  8. Display the root as x.
  9. Stop
(c)algorithm of fixed point method

Obtain a function f in the appropriate form (f(x)=0x=g(x)) and assume that a root α exists. Obtain an initial approximation x0, a maximum number of iterations, and an error tolerance ϵ.

For i=1,2,... up to the maximum number of iterations prescribed:

Step 1: Obtain the successive approximations by the fixed point method with the following formula:

(1)
xn+1=g(xn)

Step 2: Check the error tolerance:

(2)
xnxn1∣<ϵ

If the above inequality is true, then stop. xn is a good approximation of the root α. If the inequality above is false, then continue to compute successive approximations until the maximum number of iterations is reached. If the maximum number of iterations is reached and the error tolerance ϵ is not obtained, then print out a failure message.

(d)algorithm of newton's method

Obtain a function f and assume that a root α exists. Obtain an initial approximation x0 to this root. Also obtain a maximum number of iterations allowed and an error tolerance ϵ.

For i=1,2,... up to the maximum number of iterations prescribed:

Step 1: Obtain the successive approximations of the root α with the following formula:

(1)
xi=xi1f(xi1)f(xi1)

Step 2: Check the error tolerance:

(2)
xnxn1∣<ϵ

If the above inequality does not hold, then continue to obtain successive approximations for α. If the above inequality is true, then further verify the accuracy of xn. Check that to see whether or not:

(3)
f(xn+ϵ)f(xnϵ)<0

If the signs of f(xn+ϵ) and f(xnϵ) are opposites of each other, then the accuracy of xn is verified and stop the algorithm. xn is a good approximation to α. If the signs of f(xn+ϵ) and f(xnϵ) are the same, then α is not contained in the small interval [xnϵ,xn+ϵ]. Print out an error message.

If the maximum number of iterations is reached, then print our a failure message.


(e)secant method algorithm

  1. Start
  2. Get values of x0, x1 and e
    *Here x0 and x1 are the two initial guesses
    e is the stopping criteria, absolute error or the desired degree of accuracy*
  3. Compute f(x0) and f(x1)
  4. Compute x2 = [x0*f(x1) – x1*f(x0)] / [f(x1) – f(x0)]
  5. Test for accuracy of x2
    If [ (x2 – x1)/x2 ] > e, *Here [ ] is used as modulus sign*
    then assign x0 = x1 and x1 = x2
    goto step 4
    Else,
    goto step 6
  6. Display the required root as x2.
  7. Stop
(2)

How to compare between two different numerical methods which these methods have same Big O, i.e local truncation error to show that the one numerical method producing better results in comparison to another method by theories tools


In reply to First post

Re: Forum chapter two Civil B

by Adane Arage -

 


                             1.List all the Algorithm Method

    a)bisection method


    b)False position(Regular false) method


    c)Fixed point iteration method


    d)Newton method


    e)scant method


   2.similarity and Difference  between the all Algorithm

      1.Bisection method


@It is one of the most basic problem of numerical approximation


@its process of dividing aset continually in half to search for the solution to acertain problem


@It states if f(x) is acontious function defined on the interval (ao.bo) then there is aroot b/n p1 and p2


    2.Newton Raphson method


@It is one of the well known numerical approaches for solving aroot-finding problem


@It is the shortest of all methods


  3.Secant method


.This method uses asecant line joining two points that cut curves function


.The secant method is avariant of Newton's method where f(xn) is replaced by its finite difference approximation based on the evaluated function value at xn and athe previous iteration xn-1


   4.False poison method


.In this technique one uses result that are known to be false to converge to the true root


.This method chooses an initial approximations p0 and p1 such that f(p0).f(p1)<0


   5.Fixed point iteration method


.Fixed point: apoint say S is called affixed point if it sasifies the equation x=g(x)


.Fixed point iteration: the transcendental equation f(x)=0 can be converted