MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Converting set of equations to matrix


Hello !
I have a set of equations I create following some rules, like

3 a[0,0] + 2 a[0,2] + 4 a[2,0] = 0
-1 a[0,0] + 0.3 a[2,0] = 0
4 a[0,2] - 1 a[0,2] = 0

The numbers of coefficients (the a[i,j]) is different in each run
but fixed. For further calculations I would like to transform the
above equations into the matrix
{{3,2,4 },{-1,0,0.3},{0,4,-1}}


Currently I have a list (called coeffli) where I can get the equations
from. The existing coefficients are stored in a second list (klist).
I also have a list where the values i,j are stored (cplist).

The above list I would create by
For[i = 1, i <= Length[kflist], i++, 
  Print[Collect[coeffli[[cplist[[i]][[1]]]][[cplist[[i]][[2]]]], klist]]]

I can create a list of the equations but I do not know how to tear
apart the sum into matrix elements.


Thanks

        Helge



  • Prev by Date: Re: J/Link
  • Next by Date: Re: 3D-Plots: Coloring edges (simple)
  • Previous by thread: Re: Book
  • Next by thread: Re: Converting set of equations to matrix