raices de ecuaciones

16
ROOTS OF EQUATION ROOTS OF EQUATION

Upload: natalia

Post on 02-Jul-2015

333 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Raices de ecuaciones

ROOTS OF EQUATIONROOTS OF EQUATION

Page 2: Raices de ecuaciones

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 METHODGRAPHIC METHOD

this method is very simple and is well known to better illustrate , i will make an example.

Page 3: Raices de ecuaciones

EXAMPLEEXAMPLE

Usando el método gráfico resolver las ecuaciones:

3x1 + 2x2 = 18 (A)-x1 + 2x2 = 2 ( B)

Solución: Despejar : (A) : x2 = -3 x1 + 9

(B) : x2 = 1 x1 + 1

X1= 1.8X2= 3

Page 4: Raices de ecuaciones

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 METHODBISECTION METHOD

Page 5: Raices de ecuaciones

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.

Sitio web de esta imagendeadline.3x.ro•Imagen en tamaño completo

Page 6: Raices de ecuaciones

EXAMPLEEXAMPLE•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:f(c) = gm/c ( 1 - e-(c/m) t ) - v = 0

xi = 12, xs = 16xr = (12+16)/2 = 14, xr = xsf(xi) = f(12) = 6.067f(xr) = f(14) = 1.5687f(xi) f(xr) = (6.067)( 1.5687) > 0, la raíz se encuentra en el subintervalo superior, xi = xrn = 2xi = 14, xs = 16 , xr = 15f(xi) = f(14) = 1.5687f(xr) = f(15) = -0.4248f(xi) f(xr) = (1.5687)( -0.4248) < 0, la raíz se encuentra en este subientervalo, xs = xrEa = {15-14/15} x 100 = 6.667 %

Page 7: Raices de ecuaciones

EXAMPLEEXAMPLE

n = 3 xi = 14, xs = 15 , , xr = 14.5f(xi) = f(14) = 1.5687f(xi) =f(14.5)= 0.5523f(xi) f(xi) > 0, xi = xrEa = {14.5-15/14.5} x 100 = 3.448 %n = 4 xi = 14.5, xs = 15 , , xr = 14.75f(xi) = f(14.5) = 0.5523f(xi) =f(14.75)= 0.05896f(xi) f(xi) > 0, xi = xrEa = {14.75-14.5/14.75} x 100 = 1.695 %

n = 5 xi = 14.75, xs = 15 , , xr = 14.875f(xi) = f(14.75) = 0.5896f(xi) =f(14.87)= -0.1841f(xi) f(xi) < 0, xs= xrEa = {14.875-14.75/14.875} x 100= 0.840 %n = 6xi = 14.75, xs = 14.875 , , xr = 14.8125Ea = {14.8125-14.875/14.8126} x 100= 0.4219 %Ea < 0.422% < 0.5 %xr = 14.8125

Page 8: Raices de ecuaciones

EXAMPLEEXAMPLE

iteración Xi Xs Xr Ea %1 12 16 14 6.6672 14 16 12 3.4483 14 15 14.5 1.6954 14.5 15 14.75 0.480

5 14.75 15 14.875 0.422

6 14.75 14.875 14.8125 0.032

Page 9: Raices de ecuaciones

BISECTION METHOD CODE IN BISECTION METHOD CODE IN JAVAJAVA

import java.io.*; class pruebaBisecc {

public static void impResult(double a,double b, Biseccion bisecc , Evaluar e) { bisecc.asignarDatos(a,b); System.out.println("\n\tEvaluacion de intervalo : [ " + a + " , " + b + " ]\n"); System.out.println("\tf(" + a + ") : " + e.f(a)); System.out.println("\tf(" + b + ") : " + e.f(b));

System.out.println("\traiz : " + bisecc.raiz(e)); System.out.println("\tNumero de iteraciones : " + 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("\n\tPolinomio : " + ep.toString("x"));

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]; }

Page 10: Raices de ecuaciones

BISECTION METHOD CODE IN BISECTION METHOD CODE IN JAVAJAVApublic 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);

Page 11: Raices de ecuaciones

BISECTION METHOD CODE IN BISECTION METHOD CODE IN JAVAJAVAtmp.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; } }

Page 12: Raices de ecuaciones

THE FALSE POSITION THE FALSE POSITION METHODMETHODLike the bisection method, the false position method starts with two points

a0 and b0 such that f(a0) and f(b0) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [a0, b0], assuming continuity of the function f. The method proceeds by producing a sequence of shrinking intervals [ak, bk] that all contain a root of f. In point-slope form, it can be defined as:

From Wikipedia, the free encyclopedia

Page 13: Raices de ecuaciones

EXAMPLEEXAMPLE•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:f(c) = gm/c ( 1 - e-(c/m) t ) - v = 0

n = 1xi = 12 f(xi) = 6.067xs = 16 f(xs) = -2.2687xr = 16 - (-2.2687) (12 -16) = 14.911 6.067 - (-2.2687)f(xr) = -0.25426f(xi) f(xr) = 6.067 (-0.25426 ) < 0, xs = xr

n = 2xi = 12 f(xi) = 6.067xs = 14.9112 f(xs) = -0.25426xr = 14.9113 - (-0.25426) (12 -14.9113) = 14.7942 6.067 - (-0.25426)f(xr) = -0.0.2726f(xi) f(xr) < 0, xs = xrEa = {(14.7942-14.9113)/14.7942} x 100% = 0.79 %

Page 14: Raices de ecuaciones

THE FALSE POSITION THE FALSE POSITION METHODMETHODn = 3

xi = 12 f(xi) = 6.067xs = 14.7942 f(xs) = -0.02726xr = 14.7942 - (-0.02726) (12 -14.7942) = 14.7816 6.067 - (-0.02726)xr = 14.7816Ea = {(14.7816-14.7942)/14.7816} x 100% = 0.087 %Ea < 0.087 < 0.5 %

Page 15: Raices de ecuaciones

THE FALSE POSITION THE FALSE POSITION METHODMETHODLike the bisection method, the false position method starts with two points

a0 and b0 such that f(a0) and f(b0) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [a0, b0], assuming continuity of the function f. The method proceeds by producing a sequence of shrinking intervals [ak, bk] that all contain a root of f. In point-slope form, it can be defined as:

From Wikipedia, the free encyclopedia

Page 16: Raices de ecuaciones

THE FALSE POSITION THE FALSE POSITION METHODMETHODLike the bisection method, the false position method starts with two points

a0 and b0 such that f(a0) and f(b0) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [a0, b0], assuming continuity of the function f. The method proceeds by producing a sequence of shrinking intervals [ak, bk] that all contain a root of f. In point-slope form, it can be defined as:

From Wikipedia, the free encyclopedia