Raices de ecuaciones

808
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
808
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Raices de ecuaciones

  1. 1. ROOTS OF EQUATION
  2. 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. 3. EXAMPLE <ul><li>Usando el método gráfico resolver las ecuaciones: </li></ul><ul><li>3x1 + 2x2 = 18 (A) </li></ul><ul><li>x1 + 2x2 = 2 ( B) </li></ul><ul><li>Solución: </li></ul><ul><li>Despejar : </li></ul><ul><li>(A) : x2 = -3 x1 + 9 </li></ul><ul><li>(B) : x2 = 1 x1 + 1 </li></ul><ul><li>X1= 1.8 </li></ul><ul><li>X2= 3 </li></ul>
  4. 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. 5. 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. <ul><li>Sitio web de esta imagen </li></ul><ul><li>deadline.3x.ro </li></ul><ul><li>Imagen en tamaño completo </li></ul>
  6. 6. EXAMPLE <ul><li>Determine el coeficiente de rozamiento c =? Necesario para que un paracaidista de masa = 68.1 kg tenga una velocidad de 40 m/s, después de una caída libre de t = 10 seg. La aceleración de la gravedad es de 9.8 m/s2. La ecuación a utilizar es: </li></ul><ul><li>f(c) = gm/c ( 1 - e-(c/m) t ) - v = 0 </li></ul>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 %
  7. 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. 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. 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. 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. 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. 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. 13. EXAMPLE <ul><li>Determine el coeficiente de rozamiento c =? Necesario para que un paracaidista de masa = 68.1 kg tenga una velocidad de 40 m/s, después de una caída libre de t = 10 seg. La aceleración de la gravedad es de 9.8 m/s2. La ecuación a utilizar es: </li></ul><ul><li>f(c) = gm/c ( 1 - e-(c/m) t ) - v = 0 </li></ul>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 %
  14. 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. 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. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×