next up previous contents
suivant: Programmer avec Maxima monter: introduction précédent: Calcul différentiel   Table des matières

Calcul matriciel

Maxima peut calculer le déterminant, l'inverse, les valeurs propres et les vecteurs propres d'une matrice qui comporte des éléments symboliques ( c'est à dire des expressions avec des variables algébriques ). On commence par entrer une matrice $ m$ élément par élément :

maxima] m:entermatrix(3,3);

Is the matrix 1. Diagonal 2. Symmetric 3. Antisymmetric 4. General

Answer 1, 2, 3 or 4 : 4;

Row 1 Column 1: 0;

Row 1 Column 2: 1;

Row 1 Column 3: a;

Row 2 Column 1: 1;

Row 2 Column 2: 0;

Row 2 Column 3: 1;

Row 3 Column 1: 1;

Row 3 Column 2: 1;

Row 3 Column 3: 0;

Matrix entered.

$\text{\texttt{{\red (D21) {\black }}}} \left( \begin{array}{ccc}
0 & 1 & a\\
1 & 0 & 1\\
1 & 1 & 0
\end{array} \right)$

On calcule ensuite sa transposée, son déterminant et son inverse :

maxima] transpose(m);

$\text{\texttt{{\red (D22) {\black }}}} \left( \begin{array}{ccc}
0 & 1 & 1\\
1 & 0 & 1\\
a & 1 & 0
\end{array} \right)$

(C23) determinant(m);

$\text{\texttt{{\red (D23) {\black }}}} a + 1$

(C24) invert(m),detout;

$\text{\texttt{{\red (D24) {\black }}}} \frac{\left(
\begin{array}{ccc}
- 1 & a & 1\\
1 & - a & a\\
1 & 1 & - 1
\end{array} \right)}{a + 1}$

Dans l'entrée C24, l'option detout impose la factorisation par le déterminant, ce dernier restant à l'extérieur de la matrice. Comme vérification, on peut multiplier $ m$ par son inverse ( remarquer l'usage du point (.) pour désigner le produit matriciel ) :

maxima] m.d24;

$\text{\texttt{{\red (D25) {\black }}}} \left( \begin{array}{ccc}
0 & 1 & a\\
...
...}{ccc}
- 1 & a & 1\\
1 & - a & a\\
1 & 1 & - 1
\end{array} \right)}{a + 1}$

(C26) expand(%)

$\text{\texttt{{\red (D26) {\black }}}} \left( \begin{array}{ccc}
\frac{a}{a + ...
...1}{a + 1} & 0\\
0 & 0 & \frac{a}{a + 1} + \frac{1}{a + 1}
\end{array} \right)$

(C27) factor(%)

$\text{\texttt{{\red (D27) {\black }}}} \left( \begin{array}{ccc}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1
\end{array} \right)$

Pour trouver valeurs et vecteurs propres, on utilise la commande EIGENVECTORS :

maxima] eigenvectors(m);

Warning - you are redefining the MACSYMA function EIGENVALUES

Warning - you are redefining the MACSYMA function EIGENVECTORS

$\text{\texttt{{\red (D28) {\black }}}} \left[ \left[ \left[ - \frac{\sqrt{4 a
+...
...}, \frac{\sqrt{4 a + 5} + 1}{2 a + 2} \right], \left[ 1, - 1, 0
\right] \right]$

Dans l'expression D28, le premier crochet à l'intérieur du triple crochet donne les trois valeurs propres, le suivant leur ordre de multiplicité respectifs, et les crochets suivants fournissent les coordonnées des vecteurs propres associés aux valeurs propres. Afin d'extraire un vecteur propre de l'expression précédente, on utilise la commande PART :

maxima] part(D28,2);

$\text{\texttt{{\red (D29) {\black }}}} \left[ 1, - \frac{\sqrt{4 a
+ 5} - 1}{2 a + 2}, - \frac{\sqrt{4 a + 5} - 1}{2 a + 2} \right]$


next up previous contents
suivant: Programmer avec Maxima monter: introduction précédent: Calcul différentiel   Table des matières
Michel 2002-05-01