3

I want to find the characteristic equation of a matrix . I`m aware of how it is done mathematically but how do I display it in the form of an equation ? eg : Given matrix :

3 7 9
8 6 2
1 8 6

now if suppose the parameter is , say "b"; my next step is to do this ;

3-b 7   9
8   6-b 2
1   8   6-b

till here I can only display by doing this :

printf("%d - %c ", a[i][j],98);

but then how do I find this determinant of matrix from here ?? my final equation should be of form like

b^3 + 3b^2 - 4b +5 =0

and all of this simplification should be done in the program. Can this be done in C ? If not , is there any other way or language that makes this simplification possible ? I don`t want to just display a character , I want it to be involved in the calculation and remain intact in the final answer. Thanks .

Francesco
  • 3,200
  • 1
  • 34
  • 46
Dayanand shetake
  • 195
  • 1
  • 3
  • 11

1 Answers1

6

This sounds like symbolic computation. It's easily implemented in MATLAB if you have the Symbolic Math toolbox or in GNU Octave (as described in this tutorial) which is freely available.

Google recommends GiNaC for C++. Further googling may turn up something for C.

Jacob
  • 34,255
  • 14
  • 110
  • 165
  • 1
    @user553492: then, if the answer is useful to you, upvote it! – Francesco Feb 08 '11 at 18:23
  • You don't need symbolic computation to find the coefficiencts of the characteristic polynome of a matrix. – etarion Feb 08 '11 at 21:47
  • @etarion: I think the OP knows how to evaluate it himself ("all of this simplification should be done in the program"). – Jacob Feb 09 '11 at 00:45
  • It isn't about "evaluating it himself", it's about not needing symbolic computation to do this algorithmically. It's basically a one-liner if you have a linear algebra package, see http://codepad.org/eHfkkDz6 for a python example (can't be bugged to implement this in C in the middle of the night) – etarion Feb 09 '11 at 01:15