FALSE POSITION METHOD

 



FALSE POSITION METHOD,


USE:

• Find root of contineous function of f(x).

APPROACH :

a) Find interval [a b] such that as

    • f(a) and (b) must have different Signs

      Somewhere in between must be Zero.


b) Compute Secant between  and b*f(b)).


c) Take point c which be present on Secant as well as x axis.


d) Replace a or b with matching.

   Sign of f(c)

   Such that F(a)*F(c)<0 or  F(b)*F(c)<0


 e)Repeat this_ process upto giver

  iterations.

  calculated C =(a*func(b)-b*func(a))/(func(b)-func(a));


  • FLOWCHART of FALSE position method


STEP 1)Take two points a and b , and find f(a)*f(b)<0


   
STEP 2) we draw Secant between f(a) and f (b) is secant
        AB line is a Secant.
        Now we choose C where secant cut to the X axis.


STEP 3) Cheak    func(c)*func(b)<0;

STEP 4) if_
         change the value of b
         with the value of c
         otherwise change the value of a
          with the value of c.
       
STEP 5) Similarly do_ same above process again & again upto given iteration

Important:- After doing this_ process  repeatedly we

            will get value of C at last
            which is very near to root of equation.    

 

#include<iostream>
#include<math.h>
using namespace std;

  float func(float x)  //User Define Funtion
float m= x*x*x-x-11;
      return m;    }

int main()
{ float a, b,c;
     
       a = 2;
       b = 3;
  
  cout<<"Funtion is X^3-X-11"<<endl;
 
  cout <<"initialization by two numbers "<<endl;
 
  cout<<"First initialization number = 2"<<endl;
  
  cout<<"secound initialization number = 3"<<endl;
  

   if( func(a)*func(b)>=0 )

    { cout<<"Roots are not present between initialization"<<endl;
           return 0;
     }
                      
    for(int i=1;i<10;i++)     
   
   {    c= (a*func(b)-b*func(a))/(func(b)-func(a));


        if (     func(c)*func(b)<0   )
              {  a=c; }
         else {  b=c; }
       
        if(func(c)==0)
         {break;}
    } 
      
   cout<<"\nApprox root of this function between 2 and 3 by using bisected method is "<<c;
  return 0;

}


Comments

Popular posts from this blog

Use of Recursion