Hi guys,
I need to find a method to generalize Leverrier Method to find matrix's characteristic polynomial.
Input should be only the matrix.
As theory I have:
- PA(x)=x^n-c1*n^(n-1)+c2*x(n-2)+…+(-1)^n*c[n] – polynomial
- s[k]=trace(A^k), 1<=k<=n
- c[k], 1<=k<=n
c1=s1
c2=(s1*c2-s[k])/2
c[k]=(s1*c[k-1]-s2*c[k-2]+…+(-1)^(k+1)*s[k])/k, 2<=k<=n
Also i have to display PA and a graph or something
What I have so far:
function [A,n]=leverrier_n()
for i=1 to n
for j=2 to n
V[j]=A^j
s[i]=trace(V[j])
end
end
for k=2 to n
i=1;
t[1]=s[1]
t[k]=(s[i]*t[k-1]-s[i+1]*t[k-2]+)/k
end
end
Best Answer