Opérations sur les matrices avec promat.sty de la famille professor
26 mai 2009
La page dédiée à prographes.sty se trouve à cette adresse :
http ://mathsp.tuxfamily.org/spip.php ?article213
1 Écrire une matrice
112 2 cos () p2 0 1
12 2 3
0 BB BB BB
@
1 CC CC CC A
\begin{matmat}
matmat([[112,2,cos(alpha)],[sqrt(2),0,1],[1/2,2,3]])
\end{matmat}
2 Produit de matrices
Un produit de matrices de tailles diérentes :
112 2 0 0 0 1 1 2 3
0 BB B@
1 CC CA
R
122 0 11
0 BB B@
1 CC CA
1 5 0
0 BB B@
1 CC CA
Z
\begin{promat}
promat([[112,2,0],[0,0,1],[1,2,3]],[[1],[5],[0]],[["R","Z"]])
\end{promat}
1
Un carré de matrice carré avec l'option trigo...
cos () - (sin ()) 0 sin () cos () 0
0 0 1
0 BB BB
@
1 CC CC A
R
cos (2) - (sin (2)) 0 sin (2) cos (2) 0
0 0 1
0 BB BB
@
1 CC CC A
R2
cos () - (sin ()) 0 sin () cos () 0
0 0 1
0 BB BB
@
1 CC CC A
R
\begin{promat}
promat([[cos(theta),sin(theta),0],[sin(theta),cos(theta)
,0],[0,0,1]],[[cos(theta),sin(theta),0],[sin(theta),cos(theta) ,0],[0,0,1]],[["R","R","R^2"],trigo])
\end{promat}
Un produit de matrices de même taille sans option :
1 2 0 0 0 1 1 2 3
0 BB B@
1 CC CA
11 16 0 0 0 1 11 16 3
0 BB B@
1 CC CA
1 4 0 5 6 0 0 0 1
0 BB B@
1 CC CA
\begin{promat}
promat([[1,2,0],[0,0,1],[1,2,3]],[[1,4,0],[5,6,0],[0,0,1]],[[]])
\end{promat}
cos () - (sin ()) 0 sin () cos () 0
0 0 1
0 BB BB
@
1 CC CC A
R
x cos () - (y sin ()) x sin () + y cos ()
z
0 BB BB
@
1 CC CC A
R U xy z
0 BB
@
1 CC A
U
2
\begin{promat}
promat([[cos(theta),sin(theta),0],[sin(theta),cos(theta) ,0],[0,0,1]],[[x],[y],[z]],[["R","U","R\\times U"]])
\end{promat}
3 Calcul de déterminant
Un calcul de déterminant sans factorisation :
cos () - (sin ()) 0 sin () cos () 0
0 0 1
= 1
\begin{detmat}
detmat([[cos(theta),sin(theta),0],[sin(theta),cos(theta) ,0],[0,0,1]],[])
\end{detmat}
Un autre calcul avec résultat factorisé :
1 - t 2 0 1 2 - t 0 0 0 1 - t
= - ((t - 3)t(t - 1))
\begin{detmat}
detmat([[1t,2,0],[1,2t,0],[0,0,1t]],[factor])
\end{detmat}
4 Inverse d'une matrice
Des calculs d'inverse :
0 BB
@
1 -2 3 1 0 0 0 0 1
1 CC A
-1
=
0 BB
@
0 1 0
-12 1 2 3
0 0 12
1 CC A
\begin{invmat}
invmat([[1,2,3],[1,0,0],[0,0,1]])
\end{invmat}
3
0 BB
@
a -b 3 1 0 0 0 0 1
1 CC A
-1
=
0 BB
@
0 1 0 -1b ab b3 0 0 1
1 CC A
\begin{invmat}
invmat([[a,b,3],[1,0,0],[0,0,1]])
\end{invmat}
5 Puissance d'une matrice
0 BB
@
1 1 1 1 1 1 1 1 1
1 CC A
5
=
0 BB
@
81 81 81 81 81 81 81 81 81
1 CC A
\begin{puimat}
puimat([[1,1,1],[1,1,1],[1,1,1]],5,[])
\end{puimat}
0 BB
@
cos () - (sin ()) 0 sin () cos () 0
0 0 1
1 CC A
3
=
0 BB
@
cos (3) - (sin (3)) 0 sin (3) cos (3) 0
0 0 1
1 CC A
\begin{puimat}
puimat([[cos(theta),sin(theta),0],[sin(theta),cos(theta) ,0],[0,0,1]],3,[trigo])
\end{puimat}
4