SlideShare una empresa de Scribd logo
1 de 16
ROOTS OF EQUATION
Graphical analysis is the simplest method for obtaining results in both life data and accelerated life testing analyses. Although they have limitations in general graphical methods are easily implemented and easy to interpret. The graphical method for estimating the parameters of accelerated life data involves generating two types of plots. First, the life data at each individual stress level are plotted on a probability paper appropriate to the assumed life distribution.  GRAPHIC METHOD this method is very simple and is well known to better illustrate , i will make an example.
EXAMPLE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  bisection method  is a root-finding algorithm which repeatedly bisects an interval then selects a subinterval in which a root must lie for further processing. It is a very simple and robust method, but it is also relatively slow. The method is applicable when we wish to solve the equation for the scalar variable  x , where  f  is a continuous function. The bisection method requires two initial points  a  and  b  such that  f ( a ) and  f ( b ) have opposite signs. This is called a bracket of a root, for by the intermediate value theorem the continuous function  f  must have at least one root in the interval ( a ,  b ). The method now divides the interval in two by computing the midpoint  c  = ( a + b ) / 2 of the interval. Unless  c  is itself a root--which is very unlikely, but possible--there are now two possibilities: either  f ( a ) and  f ( c ) have opposite signs and bracket a root, or  f ( c ) and  f ( b ) have opposite signs and bracket a root.  BISECTION METHOD
We select the subinterval that is a bracket, and apply the same bisection step to it. In this way the interval that might contain a zero of  f  is reduced in width by 50% at each step. We continue until we have a bracket sufficiently small for our purposes. This is similar to the computer science Binary Search, where the range of possible solutions is halved each iteration. Explicitly, if  f ( a )  f ( c ) < 0, then the method sets  b  equal to  c , and if  f ( b )  f ( c ) < 0, then the method sets  a  equal to  c . In both cases, the new  f ( a ) and  f ( b ) have opposite signs, so the method is applicable to this smaller interval. A practical implementation of this method must guard against the uncommon occurrence that the midpoint is indeed a solution. ,[object Object],[object Object],[object Object]
EXAMPLE ,[object Object],[object Object],xi = 12,  xs = 16 xr = (12+16)/2 = 14, xr = xs f(xi) = f(12) = 6.067 f(xr) = f(14) = 1.5687 f(xi) f(xr) = (6.067)( 1.5687) > 0, la raíz se encuentra en el subintervalo superior, xi = xr n = 2 xi = 14, xs = 16 , xr = 15 f(xi) = f(14) = 1.5687 f(xr) = f(15) = -0.4248 f(xi) f(xr) = (1.5687)( -0.4248) < 0, la raíz se encuentra en este subientervalo, xs = xr Ea = {15-14/15} x 100 = 6.667 %
EXAMPLE n = 3  xi = 14, xs = 15 , , xr = 14.5 f(xi) = f(14) = 1.5687 f(xi) =f(14.5)= 0.5523 f(xi) f(xi) > 0, xi = xr Ea = {14.5-15/14.5} x 100 = 3.448 % n = 4  xi = 14.5, xs = 15 , , xr = 14.75 f(xi) = f(14.5) = 0.5523 f(xi) =f(14.75)= 0.05896 f(xi) f(xi) > 0, xi = xr Ea = {14.75-14.5/14.75} x 100 = 1.695 % n = 5  xi = 14.75, xs = 15 , , xr = 14.875 f(xi) = f(14.75) = 0.5896 f(xi) =f(14.87)= -0.1841 f(xi) f(xi) < 0, xs= xr Ea = {14.875-14.75/14.875} x 100= 0.840 % n = 6 xi = 14.75, xs = 14.875 , , xr = 14.8125 Ea = {14.8125-14.875/14.8126} x 100= 0.4219 % Ea <  0.422% < 0.5 % xr = 14.8125
EXAMPLE iteración Xi Xs Xr Ea % 1 12 16 14 6.667 2 14 16 12 3.448 3 14 15 14.5 1.695 4 14.5 15 14.75 0.480 5 14.75 15 14.875 0.422 6 14.75 14.875 14.8125 0.032
BISECTION METHOD CODE IN JAVA import java.io.*;  class pruebaBisecc  {  public static void impResult(double a,double b, Biseccion bisecc , Evaluar e)  {  bisecc.asignarDatos(a,b);  System.out.println(&quot;Evaluacion de intervalo : [ &quot; + a + &quot; , &quot; + b + &quot; ]&quot;);  System.out.println(&quot;f(&quot; + a + &quot;) : &quot; + e.f(a));  System.out.println(&quot;f(&quot; + b + &quot;) : &quot; + e.f(b));  System.out.println(&quot;raiz : &quot; + bisecc.raiz(e));  System.out.println(&quot;Numero de iteraciones : &quot; + bisecc.numIteraciones());  }  public static void main(String arg[])  {  Biseccion b = new Biseccion();  /* polinomio : (x-3)(x+2)(x-1) = 6 - 5x - 2x^2 + x^3 */  double coef[] = { 6.0 , -5.0 , -2.0 , 1.0 };  EvalPolinomio ep = new EvalPolinomio(coef);  System.out.println(&quot;Polinomio : &quot; + ep.toString(&quot;x&quot;));  impResult(1.8 , 3.9 , b , ep);  impResult(-3.3 , -1.0 , b , ep);  impResult(-0.2 , 1.6 , b , ep);  System.out.println();  }  }  class Polinomio  {  private double arr[];  public Polinomio(int grado)  {  arr = new double[grado + 1];  }
BISECTION METHOD CODE IN JAVA public Polinomio(double coef[])  {  this(coef.length - 1);  for(int i = 0; i < coef.length; i++)  arr[i] = coef[i];  }  public void asignarCoeficientes(double coef[])  {  for(int i = 0; i < coef.length; i++)  arr[i] = coef[i];  }  public double []obtenerCoeficientes()  {  return arr;  }  public double obtenerCoef(int posicion)  {  return arr[posicion];  }  public void asignarCoef(int posicion, double valor)  {  arr[posicion] = valor;  }  public double evaluar(double t)  {  double s = 0.0;  for(int i = 0; i < arr.length; i++)  s += arr[i] * Math.pow(t,i);  return s;  }  public int obtenerGrado()  {  return arr.length - 1;  }  public static Polinomio integrar(Polinomio c, double cte)  {  Polinomio tmp = new Polinomio(c.obtenerGrado() + 1);
BISECTION METHOD CODE IN JAVA tmp.asignarCoef(0,cte);  for(int i = 1; i <= tmp.obtenerGrado() ; i++)  tmp.asignarCoef(i , c.obtenerCoef(i-1) / i ); private int cont;  public void asignarDatos(double a,double b)  {  this.a = a;  this.b = b;  this.cont = 0;  }  public int numIteraciones()  {  return cont;  }  public double raiz(Evaluar e)  {  while(true)  {  c = (a + b) / 2;  if(b - c <= EPSILON) break;  if (e.f(a) * e.f(c) <= 0.0)  b = c;  else  a = c;  cont++;  if (cont > MAX_ITER ) break;  }  return c;  }  }
THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points  a 0  and  b 0  such that  f ( a 0 ) and  f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function  f  has a root in the interval [ a 0 ,  b 0 ], assuming continuity of the function  f . The method proceeds by producing a sequence of shrinking intervals [ a k ,  b k ] that all contain a root of  f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia
EXAMPLE ,[object Object],[object Object],n = 1 xi = 12 f(xi) = 6.067 xs = 16 f(xs) = -2.2687 xr = 16 -  (-2.2687) (12 -16)  = 14.911  6.067 - (-2.2687) f(xr) = -0.25426 f(xi) f(xr) = 6.067 (-0.25426 ) < 0, xs = xr n = 2 xi = 12 f(xi) = 6.067 xs = 14.9112 f(xs) = -0.25426 xr = 14.9113 -  (-0.25426) (12 -14.9113)  = 14.7942  6.067 - (-0.25426) f(xr) = -0.0.2726 f(xi) f(xr) < 0, xs = xr Ea = {(14.7942-14.9113)/14.7942} x 100% = 0.79 %
THE FALSE POSITION METHOD n = 3 xi = 12 f(xi) = 6.067 xs = 14.7942 f(xs) = -0.02726 xr = 14.7942 -  (-0.02726) (12 -14.7942)  = 14.7816  6.067 - (-0.02726) xr = 14.7816 Ea = {(14.7816-14.7942)/14.7816} x 100% = 0.087 % Ea <   0.087 < 0.5 %
THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points  a 0  and  b 0  such that  f ( a 0 ) and  f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function  f  has a root in the interval [ a 0 ,  b 0 ], assuming continuity of the function  f . The method proceeds by producing a sequence of shrinking intervals [ a k ,  b k ] that all contain a root of  f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia
THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points  a 0  and  b 0  such that  f ( a 0 ) and  f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function  f  has a root in the interval [ a 0 ,  b 0 ], assuming continuity of the function  f . The method proceeds by producing a sequence of shrinking intervals [ a k ,  b k ] that all contain a root of  f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia

Más contenido relacionado

La actualidad más candente

partialderivatives
partialderivativespartialderivatives
partialderivativesyash patel
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivativesm2699
 
3.6 applications in optimization
3.6 applications in optimization3.6 applications in optimization
3.6 applications in optimizationmath265
 
Chapter 4 review
Chapter 4 reviewChapter 4 review
Chapter 4 reviewgregcross22
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONDhrupal Patel
 
Computer Science and Information Science 3rd semester (2011-July) Question Pa...
Computer Science and Information Science 3rd semester (2011-July) Question Pa...Computer Science and Information Science 3rd semester (2011-July) Question Pa...
Computer Science and Information Science 3rd semester (2011-July) Question Pa...B G S Institute of Technolgy
 
Applied mechanics of solids (a.f
Applied mechanics of solids (a.fApplied mechanics of solids (a.f
Applied mechanics of solids (a.fManuel Miranda
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncrCss Founder
 
Top School in india
Top School  in indiaTop School  in india
Top School in indiaEdhole.com
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONDhrupal Patel
 
application of partial differentiation
application of partial differentiationapplication of partial differentiation
application of partial differentiationeteaching
 

La actualidad más candente (14)

5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
5th Semester Electronic and Communication Engineering (2013-June) Question Pa...5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
 
partialderivatives
partialderivativespartialderivatives
partialderivatives
 
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
 
3.6 applications in optimization
3.6 applications in optimization3.6 applications in optimization
3.6 applications in optimization
 
Chapter 4 review
Chapter 4 reviewChapter 4 review
Chapter 4 review
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATION
 
Computer Science and Information Science 3rd semester (2011-July) Question Pa...
Computer Science and Information Science 3rd semester (2011-July) Question Pa...Computer Science and Information Science 3rd semester (2011-July) Question Pa...
Computer Science and Information Science 3rd semester (2011-July) Question Pa...
 
Applied mechanics of solids (a.f
Applied mechanics of solids (a.fApplied mechanics of solids (a.f
Applied mechanics of solids (a.f
 
Website designing company in delhi ncr
Website designing company in delhi ncrWebsite designing company in delhi ncr
Website designing company in delhi ncr
 
3rd Semester CS and IS (2013-June) Question Papers
3rd  Semester CS and IS  (2013-June) Question Papers 3rd  Semester CS and IS  (2013-June) Question Papers
3rd Semester CS and IS (2013-June) Question Papers
 
Top School in india
Top School  in indiaTop School  in india
Top School in india
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATION
 
application of partial differentiation
application of partial differentiationapplication of partial differentiation
application of partial differentiation
 

Similar a ROOTS OF EQUATION GRAPHICAL ANALYSIS

Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)Minhas Kamal
 
Numerical differentation with c
Numerical differentation with cNumerical differentation with c
Numerical differentation with cYagya Dev Bhardwaj
 
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920Karl Rudeen
 
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...ijrap
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivativesdivaprincess09
 
Nams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsNams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsRuchi Maurya
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITEgor Bogatov
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesMark Brandao
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd StudyChris Ohk
 
1.  Write an equation in standard form of the parabola that has th.docx
1.  Write an equation in standard form of the parabola that has th.docx1.  Write an equation in standard form of the parabola that has th.docx
1.  Write an equation in standard form of the parabola that has th.docxKiyokoSlagleis
 
SIAM - Minisymposium on Guaranteed numerical algorithms
SIAM - Minisymposium on Guaranteed numerical algorithmsSIAM - Minisymposium on Guaranteed numerical algorithms
SIAM - Minisymposium on Guaranteed numerical algorithmsJagadeeswaran Rathinavel
 
The Fundamental theorem of calculus
The Fundamental theorem of calculus The Fundamental theorem of calculus
The Fundamental theorem of calculus AhsanIrshad8
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)mihir jain
 

Similar a ROOTS OF EQUATION GRAPHICAL ANALYSIS (20)

Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
 
Numerical differentation with c
Numerical differentation with cNumerical differentation with c
Numerical differentation with c
 
Bisection method
Bisection methodBisection method
Bisection method
 
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
 
Project Paper
Project PaperProject Paper
Project Paper
 
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivatives
 
Nams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsNams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methods
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithm
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithm
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic Splines
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 
Função afim resumo teórico e exercícios - celso brasil
Função afim   resumo teórico e exercícios - celso brasilFunção afim   resumo teórico e exercícios - celso brasil
Função afim resumo teórico e exercícios - celso brasil
 
1.  Write an equation in standard form of the parabola that has th.docx
1.  Write an equation in standard form of the parabola that has th.docx1.  Write an equation in standard form of the parabola that has th.docx
1.  Write an equation in standard form of the parabola that has th.docx
 
azEssay2
azEssay2azEssay2
azEssay2
 
05_AJMS_332_21.pdf
05_AJMS_332_21.pdf05_AJMS_332_21.pdf
05_AJMS_332_21.pdf
 
SIAM - Minisymposium on Guaranteed numerical algorithms
SIAM - Minisymposium on Guaranteed numerical algorithmsSIAM - Minisymposium on Guaranteed numerical algorithms
SIAM - Minisymposium on Guaranteed numerical algorithms
 
The Fundamental theorem of calculus
The Fundamental theorem of calculus The Fundamental theorem of calculus
The Fundamental theorem of calculus
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 

Más de Natalia

Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Inversa lu
Inversa luInversa lu
Inversa luNatalia
 
Darcy´s law
Darcy´s lawDarcy´s law
Darcy´s lawNatalia
 
Darcy´s law
Darcy´s lawDarcy´s law
Darcy´s lawNatalia
 
Metodos abiertos
Metodos abiertosMetodos abiertos
Metodos abiertosNatalia
 
Serie de taylor
Serie de taylorSerie de taylor
Serie de taylorNatalia
 
Inversa lu
Inversa luInversa lu
Inversa luNatalia
 

Más de Natalia (7)

Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Inversa lu
Inversa luInversa lu
Inversa lu
 
Darcy´s law
Darcy´s lawDarcy´s law
Darcy´s law
 
Darcy´s law
Darcy´s lawDarcy´s law
Darcy´s law
 
Metodos abiertos
Metodos abiertosMetodos abiertos
Metodos abiertos
 
Serie de taylor
Serie de taylorSerie de taylor
Serie de taylor
 
Inversa lu
Inversa luInversa lu
Inversa lu
 

ROOTS OF EQUATION GRAPHICAL ANALYSIS

  • 2. Graphical analysis is the simplest method for obtaining results in both life data and accelerated life testing analyses. Although they have limitations in general graphical methods are easily implemented and easy to interpret. The graphical method for estimating the parameters of accelerated life data involves generating two types of plots. First, the life data at each individual stress level are plotted on a probability paper appropriate to the assumed life distribution. GRAPHIC METHOD this method is very simple and is well known to better illustrate , i will make an example.
  • 3.
  • 4. The bisection method is a root-finding algorithm which repeatedly bisects an interval then selects a subinterval in which a root must lie for further processing. It is a very simple and robust method, but it is also relatively slow. The method is applicable when we wish to solve the equation for the scalar variable x , where f is a continuous function. The bisection method requires two initial points a and b such that f ( a ) and f ( b ) have opposite signs. This is called a bracket of a root, for by the intermediate value theorem the continuous function f must have at least one root in the interval ( a , b ). The method now divides the interval in two by computing the midpoint c = ( a + b ) / 2 of the interval. Unless c is itself a root--which is very unlikely, but possible--there are now two possibilities: either f ( a ) and f ( c ) have opposite signs and bracket a root, or f ( c ) and f ( b ) have opposite signs and bracket a root. BISECTION METHOD
  • 5.
  • 6.
  • 7. EXAMPLE n = 3 xi = 14, xs = 15 , , xr = 14.5 f(xi) = f(14) = 1.5687 f(xi) =f(14.5)= 0.5523 f(xi) f(xi) > 0, xi = xr Ea = {14.5-15/14.5} x 100 = 3.448 % n = 4 xi = 14.5, xs = 15 , , xr = 14.75 f(xi) = f(14.5) = 0.5523 f(xi) =f(14.75)= 0.05896 f(xi) f(xi) > 0, xi = xr Ea = {14.75-14.5/14.75} x 100 = 1.695 % n = 5 xi = 14.75, xs = 15 , , xr = 14.875 f(xi) = f(14.75) = 0.5896 f(xi) =f(14.87)= -0.1841 f(xi) f(xi) < 0, xs= xr Ea = {14.875-14.75/14.875} x 100= 0.840 % n = 6 xi = 14.75, xs = 14.875 , , xr = 14.8125 Ea = {14.8125-14.875/14.8126} x 100= 0.4219 % Ea < 0.422% < 0.5 % xr = 14.8125
  • 8. EXAMPLE iteración Xi Xs Xr Ea % 1 12 16 14 6.667 2 14 16 12 3.448 3 14 15 14.5 1.695 4 14.5 15 14.75 0.480 5 14.75 15 14.875 0.422 6 14.75 14.875 14.8125 0.032
  • 9. BISECTION METHOD CODE IN JAVA import java.io.*; class pruebaBisecc { public static void impResult(double a,double b, Biseccion bisecc , Evaluar e) { bisecc.asignarDatos(a,b); System.out.println(&quot;Evaluacion de intervalo : [ &quot; + a + &quot; , &quot; + b + &quot; ]&quot;); System.out.println(&quot;f(&quot; + a + &quot;) : &quot; + e.f(a)); System.out.println(&quot;f(&quot; + b + &quot;) : &quot; + e.f(b)); System.out.println(&quot;raiz : &quot; + bisecc.raiz(e)); System.out.println(&quot;Numero de iteraciones : &quot; + bisecc.numIteraciones()); } public static void main(String arg[]) { Biseccion b = new Biseccion(); /* polinomio : (x-3)(x+2)(x-1) = 6 - 5x - 2x^2 + x^3 */ double coef[] = { 6.0 , -5.0 , -2.0 , 1.0 }; EvalPolinomio ep = new EvalPolinomio(coef); System.out.println(&quot;Polinomio : &quot; + ep.toString(&quot;x&quot;)); impResult(1.8 , 3.9 , b , ep); impResult(-3.3 , -1.0 , b , ep); impResult(-0.2 , 1.6 , b , ep); System.out.println(); } } class Polinomio { private double arr[]; public Polinomio(int grado) { arr = new double[grado + 1]; }
  • 10. BISECTION METHOD CODE IN JAVA public Polinomio(double coef[]) { this(coef.length - 1); for(int i = 0; i < coef.length; i++) arr[i] = coef[i]; } public void asignarCoeficientes(double coef[]) { for(int i = 0; i < coef.length; i++) arr[i] = coef[i]; } public double []obtenerCoeficientes() { return arr; } public double obtenerCoef(int posicion) { return arr[posicion]; } public void asignarCoef(int posicion, double valor) { arr[posicion] = valor; } public double evaluar(double t) { double s = 0.0; for(int i = 0; i < arr.length; i++) s += arr[i] * Math.pow(t,i); return s; } public int obtenerGrado() { return arr.length - 1; } public static Polinomio integrar(Polinomio c, double cte) { Polinomio tmp = new Polinomio(c.obtenerGrado() + 1);
  • 11. BISECTION METHOD CODE IN JAVA tmp.asignarCoef(0,cte); for(int i = 1; i <= tmp.obtenerGrado() ; i++) tmp.asignarCoef(i , c.obtenerCoef(i-1) / i ); private int cont; public void asignarDatos(double a,double b) { this.a = a; this.b = b; this.cont = 0; } public int numIteraciones() { return cont; } public double raiz(Evaluar e) { while(true) { c = (a + b) / 2; if(b - c <= EPSILON) break; if (e.f(a) * e.f(c) <= 0.0) b = c; else a = c; cont++; if (cont > MAX_ITER ) break; } return c; } }
  • 12. THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points a 0 and b 0 such that f ( a 0 ) and f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [ a 0 , b 0 ], assuming continuity of the function f . The method proceeds by producing a sequence of shrinking intervals [ a k , b k ] that all contain a root of f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia
  • 13.
  • 14. THE FALSE POSITION METHOD n = 3 xi = 12 f(xi) = 6.067 xs = 14.7942 f(xs) = -0.02726 xr = 14.7942 - (-0.02726) (12 -14.7942) = 14.7816 6.067 - (-0.02726) xr = 14.7816 Ea = {(14.7816-14.7942)/14.7816} x 100% = 0.087 % Ea < 0.087 < 0.5 %
  • 15. THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points a 0 and b 0 such that f ( a 0 ) and f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [ a 0 , b 0 ], assuming continuity of the function f . The method proceeds by producing a sequence of shrinking intervals [ a k , b k ] that all contain a root of f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia
  • 16. THE FALSE POSITION METHOD Like the bisection method, the false position method starts with two points a 0 and b 0 such that f ( a 0 ) and f ( b 0 ) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [ a 0 , b 0 ], assuming continuity of the function f . The method proceeds by producing a sequence of shrinking intervals [ a k , b k ] that all contain a root of f . In point-slope form, it can be defined as: From Wikipedia, the free encyclopedia