b(1) = a(1); for i = 2:n b(i) = a(i) + x*b(i-1); end in .NET Print ECC200 in .NET b(1) = a(1); for i = 2:n b(i) = a(i) + x*b(i-1); end

b(1) = a(1); for i = 2:n b(i) = a(i) + x*b(i-1); end generate, create datamatrix 2d barcode none with .net projects MS Excel Laguerre s Method Laquerre s formulas are not easily derived for a general polynomial Pn (x). However, the derivation is greatly simpli ed if we consider the special case where the polynomial has a zero at x = r and (n 1) zeros at x = q. If the zeros were known, this polynomial can be written as Pn (x) = (x r )(x q)n 1 Our problem is now this: given the polynomial in Eq.

(a) in the form Pn (x) = a 1 x n + a 2 x n 1 + + a n x + a n+1 determine r (note that q is also unknown). It turns out that the result, which is exact for the special case considered here, works well as an iterative formula with any polynomial. Differentiating Eq.

(a) with respect to x, we get Pn (x) = (x q)n 1 + (n 1)(x r )(x q)n 2 = Pn (x) Thus Pn (x) 1 n 1 = + Pn (x) x r x q which upon differentiation yields Pn (x) Pn (x) Pn (x) Pn (x). 1 n 1 + x r x q 1 n 1 (x r )2 (x q)2. It is convenient to VS .NET 2d Data Matrix barcode introduce the notation G(x) = Pn (x) Pn (x) H(x) = G 2 (x) Pn (x) Pn (x) (4.14).

4.7 Zeros of Polynomials so that Eqs. (b) an Data Matrix for .NET d (c) become G(x) = H(x) = n 1 1 + x r x q n 1 1 + (x r )2 (x q)2 (4.

15a) (4.15b). If we solve Eq. (4. 15a) for x q and substitute the result into Eq.

(4.15b), we obtain a quadratic equation for x r. The solution of this equation is the Laguerre s formula x r = n G(x) (n 1) nH(x) G 2 (x) (4.

16). The procedure for .net vs 2010 data matrix barcodes nding a zero of a general polynomial by Laguerre s formula is: 1. Let x be a guess for the root of Pn (x) = 0 (any value will do).

2. Evaluate Pn (x), Pn (x), and Pn (x) using the procedure outlined in Eqs. (4.

10) and (4.11). 3.

Compute G(x) and H(x) from Eqs. (4.14).

4. Determine the improved root r from Eq. (4.

16) choosing the sign that results in the larger magnitude of the denominator (this can be shown to improve convergence). 5. Let x r and repeat steps 2 5 until .

Pn (x). < or x r < , where is .NET Data Matrix barcode the error tolerance. One nice property of Laguerre s method is that converges to a root, with very few exceptions, from any starting value of x.

polyRoots The function polyRoots in this module computes all the roots of Pn (x) = 0, where the polynomial Pn (x) de ned by its coef cient array a = [a 1 , a 2 , a 3 , . . .

]. After the rst root is computed by the subfunction laguerre, the polynomial is de ated using deflPoly and the next zero computed by applying laguerre to the de ated polynomial. This process is repeated until all n roots have been found.

If a computed root has a very small imaginary part, it is very likely that it represents roundoff error. Therefore, polyRoots replaces a tiny imaginary part by zero..

function root = pol yroots(a,tol) % Returns all the roots of the polynomial % a(1)*x n + a(2)*x (n-1) + ...

+ a(n+1). % USAGE: root = polyroots(a,tol). % tol = error tolerance (default is 1.

0e4*eps).. if nargin == 1; tol 2d Data Matrix barcode for .NET = 1.0e-6; end n = length(a) - 1;.

Roots of Equations root = zeros(n,1); visual .net datamatrix 2d barcode for i = 1:n x = laguerre(a,tol); if abs(imag(x)) < tol; x = real(x); end root(i) = x; a = deflpoly(a,x); end. function x = laguer re(a,tol) % Returns a root of the polynomial % a(1)*x n + a(2)*x (n-1) + ...

+ a(n+1). x = randn; n = length(a) - 1; for i = 1:30 [p,dp,ddp] = evalpoly(a,x); if abs(p) < tol; return; end g = dp/p; h = g*g - ddp/p; f = sqrt((n - 1)*(n*h - g*g)); if abs(g + f) >= abs(g - f); dx = n/(g + f); else; dx = n/(g - f); end x = x - dx; if abs(dx) < tol; return; end end error( Too many iterations in laguerre ) % Start with random number. function b = deflpo Data Matrix barcode for .NET ly(a,r) % Horner s deflation: % a(1)*x n + a(2)*x (n-1) + ..

. + a(n+1) % = (x - r)[b(1)*x (n-1) + b(2)*x (n-2) + ..

.+ b(n)]. n = length(a) - 1; b = zeros(n,1); b(1) = a(1); for i = 2:n; b(i) = a(i) + r*b(i-1); end.

Since the roots are computed with nite accuracy, each de ation introduces small errors in the coef cients of the de ated polynomial. The accumulated roundoff error increases with the degree of the polynomial and can become severe if the polynomial is ill conditioned (small changes in the coef cients produce large changes in the roots). Hence the results should be viewed with caution when dealing with polynomials of high degree.

The errors caused by de ation can be reduced by recomputing each root using the original, unde ated polynomial. The roots obtained previously in conjunction with de ation are employed as the starting values..

Copyright © . All rights reserved.