



Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!




Representation of Polynomial
n is degree of polynomials Example: Degree of 2 Degree of 0 Representation of Polynomial s in SCILAB Two way of declaring polynomials in SCILAB i. Using %s Example : ii. (^) Using function poly Example :
Usage of function poly There are 3 methods to use function poly to create polynomials: i. Declaring variable as a symbolic variable Example 1: s=poly (0,’s’) s1=s^2+4*s+ Example 2: x=poly (0,’x’) x1=x^4- 21x^3 + 43x^2 + 10*x +
ii. By using polynomial coefficients
Example: a) p = 10 + 4x p=poly ([10 4], ‘x’,’c’) b) q=2x^3 -5x + 7 q=poly ([7 -5 0 2],’x’,’c’)
iii. By using roots of polynomials SCILAB can be calculate the polynomial coefficients from the roots of polynomial (which are the values of argument for which the polynomial is equal to zero) Example: roots = -3, + x= -3 or x= 0 = x +3 0 = x - 2 0 = (x + 3)(x +2) f(x) = x^2 + x - 6 r = poly([ -3 2],’x’) Answer: r = -6 + x + x^2
SCILAB can be computing the roots of a function. r = roots(p)
Arithmetic Operation of Polynomials i. Added or subtracted Example: f1 (x) + f2(x) f1(x) = 3x^2 + 15x – 40 f2(x) = 5x + 20 SCILAB code: x=poly (0,’x’) f1= 3x^2 + 15x – 40 f2 = 5*x + f1 + f
ii. Multiplied Example: f = (2x^2 +x – 3)*(x + 1) SCILAB code: x = poly (0,’x’) f = (2x^2+x-3)(x+1)
iii. Divided Example: f = (x^2 -9x-10) / (x+1) SCILAB code: x = poly (0,’x’) f = (x^2 -9*x -10)/(x+1)
Useful function for Polynomials i. Function coeff
ii. (^) Function derivat