Python Forum
solve linear system of r equations
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
solve linear system of r equations
#1
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 \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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linear Equations Homework ngr33n 3 6,216 Oct-27-2017, 07:27 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020