# [Maxima] Difficulties getting a jacobian matrix

Viktor T. Toth vttoth at vttoth.com
Tue May 27 07:00:09 CDT 2008

```I think what you need is not functions, but declaring the symbols used in
your matrices as dependent variables. For instance, you may want to write

depends([f_R,beta_R,c_Rx,alpha_R,f_R,c_Ry],[R,Theta,Phi]);

or whatever your independent variables are. Thereafter, when the matrix is
differentiated, the matrix elements will be dealt with correctly.

A function's return value is the value of the last expression evaluated by
that function. (This is not LISP; this is the Maxima language.)

Viktor

-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of weaker at directbox.com
Sent: Tuesday, May 27, 2008 1:04 PM
To: maxima at math.utexas.edu
Subject: [Maxima] Difficulties getting a jacobian matrix

Hi all,

I have some matrices of the following form, for example
K_R : matrix([f_R,beta_R,c_Rx],[0,alpha_R*f_R,c_Ry],[0,0,1]);
R_X_Phi : matrix([1,0,0],[0,cos(Phi),-sin(Phi)],[0,sin(Phi),cos(Phi)]);
addcol( diagmatrix (3, 1) , [0,0,0])

Then I need to do some calculations (mostly multiplications) with these
matrices. The result will be a matrix with ugly long terms as entries which
should be simplified with ratsimp/trigsimp.
In the end, I want to rewrite that matrix column-wise into a big column
vector and then build the jacobian matrix. All entries with names (e. g.
beta_R, c_Ry) should be considered as variables and I have difficulties to
get the jacobian matrix in Maxima.

The questions I have are:
- Is it necessary to declare the matrices as functions like
R_X_Phi(Phi) :=
matrix([1,0,0],[0,cos(Phi),-sin(Phi)],[0,sin(Phi),cos(Phi)]);
to be able to compute a jacobian afterwards?

- When I tried that I got errors multiplying such a function with such an
item:
addcol( diagmatrix (3, 1) , [0,0,0])

How do I tackle such a problem in Maxima? What are the keywords I need to
look up or the key concepts.

Perhaps a great problem is that It is not entirely clear to me, what the
"return values" of the functions are. I don't know lisp and the noun/verb
thing in the help file doesn't make it clear either.
Is there a tutorial that is devoted to such matrix manipulation?

Best regards,
weaker

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
```