Hello I need your help plealse
I want to solve this linear systems of r equations defined by this formula in order to find the values of
v_{n}^{(s)}= \sum\limits_{i=1}^{l} \left(\sum\limits_{j=0}^{m_{i}-1} \beta_{i,j}^{(s)} n^{j} \right) \lambda_{i}^{n}, \;\;\; 0 \leq s \leq r-1
\label{sequenceBeta}
\end{equation}
where l the number of eigenvalues of the matrix
I know that i should use np.linalg.solve(matrice,vecteur)
i have tried to solve this system but i found a difficulty in programming it
The code is as follow
I want to solve this linear systems of r equations defined by this formula in order to find the values of
\beta_{i,j}^{s}
for of fixed s
`\begin{equation}v_{n}^{(s)}= \sum\limits_{i=1}^{l} \left(\sum\limits_{j=0}^{m_{i}-1} \beta_{i,j}^{(s)} n^{j} \right) \lambda_{i}^{n}, \;\;\; 0 \leq s \leq r-1
\label{sequenceBeta}
\end{equation}
`where l the number of eigenvalues of the matrix
m_{i}
the multiplicity of the eigenvalue
\lambda_{i}
I know that i should use np.linalg.solve(matrice,vecteur)
i have tried to solve this system but i found a difficulty in programming it
The code is as follow
def beta_vanderm(l,s,n): len_matrix=len(l) beta=np.zeros(len_matrix) mat=np.zeros((len_matrix,len_matrix)) vect=np.zeros(len_matrix) evals, evecs = la.eig(l) unique_elements, counts_elements = np.unique(evals, return_counts=True) print unique_elements print counts_elements for f in range(0,len_matrix): vect[f]=delta(s,f) print vect[f] for k in range(0,len_matrix): for u in range(0,len_matrix): additionner=0 for i in range(1,len(unique_elements)+1): additionner=0 for j in range(0,counts_elements[i-1]): additionner+=(n**j)*(unique_elements[i-1]**n) mat[k][u]=additionner beta=np.linalg.solve(mat,vect) return beta