Professional Documents
Culture Documents
dioses00misericordioso
November 2020
1 polynomial roots
1.1 Ejercicio 1
Use the Durand-Kerner algorithm to find all the roots of the polynomial
%algoritmo de durand-kenner
x1=0.5
x2=2.5
x3=3.5
x4=4.5
for r=1:5
p=x1^4-10*x1^3+35*x1^2-50*x1+24
x1=x1-p/((x1-x2)*(x1-x3)*(x1-x4))
end
for r=1:5
p=x2^4-10*x2^3+35*x2^2-50*x2+24
x2=x2-p/((x2-x1)*(x2-x3)*(x2-x4))
end
for r=1:5
p=x3^4-10*x3^3+35*x3^2-50*x3+24
x3=x3-p/((x3-x1)*(x3-x2)*(x3-x4))
end
for r=1:5
p=x4^4-10*x4^3+35*x4^2-50*x4+24
x4=x4-p/((x4-x1)*(x4-x3)*(x4-x2))
end
1
Table 1: resultado para 5 iteraciones
n x1 x2 x3 x4
1 0.7734 2.3146 3.2480 3.9967
2 0.8872 2.1760 3.0975 4.0000
3 0.9414 2.0913 3.0340 4.0000
4 0.9689 2.0453 3.0113 4.0000
5 0.9834 2.0220 3.0037 4.0000
1.2 ejercicio 2
Use Durand-Kerner to find all the roots of the polynomial
p(x) = x7 − x − 1
SOLUCIÓN
se tomaron como puntos iniciales x1,2,3,4,5,6,7 = {0.9, −0.9, 4, 3, 7, i, −i}
%algoritmo de durand-kenner
x1=0.9
x2=-0.9
x3=4
x4=3
x5=7
x6=sqrt(-1)
x7=-sqrt(-1)
for r=1:10
p=x1^7-x1-1
x1=x1-p/((x1-x2)*(x1-x3)*(x1-x4)*(x1-x5)*(x1-x6)*(x1-x7))
end
for r=1:10
p=x2^7-x2-1
x2=x2-p/((x2-x1)*(x2-x3)*(x2-x4)*(x2-x5)*(x2-x6)*(x2-x7))
end
for r=1:10
p=x3^7-x3-1
x3=x3-p/((x3-x1)*(x3-x2)*(x3-x4)*(x3-x5)*(x3-x6)*(x3-x7))
end
for r=1:10
p=x4^7-x4-1
x4=x4-p/((x4-x1)*(x4-x3)*(x4-x2)*(x4-x5)*(x4-x6)*(x4-x7))
end
for r=1:10
p=x5^7-x5-1
x5=x5-p/((x5-x1)*(x5-x3)*(x5-x2)*(x5-x4)*(x5-x6)*(x5-x7))
end
for r=1:10
2
p=x6^7-x6-1
x6=x6-p/((x6-x1)*(x6-x3)*(x6-x2)*(x6-x5)*(x6-x4)*(x6-x7))
end
for r=1:10
p=x7^7-x7-1
x7=x7-p/((x7-x1)*(x7-x3)*(x7-x2)*(x7-x5)*(x7-x6)*(x7-x4))
end