texlive[65821] Master/texmf-dist: resolsysteme (13feb23)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 13 21:53:36 CET 2023


Revision: 65821
          http://tug.org/svn/texlive?view=revision&revision=65821
Author:   karl
Date:     2023-02-13 21:53:35 +0100 (Mon, 13 Feb 2023)
Log Message:
-----------
resolsysteme (13feb23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.pdf
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.tex
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.pdf
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.tex
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.pdf
    trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.tex
    trunk/Master/texmf-dist/tex/latex/resolsysteme/ResolSysteme.sty

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.tex	2023-02-13 20:53:21 UTC (rev 65820)
+++ trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-doc.tex	2023-02-13 20:53:35 UTC (rev 65821)
@@ -3,8 +3,8 @@
 % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
 
 \documentclass[french,a4paper,11pt]{article}
-\def\TPversion{0.1.3}
-\def\TPdate{10 Février 2023}
+\def\TPversion{0.1.4}
+\def\TPdate{12 Février 2023}
 \usepackage[executable=python.exe]{pyluatex}
 \usepackage[table,svgnames]{xcolor}
 \usepackage{amsmath,amssymb}
@@ -20,7 +20,7 @@
 \usepackage{multicol}
 \usepackage{fancyvrb}
 \usepackage{fancyhdr}
-\sisetup{locale=FR,output-decimal-marker={,}}
+\sisetup{locale=FR,output-decimal-marker={,},group-minimum-digits=4}
 \fancyhf{}
 \renewcommand{\headrulewidth}{0pt}
 \lfoot{\sffamily\small [ResolSysteme]}
@@ -36,12 +36,12 @@
 \let\TikZ\tikzlogo
 \newcommand\TableauDocumentation{%
 	\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}}
-		{\huge \LaTeX} & & & & &\\
-		& {\huge \hologo{pdfLaTeX}} & & & & \\
-		& & {\huge \hologo{LuaLaTeX}} & & & \\
-		& & & {\huge \TikZ} & & \\
-		& & & & {\huge \TeXLive} & \\
-		& & & & & {\huge \hologo{MiKTeX}} \\
+		{\LARGE \LaTeX} & & & & &\\
+		& {\LARGE \hologo{pdfLaTeX}} & & & & \\
+		& & {\LARGE \hologo{LuaLaTeX}} & & & \\
+		& & & {\LARGE \TikZ} & & \\
+		& & & & {\LARGE \TeXLive} & \\
+		& & & & & {\LARGE \hologo{MiKTeX}} \\
 	\end{tblr}
 }
 
@@ -162,6 +162,10 @@
 
 {$\blacktriangleright$~~Des commandes pour résoudre des systèmes linéaires (2x2, 3x3 ou 4x4).}
 
+\smallskip
+
+{$\blacktriangleright$~~Des commandes pour travailler sur des graphes probabilistes (2x2, 3x3 ou 4x4).}
+
 \vspace{1cm}
 
 \begin{center}
@@ -221,12 +225,13 @@
 \subsection{Introduction}
 
 \begin{noteblock}
-La package \textit{propose} des outils pour travailler sur des matrices ou des systèmes linéaires (de taille réduite !) :
+La package \textit{propose} des outils pour travailler sur des matrices ou des systèmes linéaires ou des graphes probabilistes (de tailles réduites !) :
 
 \begin{itemize}
-	\item en calculant des produits matriciels \textit{simples} (dimensions réduites) ;
-	\item en affichant la \textbf{solution} (si elle existe) ;
-	\item en affichant le \textbf{déterminant} et l'éventuelle \textbf{inverse} de la matrice des coefficients.
+	\item en calculant des \textbf{produits matriciels} \textit{simples} (dimensions réduites) ;
+	\item en affichant la \textbf{solution} (si elle existe) d'un système linéaire ;
+	\item en affichant le \textbf{déterminant} et l'éventuelle \textbf{inverse} de la matrice des coefficients ;
+	\item en déterminant un \textbf{état probabiliste} ou l'éventuel \textbf{état stable} d'un graphe probabiliste.
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{noteblock}
@@ -235,7 +240,7 @@
 À noter que les calculs -- en interne -- peuvent être effectués de deux manières :
 
 \begin{itemize}
-	\item via les packages \textsf{xint*} pour des formats \textbf{2x2} ou \textbf{3x3} ;
+	\item via les packages \textsf{xint*} pour des formats \textbf{2x2} ou \textbf{3x3} (et dans une certaine mesure pour des \textbf{4x4}) ;
 	\item via \textsf{python} et le package \textsf{pyluatex} (à charger manuellement du fait des options spécifiques) pour des formats \textbf{2x2}, \textbf{3x3} ou \textbf{4x4}.
 \end{itemize}
 
@@ -253,7 +258,7 @@
 \subsection{Packages utilisés, choix de formatage}
 
 \begin{noteblock}
-Le package charge les packages suivantes :
+\textsf{ResolSysteme} charge les packages suivantes :
 
 \begin{itemize}
 	\item \texttt{xintexpr}, \texttt{xinttools}, \texttt{xstring} et \texttt{listofitems} ;
@@ -302,8 +307,20 @@
 \usepackage[pyluatex]{ResolSysteme}
 \end{PresentationCode}
 
+\section{Comparaison avec d'autres solutions}
+
+\begin{noteblock}
+D'autres solutions existent pour faire du calcul matriciel, on peut pas exemple citer les excellents packages \textsf{calculator} ou \textsf{lualinalg} !
+
+\smallskip
+
+L'idée est ici de proposer une version, adaptée à des dimensions classiques, avec formatage des calculs, sous forme de fraction irréductible notamment. Les formatages étant effectués \textit{a posteriori}, j'ai choisi de limiter ce package à des formats de taille raisonnable (\textbf{1x2} à \textbf{4x4}).
+\end{noteblock}
+
 \part{Historique}
 
+\verb|v0.1.4|~:~~~~Ajout de commandes pour du calcul matriciel sans pyton (de taille raisonnable) + commandes pour des graphes probabilistes.
+
 \verb|v0.1.3|~:~~~~Ajout de commandes pour du calcul matriciel (de taille raisonnable) + inversion comportement des commandes étoilées.
 
 \verb|v0.1.2|~:~~~~Ajout d'une commande d'affichage (formaté) d'une matrice 2x2, 3x3 ou 4x4.
@@ -314,7 +331,7 @@
 
 \pagebreak
 
-\part{Commandes}
+\part{Commandes et calculs matriciels}
 
 \section{Une commande interne : écriture sous forme d'une fraction}
 
@@ -369,7 +386,7 @@
 \subsection{Interaction avec les commandes \og matricielles \fg, limitations}
 
 \begin{warningblock}
-En \textit{interne}, le formatage des résultats est géré par cette commande, et les options disponibles existent donc de la même manière pour les commandes liées aux systèmes linéaires.
+En \textit{interne}, le formatage des résultats est donc géré par cette commande, et les options disponibles existent donc de la même manière pour les commandes liées aux systèmes linéaires et aux calculs matriciels.
 
 \smallskip
 
@@ -382,16 +399,16 @@
 
 \pagebreak
 
-\section{Affichage d'une matrice}
+\section{Affichage d'une matrice carrée}
 
 \subsection{La commande}
 
 \begin{cautionblock}
-La première commande (matricielle) est dédiée à l'affichage d'une matrice \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} (\texttt{python} est ici non nécessaire):
+Une commande (matricielle) est dédiée à l'affichage d'une matrice \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} (\textsf{python} est ici non nécessaire !) :
 
 \begin{itemize}
 	\item en saisissant les coefficients via une syntaxe propre au package (l'affichage est géré en interne par \textsf{nicematrix}) ;
-	\item en caclulant et convertissant éventuellement les coefficients sous forme de fraction (grâce à la commande précédente !).
+	\item en calculant et convertissant éventuellement les coefficients sous forme de fraction (grâce à la commande précédente !).
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{cautionblock}
@@ -417,7 +434,7 @@
 		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
 	\end{itemize}
 	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
-	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}).
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}).
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{tipblock}
@@ -453,8 +470,12 @@
 		\item $(1\times3)\times(3\times3)$ ;
 		\item $(3\times3)\times(3\times3)$ ;
 		\item $(3\times3)\times(3\times1)$ ;
+		\item $(1\times4)\times(4\times1)$ ;
+		\item $(1\times4)\times(4\times4)$ ;
+		\item $(4\times4)\times(4\times4)$ ;
+		\item $(4\times4)\times(4\times1)$ ;
 	\end{itemize}
-	\item le carré d'une matrice 2x2 ou 3x3 ;
+	\item le carré d'une matrice 2x2 ou 3x3 ou 4x4 ;
 	\item la puissance d'une matrice 2x2 ou 3x3 ou 4x4 (via \textsf{python}).
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
@@ -463,7 +484,8 @@
 \begin{PresentationCode}{listing only}
 %commandes disponible avec les deux versions, pyluatex ou non
 \ProduitMatrices(*)[option de formatage]<options nicematrix>(matrice 1)(matrice 2)[Clé]
-\CarreMatrice(*)[option de formatage]<options nicematrix>(matrice)(-5,6 § 1,4)[Clé]
+\ProduitMatricesPY(*)[option de formatage]<options nicematrix>(matrice 1)(matrice 2)[Clé]
+\CarreMatrice(*)[option de formatage]<options nicematrix>(matrice)[Clé]
 
 %commande disponible avec l'option pyluatex
 \MatricePuissancePY(*)[option de formatage]<options nicematrix>(matrice)(puissance)[Clé]
@@ -470,7 +492,7 @@
 \end{PresentationCode}
 
 \begin{warningblock}
-Dans le cas où le produit matriciel n'existe pas, ou ne rentre pas dans le cadre des cas possibles, rien ne sera affiché !
+Dans le cas où le produit matriciel n'existe pas (un test de dimensions est effectué), ou ne rentre pas dans le cadre des cas possibles, rien ne sera affiché !
 \end{warningblock}
 
 \subsection{Utilisation}
@@ -489,7 +511,7 @@
 		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
 	\end{itemize}
 	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
-	\item les arguments suivants, \textit{obligatoires} et entre \textsf{(...)}, sont quant à eux, les matrices données par leurs coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ou la matrice et la puissance ;
+	\item les arguments suivants, \textit{obligatoires} et entre \textsf{(...)}, sont quant à eux, les matrices données par leurs coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}) ou la matrice et la puissance ;
 	\item le dernier argument, \textit{optionnel} et entre \textsf{[...]} propose l'unique \frquote{clé} \Cle{Aff} pour afficher le calcul avant le résultat.
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
@@ -504,6 +526,17 @@
 \end{PresentationCode}
 
 \begin{PresentationCode}{}
+$\ProduitMatrices(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)(1 § 2 § 3 § 4)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\ProduitMatrices%
+	(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)%
+	(1,5,4,0 § 2,-1,-1,5 § 3,0,1,2, § 4,6,9,10)
+	[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
 $\CarreMatrice(-5,6 § 1,4)[Aff]$
 \end{PresentationCode}
 
@@ -530,11 +563,10 @@
 \subsection{Introduction}
 
 \begin{cautionblock}
-La deuxième commande (matricielle) disponible est pour calculer le déterminant d'une matrice :
+Une commande est disponible pour calculer le déterminant d'une matrice :
 
 \begin{itemize}
-	\item \textbf{2x2} ou \textbf{3x3} pour le package \textit{classique} ;
-	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour le package \textit{lua}.
+	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4}.
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{cautionblock}
@@ -562,7 +594,7 @@
 		\item \Cle{dec} pour l'affichage du résultat en mode \texttt{décimal} (sans arrondi !) ;
 		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
 	\end{itemize}
-	\item le second argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{héritée} de \texttt{sympy}).
+	\item le second argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}).
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{tipblock}
@@ -586,6 +618,11 @@
 \end{PresentationCode}
 
 \begin{PresentationCode}{}
+Le dét. de $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\2&-3&-5&-6 \end{pNiceMatrix}$
+est $\det(A)=\DetMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
 %version python
 Le dé. de $A=\AffMatrice(1,2 § 3,4)$ est
 $\det(A)=\DetMatricePY(1,2 § 3,4)$.
@@ -593,7 +630,8 @@
 
 \begin{PresentationCode}{}
 Le dét. de $A=\AffMatrice[dec](-1,0.5 § 1/2,4)$ est
-$\det(A)=\DetMatricePY[d](-1,0.5 § 1/2,4)$.\end{PresentationCode}
+$\det(A)=\DetMatricePY[d](-1,0.5 § 1/2,4)$.
+\end{PresentationCode}
 
 \begin{PresentationCode}{}
 %version python
@@ -601,6 +639,12 @@
 $\det(A) \approx \DetMatricePY[dec=3](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$.
 \end{PresentationCode}
 
+\begin{PresentationCode}{}
+%version python
+Le dét. de $A=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$
+est $\det(A)=\DetMatricePY(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
+\end{PresentationCode}
+
 \pagebreak
 
 \section{Inverse d'une matrice}
@@ -608,11 +652,11 @@
 \subsection{Introduction}
 
 \begin{cautionblock}
-La troisième commande (matricielle) disponible est pour calculer l'éventuelle inverse d'une matrice :
+Une commande (matricielle) disponible est pour calculer l'éventuelle inverse d'une matrice :
 
 \begin{itemize}
 	\item \textbf{2x2} ou \textbf{3x3} pour le package \textit{classique} ;
-	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour le package \textit{lua}.
+	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour la version \textsf{python}.
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{cautionblock}
@@ -641,7 +685,7 @@
 		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
 	\end{itemize}
 	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
-	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ;
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}) ;
 	\item le dernier argument, \textit{optionnel} et entre \textsf{[...]} propose l'unique \frquote{clé} \Cle{Aff} pour afficher le calcul avant le résultat.
 \end{itemize}
 À noter que si la matrice n'est pas inversible, le texte \texttt{Matrice non inversible} est affiché.
@@ -674,16 +718,120 @@
 
 \pagebreak
 
+\section{États avec un graphe probabiliste}
+
+\subsection{Introduction}
+
+\begin{cautionblock}
+\cmaj{0.1.4} Il existe des commandes pour travailler sur un graphe probabiliste (avec le package en version \textsf{python}) :
+
+\begin{itemize}
+	\item afficher un état probabiliste (\textbf{1x2} ou \textbf{1x3} ou \textbf{1x4}, version normale ou version \textsf{python}) ;
+	\item déterminer un état probabiliste à une certaine étape, uniquement en version \textsf{python}.
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{cautionblock}
+
+\begin{PresentationCode}{listing only}
+%version classique ou python
+\AffEtatProb[opt de formatage]<opts nicematrix>(matrice ligne)
+\EtatProbPY[opt de formatage]<opts nicematrix>(état init)(mat de trans)(étape)
+\end{PresentationCode}
+
+\subsection{Utilisation}
+
+\begin{tipblock}
+Concernant la commande d'affichage d'un état, qui est à insérer dans un environnement \textit{math} :
+
+\begin{itemize}
+	\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
+	\begin{itemize}
+		\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
+		\item \Cle{d} pour l'affichage de la fraction en mode \textsf{dfrac} ;
+		\item \Cle{n} pour l'affichage de la fraction en mode \textsf{nicefrac} ;
+		\item \Cle{dec} pour l'affichage du résultat en mode \texttt{décimal} (sans arrondi !) ;
+		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
+	\end{itemize}
+	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,...} (syntaxe \textit{inspirée} de \texttt{sympy}).
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{tipblock}
+
+\begin{tipblock}
+Concernant la commande d'affichage d'un état à une étape donnée, qui est à insérer dans un environnement \textit{math} :
+
+\begin{itemize}
+	\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat \textsf{[dec] par défaut} :
+	\begin{itemize}
+		\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
+		\item \Cle{d} pour l'affichage de la fraction en mode \textsf{dfrac} ;
+		\item \Cle{n} pour l'affichage de la fraction en mode \textsf{nicefrac} ;
+		\item \Cle{dec} pour l'affichage du résultat en mode \texttt{décimal} (sans arrondi !) ;
+		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
+	\end{itemize}
+	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,a13} (syntaxe \textit{inspirée} de \texttt{sympy}) ;
+	\item le quatrième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice de transition donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}) ;
+	\item le cinquième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, le numéro de l'étape voulue
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{tipblock}
+
+\begin{PresentationCode}{}
+État initial : $P_0 = \AffEtatProb[t](1/3,2/3)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec](0.75,0.25 § 0.9,0.1)$
+
+État à l'instant 5 :
+$P_5 \approx \EtatProbPY[dec=3](1/3,2/3)%
+	(0.75,0.25 § 0.9,0.1)
+	(5)$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+État initial : $P_0 = \AffEtatProb[dec](0.33,0.52,0.15)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec]%
+(0.1,0.2,0.7 § 0.25,0.25,0.5 § 0.15,0.75,0.1)$
+
+État à l'instant 7 :
+$P_7 \approx \EtatProbPY[dec=3]
+	(0.33,0.52,0.15)%
+	(0.1,0.2,0.7 § 0.25,0.25,0.5 § 0.15,0.75,0.1)
+	(7)$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+État initial : $P_0 = \AffEtatProb[dec](0.33,0.52,0.15,0)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec]%
+(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$
+
+État à l'instant 4 :
+$P_4 \approx \EtatProbPY[dec=3]
+	(0.33,0.52,0.15,0)%
+	(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)%
+	(4)$
+\end{PresentationCode}
+
+\pagebreak
+
+\part{Résolution de systèmes}
+
 \section{Résolution d'un système linéaire}
 
 \subsection{Introduction}
 
 \begin{cautionblock}
-La deuxième commande (matricielle) disponible est pour déterminer l'éventuelle solution d'un système linéaire  qui s'écrit matriciellement $A\times X=B$:
+Il existe une commande (matricielle) pour déterminer l'éventuelle solution d'un système linéaire qui s'écrit matriciellement $A\times X=B$:
 
 \begin{itemize}
 	\item \textbf{2x2} ou \textbf{3x3} pour le package \textit{classique} ;
-	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour le package \textit{lua}.
+	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour le package en version \textsf{python}.
 \end{itemize}
 \vspace*{-\baselineskip}\leavevmode
 \end{cautionblock}
@@ -712,8 +860,8 @@
 		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
 	\end{itemize}
 	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
-	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $A$ donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ;
-	\item le quatrième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $B$ donnée par ses coefficients \textsf{b11,b21,...} (syntaxe héritée de \texttt{sympy}) ;
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $A$ donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}) ;
+	\item le quatrième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $B$ donnée par ses coefficients \textsf{b11,b21,...} (syntaxe \textit{inspirée} de \texttt{sympy}) ;
 	\item le dernier argument, \textit{optionnel} et entre \textsf{[...]}, permet -- grâce à la \textit{clé} \Cle{Matrice} -- de présenter le vecteur solution.
 \end{itemize}
 À noter que si la matrice n'est pas inversible, le texte \texttt{Matrice non inversible} est affiché.
@@ -750,12 +898,95 @@
 
 \pagebreak
 
+\section{Recherche d'un état stable (graphe probabiliste)}
+
+\subsection{Introduction}
+
+\begin{cautionblock}
+\cmaj{0.1.4} Il existe une commande (matricielle) pour déterminer l'éventuel état stable d'un graphe probabiliste :
+
+\begin{itemize}
+	\item \textbf{2x2} pour le package \textit{classique} ;
+	\item \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} pour le package en version \textsf{python}.
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{cautionblock}
+
+\begin{PresentationCode}{listing only}
+%version classique
+\EtatStable[opt de formatage]<opts nicematrix>(matriceA)
+
+%version python
+\EtatStablePY[opt de formatage]<opts nicematrix>(matriceA)
+\end{PresentationCode}
+
+\subsection{Utilisation}
+
+\begin{tipblock}
+Concernant cette commande, qui est à insérer dans un environnement \textit{math} :
+
+\begin{itemize}
+	\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
+	\begin{itemize}
+		\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
+		\item \Cle{d} pour l'affichage de la fraction en mode \textsf{dfrac} ;
+		\item \Cle{n} pour l'affichage de la fraction en mode \textsf{nicefrac} ;
+		\item \Cle{dec} pour l'affichage du résultat en mode \texttt{décimal} (sans arrondi !) ;
+		\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
+	\end{itemize}
+	\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
+	\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe \textit{inspirée} de \texttt{sympy}).
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{tipblock}
+
+\begin{PresentationCode}{}
+%version classique
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.72,0.28 § 0.12,0.88)$
+
+est $\Pi = \EtatStable[d](0.72,0.28 § 0.12,0.88)$
+ou $\Pi = \EtatStable[dec](0.72,0.28 § 0.12,0.88)$.
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+%version python
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.72,0.28 § 0.12,0.88)$
+
+est $\Pi = \EtatStablePY[d](0.72,0.28 § 0.12,0.88)$
+ou $\Pi = \EtatStablePY[dec](0.72,0.28 § 0.12,0.88)$.
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+%version python
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$
+
+est $\Pi = \EtatStablePY[d](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$
+ou $\Pi = \EtatStablePY[dec](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$.
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+%version python
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec]%
+	(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$
+
+est $\Pi \approx
+\EtatStablePY[dec=5]%
+(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$.
+\end{PresentationCode}
+
+
+\pagebreak
+
 \part{Fonctions python utilisées}
 
 \begin{cautionblock}
 Les fonctions utilisées par les packages \textsf{pyluatex} ou \textsf{pythontex} sont données ci-dessous.
 
-Elles sont accessibles en \textit{natif} une fois l'option \textsf{lua} activée, grâce notamment à la macro \texttt{\textbackslash py}.
+Elles sont accessibles en \textit{natif} une fois l'option \textsf{pyluatex} activée, grâce notamment à la macro \texttt{\textbackslash py}.
 \end{cautionblock}
 
 \begin{PresentationCodePython}{listing only}
@@ -836,4 +1067,35 @@
 	return PuissMatTmp
 \end{PresentationCodePython}
 
+\begin{PresentationCodePython}{listing only}
+def etat_prob_QQ(AA,BB,CC,DD,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB,CC,DD])).T
+	MatTmpTrans = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+
+def etat_prob_TT(AA,BB,CC,a,b,c,d,e,f,g,h,i,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB,CC])).T
+	MatTmpTrans = sy.Matrix(([a,b,c],[d,e,f],[g,h,i]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+
+def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB])).T
+	MatTmpTrans = sy.Matrix(([a,b],[c,d]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+\end{PresentationCodePython}
+
+\begin{PresentationCodePython}{listing only}
+def resol_etat_stable_TT(a,b,c,d,e,f,g,h,i) :
+	solution=sy.solve([(a-1)*x+d*y+g*z,b*x+(e-1)*y+h*z,c*x+f*y+(i-1)*z,x+y+z-1],[x,y,z])
+	return solution
+
+def resol_etat_stable_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) :
+	solution=sy.solve([(a-1)*x+e*y+i*z+m*t,b*x+(f-1)*y+j*z+n*t,
+	c*x+g*y+(k-1)*z+o*t,d*x+h*y+l*z+(p-1)*t,x+y+z+t-1],[x,y,z,t])
+	return solution
+\end{PresentationCodePython}
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.tex	2023-02-13 20:53:21 UTC (rev 65820)
+++ trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples-pyluatex.tex	2023-02-13 20:53:35 UTC (rev 65821)
@@ -2,7 +2,7 @@
 % !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
 
 \documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.3}
+\def\RSver{0.1.4}
 \usepackage[margin=1.5cm]{geometry}
 \usepackage[executable=python.exe]{pyluatex}
 \usepackage[pyluatex]{ResolSysteme}
@@ -9,7 +9,7 @@
 \usepackage{systeme}
 \usepackage{babel}
 \usepackage[most]{tcolorbox}
-\sisetup{locale=FR,output-decimal-marker={,}}
+\sisetup{locale=FR,output-decimal-marker={,},group-minimum-digits=4}
 \newtcblisting{ShowCodeTeX}[1][]{colback=white,colframe=red!75!black,listing options={style=tcblatex},#1}
 
 \begin{document}
@@ -35,25 +35,49 @@
 et $C=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
 \end{ShowCodeTeX}
 
-\section{Calculs avec des matrices, 2x2 ou 3x3}
+\section{Déterminant d'une matrice, 2x2 ou 3x3 ou 4x4}
 
 \begin{ShowCodeTeX}
-$\ProduitMatrices(1,2)(3 § 4)[Aff]$ et $\ProduitMatrices(1,2)(3,4 § 5,6)[Aff]$ \\
-$\ProduitMatrices(-5,6 § 1,4)(2 § 7)[Aff]$ et $\ProduitMatrices(-5,6 § 1,4)(2,-4 § 7,0)[Aff]$
+Le déterminant de $A=\AffMatrice(1,2 § 3,4)$ est
+$\det(A)=\DetMatricePY(1,2 § 3,4)$.
 \end{ShowCodeTeX}
 
 \begin{ShowCodeTeX}
-$\ProduitMatrices(1,2,3)(4 § 5 § 6)[Aff]$ et $\ProduitMatrices(1,2,3)(1,1,1 § 2,1,5 § 0,5,-6)[Aff]$\\
-$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1 § 2 § 3)[Aff]$ et
-$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1,2,3 § -5,-4,2 § 3,3,10)[Aff]$
+Le déterminant de $A=\AffMatrice(-1,0.5 § -1/2,4)$ est
+$\det(A)=\DetMatricePY[dec](-1,0.5 § -1/2,4)$.
 \end{ShowCodeTeX}
 
 \begin{ShowCodeTeX}
-$\CarreMatrice(-5,6 § 1,4)[Aff]$ \\
-$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$
+Le dét. de $A=\begin{pNiceMatrix} -1&\frac13&4 \\ \frac13&4&-1 \\ -1&0&0 \end{pNiceMatrix}$ est
+$\det(A) \approx \DetMatricePY[dec=3](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$.
 \end{ShowCodeTeX}
 
 \begin{ShowCodeTeX}
+Le dét. de $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\2&-3&-5&-6 \end{pNiceMatrix}$
+est $\det(A)=\DetMatricePY(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
+\end{ShowCodeTeX}
+
+\section{Calculs avec des matrices, 2x2 ou 3x3 ou 4x4}
+
+\begin{ShowCodeTeX}
+$\ProduitMatricesPY(1,2)(3 § 4)[Aff]$ et $\ProduitMatricesPY(1,2)(3,4 § 5,6)[Aff]$ \\
+$\ProduitMatricesPY(-5,6 § 1,4)(2 § 7)[Aff]$ et $\ProduitMatricesPY(-5,6 § 1,4)(2,-4 § 7,0)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\ProduitMatricesPY(1,2,3)(4 § 5 § 6)[Aff]$ et $\ProduitMatricesPY(1,2,3)(1,1,1 § 2,1,5 § 0,5,-6)[Aff]$\\
+$\ProduitMatricesPY(1,1,1 § 2,1,5 § 0,5,-6)(1 § 2 § 3)[Aff]$ et
+$\ProduitMatricesPY(1,1,1 § 2,1,5 § 0,5,-6)(1,2,3 § -5,-4,2 § 3,3,10)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\ProduitMatricesPY(1,2,3,4)(5 § 6 § 7 § 8)[Aff]$\\
+$\ProduitMatricesPY(1,2,3,4)(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)[Aff]$\\
+$\ProduitMatricesPY(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)(1 § 2 § 3 § 4)[Aff]$\\
+$\ProduitMatricesPY(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)(1,5,4,0 § 2,-1,-1,5 § 3,0,1,2, § 4,6,9,10)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
 $\MatricePuissancePY(1,1 § 5,-2)(7)[Aff]$\\
 $\MatricePuissancePY(1,1,-1 § 5,-2,1 § 0,5,2)(3)[Aff]$ \\
 $\MatricePuissancePY(1,1,1,1 § 5,-2,1,5 § 0,5,2,-1 § 0,1,1,1)(5)[Aff]$
@@ -136,4 +160,71 @@
     [Matrice]$
 \end{ShowCodeTeX}
 
+\section{État probabiliste d'un graphe probabiliste, 2x2 ou 3x3 ou 4x4}
+
+\begin{ShowCodeTeX}
+État initial : $P_0 = \AffEtatProb[t](1/3,2/3)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec](0.75,0.25 § 0.9,0.1)$
+
+État à l'instant 5 :
+$P_5 \approx \EtatProbPY[dec=3](1/3,2/3)%
+	(0.75,0.25 § 0.9,0.1)
+	(5)$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+État initial : $P_0 = \AffEtatProb[dec](0.33,0.52,0.15)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec]%
+(0.1,0.2,0.7 § 0.25,0.25,0.5 § 0.15,0.75,0.1)$
+
+État à l'instant 7 :
+$P_7 \approx \EtatProbPY[dec=3]
+	(0.33,0.52,0.15)%
+	(0.1,0.2,0.7 § 0.25,0.25,0.5 § 0.15,0.75,0.1)
+	(7)$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+État initial : $P_0 = \AffEtatProb[dec](0.33,0.52,0.15,0)$.
+
+Matrice de transition :
+$M=\AffMatrice[dec]%
+	(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$
+
+État à l'instant 4 :
+$P_4 \approx \EtatProbPY[dec=3]
+	(0.33,0.52,0.15,0)%
+	(0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)%
+	(4)$
+\end{ShowCodeTeX}
+
+\section{État stable d'un graphe probabiliste, 2x2 ou 3x3 ou 4x4}
+
+\begin{ShowCodeTeX}
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.72,0.28 § 0.12,0.88)$
+
+est $\Pi = \EtatStablePY[d](0.72,0.28 § 0.12,0.88)$
+ou $\Pi = \EtatStablePY[dec](0.72,0.28 § 0.12,0.88)$.
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$
+
+est $\Pi = \EtatStablePY[d](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$
+ou $\Pi = \EtatStablePY[dec](0.9,0.03,0.07 § 0.30,0.43,0.27 § 0.14,0.07,0.79)$.
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$
+
+est $\Pi \approx \EtatStablePY[dec=5](0.1,0.2,0.3,0.4 § 0.25,0.25,0.25,0.25 § 0.15,0.15,0.2,0.5 § 0.3,0.3,0.2,0.2)$.
+\end{ShowCodeTeX}
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.tex	2023-02-13 20:53:21 UTC (rev 65820)
+++ trunk/Master/texmf-dist/doc/latex/resolsysteme/ResolSysteme-exemples.tex	2023-02-13 20:53:35 UTC (rev 65821)
@@ -2,7 +2,7 @@
 % !TeX TXS-program:compile = txs:///pdflatex
 
 \documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.3}
+\def\RSver{0.1.4}
 \usepackage[margin=1.5cm]{geometry}
 \usepackage{ResolSysteme}
 \usepackage{systeme}
@@ -33,7 +33,7 @@
 et $C=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
 \end{ShowCodeTeX}
 
-\section{Calculs avec des matrices, 2x2 ou 3x3}
+\section{Calculs avec des matrices, 2x2 ou 3x3 ou 4x4}
 
 \begin{ShowCodeTeX}
 $\ProduitMatrices(1,2)(3 § 4)[Aff]$ et $\ProduitMatrices(1,2)(3,4 § 5,6)[Aff]$ \\
@@ -47,11 +47,19 @@
 \end{ShowCodeTeX}
 
 \begin{ShowCodeTeX}
+$\ProduitMatrices(1,2,3,4)(5 § 6 § 7 § 8)[Aff]$\\
+$\ProduitMatrices(1,2,3,4)(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)[Aff]$\\
+$\ProduitMatrices(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)(1 § 2 § 3 § 4)[Aff]$\\
+$\ProduitMatrices(1,1,1,5 § 2,1,5,6 § 0,5,-6,0 § 1,-5,4,2)(1,5,4,0 § 2,-1,-1,5 § 3,0,1,2, § 4,6,9,10)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
 $\CarreMatrice(-5,6 § 1,4)[Aff]$ \\
-$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$
+$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$\\
+$\CarreMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)[Aff]$
 \end{ShowCodeTeX}
 
-\section{Déterminant d'une matrice, 2x2 ou 3x3}
+\section{Déterminant d'une matrice, 2x2 ou 3x3 ou 4x4}
 
 \begin{ShowCodeTeX}
 Le déterminant de $A=\AffMatrice(1,2 § 3,4)$ est
@@ -68,6 +76,11 @@
 $\det(A) \approx \DetMatrice[dec=3](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$.
 \end{ShowCodeTeX}
 
+\begin{ShowCodeTeX}
+Le dét. de $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\2&-3&-5&-6 \end{pNiceMatrix}$
+est $\det(A)=\DetMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
+\end{ShowCodeTeX}
+
 \section{Inverse d'une matrice, 2x2 ou 3x3}
 
 \begin{ShowCodeTeX}
@@ -127,4 +140,14 @@
 \left\lbrace \SolutionSysteme[d](3,1,-2 § 2,-1,1 § 1,-1,-2)(-1,4,5) \right\rbrace$.
 \end{ShowCodeTeX}
 
+\section{État stable d'une graphe probabiliste, 2x2}
+
+\begin{ShowCodeTeX}
+L'état stable du gr. prob. de matrice
+$M=\AffMatrice[dec](0.72,0.28 § 0.12,0.88)$
+
+est $\Pi = \EtatStable[d](0.72,0.28 § 0.12,0.88)$
+ou $\Pi = \EtatStable[dec](0.72,0.28 § 0.12,0.88)$.
+\end{ShowCodeTeX}
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/resolsysteme/ResolSysteme.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/resolsysteme/ResolSysteme.sty	2023-02-13 20:53:21 UTC (rev 65820)
+++ trunk/Master/texmf-dist/tex/latex/resolsysteme/ResolSysteme.sty	2023-02-13 20:53:35 UTC (rev 65821)
@@ -2,11 +2,12 @@
 % licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ResolSysteme}[2023/02/10 v0.1.3 Travailler sur un systeme lineaire avec xint ou pyluatex]
-% 0.1.3		Produit matriciel + Puissance matricielle (2x2/3x3 carré en normal, 2x2/3x3/4x4 avec python) + Inversion comportement commandes étoilées
-% 0.1.2		Ajout pour afficher une matrice, à l'aide d'une syntaxe similaire aux autres commandes
-% 0.1.1		Correction d'un bug avec le séparateur ";"
-% 0.1.0		Version initiale
+\ProvidesPackage{ResolSysteme}[2023/02/12 v0.1.4 Quelques commandes pour travailler avec des matrices et des sytemes lineaires]
+% 0.1.4	Travail sur graphe probabiliste (2x2/3x3/4x4 en python, ou 2x2 en normal...) + Calculs 4x4 en normal
+% 0.1.3	Produit matriciel + Puissance matricielle (2x2/3x3 carré en normal, 2x2/3x3/4x4 avec python) + Inversion comportement commandes étoilées
+% 0.1.2	Ajout pour afficher une matrice, à l'aide d'une syntaxe similaire aux autres commandes
+% 0.1.1	Correction d'un bug avec le séparateur ";"
+% 0.1.0	Version initiale
 
 %------Option(s)
 \newif\if at pyluatex \@pyluatexfalse
@@ -90,6 +91,32 @@
 	PuissMatTmp = MatTmp**puiss
 	return PuissMatTmp
 
+def resol_etat_stable_TT(a,b,c,d,e,f,g,h,i) :
+	solution=sy.solve([(a-1)*x+d*y+g*z,b*x+(e-1)*y+h*z,c*x+f*y+(i-1)*z,x+y+z-1],[x,y,z])
+	return solution
+
+def resol_etat_stable_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) :
+	solution=sy.solve([(a-1)*x+e*y+i*z+m*t,b*x+(f-1)*y+j*z+n*t,c*x+g*y+(k-1)*z+o*t,d*x+h*y+l*z+(p-1)*t,x+y+z+t-1],[x,y,z,t])
+	return solution
+
+def etat_prob_QQ(AA,BB,CC,DD,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB,CC,DD])).T
+	MatTmpTrans = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+
+def etat_prob_TT(AA,BB,CC,a,b,c,d,e,f,g,h,i,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB,CC])).T
+	MatTmpTrans = sy.Matrix(([a,b,c],[d,e,f],[g,h,i]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+
+def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
+	MatTmpInit = sy.Matrix(([AA,BB])).T
+	MatTmpTrans = sy.Matrix(([a,b],[c,d]))
+	EtatProbRes = MatTmpInit * MatTmpTrans**puiss
+	return EtatProbRes
+
 \end{python}
 \fi
 
@@ -138,13 +165,7 @@
 		{}%si l'argument optionnel est vide
 		\IfStrEq{#2}{n}%
 		{%
-			%\IfBooleanTF{#1}%
-			{\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
-			%{%
-			%	\ifthenelse{\numerateur < 0}%
-			%		{\ensuremath{-\nicefrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
-			%		{\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
-			%}%
+			\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}
 		}%
 		{}%si l'argument optionnel est vide
 		\IfSubStr{#2}{dec}%on veut la forme décimale
@@ -169,7 +190,7 @@
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
 	%3=options nicematrix
-	%4=matrice (,,;,,)
+	%4=matrice (,,§,,)
 	%---------------------
 	%lectures des matrices
 	\setsepchar{§/,}%
@@ -306,12 +327,60 @@
 	\fi
 }
 
+%------Affichage d'une matrice classique, 2x2 ou 3x3 ou 4x4
+\NewDocumentCommand\AffEtatProb{ O{} D<>{} r() }{%
+	%1=options conversion
+	%2=options nicematrix
+	%3=matrice (,,,,)
+	%---------------------
+	%lectures des matrices
+	\setsepchar{,}%
+	\readlist*\MAMATRICEA{#3}%
+	%les coeffs de A et le déterminant et les coeff de l'inverse
+	\ifnum \MAMATRICEAlen=3
+		\itemtomacro\MAMATRICEA[1]\MatA
+		\itemtomacro\MAMATRICEA[2]\MatB
+		\itemtomacro\MAMATRICEA[3]\MatC
+		%les conversions
+		\def\MatAffA{\ConvVersFrac*[#1]{\MatA}}%
+		\def\MatAffB{\ConvVersFrac*[#1]{\MatB}}%
+		\def\MatAffC{\ConvVersFrac*[#1]{\MatC}}%
+		%l'affichage
+		\begin{pNiceMatrix}[#2]
+			{\MatAffA}&{\MatAffB}&{\MatAffC}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=2
+		\itemtomacro\MAMATRICEA[1]\MatA
+		\itemtomacro\MAMATRICEA[2]\MatB
+		\def\MatAffA{\ConvVersFrac*[#1]{\MatA}}%
+		\def\MatAffB{\ConvVersFrac*[#1]{\MatB}}%
+		%l'affichage
+		\begin{pNiceMatrix}[#2]
+			{\MatAffA}&{\MatAffB}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=4
+		\itemtomacro\MAMATRICEA[1]\MatA
+		\itemtomacro\MAMATRICEA[2]\MatB
+		\itemtomacro\MAMATRICEA[3]\MatC
+		\itemtomacro\MAMATRICEA[4]\MatD
+		\def\MatAffA{\ConvVersFrac*[#1]{\MatA}}%
+		\def\MatAffB{\ConvVersFrac*[#1]{\MatB}}%
+		\def\MatAffC{\ConvVersFrac*[#1]{\MatC}}%
+		\def\MatAffD{\ConvVersFrac*[#1]{\MatD}}%
+		%l'affichage
+		\begin{pNiceMatrix}[#2]
+			{\MatAffA} & {\MatAffB} & {\MatAffC} & {\MatAffD}
+			\end{pNiceMatrix}%
+	\fi
+}
 
 \NewDocumentCommand\CarreMatrice{ s O{} D<>{} r() O{} }{%
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
 	%3=options nicematrix
-	%4=matrice (,,;,,)
+	%4=matrice (,,§,,)
 	%5=affichage énoncé avec [Aff]
 	%---------------------
 	%lectures des matrices
@@ -318,6 +387,89 @@
 	\setsepchar{§/,}%
 	\readlist*\MAMATRICEA{#4}%
 	%les coeffs de A
+	\ifnum \MAMATRICEAlen=4
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[1,4]\MatD
+		\itemtomacro\MAMATRICEA[2,1]\MatE
+		\itemtomacro\MAMATRICEA[2,2]\MatF
+		\itemtomacro\MAMATRICEA[2,3]\MatG
+		\itemtomacro\MAMATRICEA[2,4]\MatH
+		\itemtomacro\MAMATRICEA[3,1]\MatI
+		\itemtomacro\MAMATRICEA[3,2]\MatJ
+		\itemtomacro\MAMATRICEA[3,3]\MatK
+		\itemtomacro\MAMATRICEA[3,4]\MatL
+		\itemtomacro\MAMATRICEA[4,1]\MatM
+		\itemtomacro\MAMATRICEA[4,2]\MatN
+		\itemtomacro\MAMATRICEA[4,3]\MatO
+		\itemtomacro\MAMATRICEA[4,4]\MatP
+		%les conversions
+		\IfBooleanTF{#1}%
+			{%
+				\def\MatSQA{\ConvVersFrac*[#2]{\MatA*\MatA+\MatB*\MatE+\MatC*\MatI+\MatD*\MatM}}%
+				\def\MatSQB{\ConvVersFrac*[#2]{\MatA*\MatB+\MatB*\MatF+\MatC*\MatJ+\MatD*\MatN}}%
+				\def\MatSQC{\ConvVersFrac*[#2]{\MatA*\MatC+\MatB*\MatG+\MatC*\MatK+\MatD*\MatO}}%
+				\def\MatSQD{\ConvVersFrac*[#2]{\MatA*\MatD+\MatB*\MatH+\MatC*\MatL+\MatD*\MatP}}%
+				\def\MatSQE{\ConvVersFrac*[#2]{\MatA*\MatE+\MatE*\MatF+\MatG*\MatI+\MatH*\MatM}}%
+				\def\MatSQF{\ConvVersFrac*[#2]{\MatB*\MatE+\MatF*\MatF+\MatG*\MatJ+\MatH*\MatN}}%
+				\def\MatSQG{\ConvVersFrac*[#2]{\MatC*\MatE+\MatF*\MatG+\MatG*\MatK+\MatH*\MatO}}%
+				\def\MatSQH{\ConvVersFrac*[#2]{\MatD*\MatE+\MatF*\MatH+\MatG*\MatL+\MatH*\MatP}}%
+				\def\MatSQI{\ConvVersFrac*[#2]{\MatA*\MatI+\MatE*\MatJ+\MatI*\MatK+\MatL*\MatM}}%
+				\def\MatSQJ{\ConvVersFrac*[#2]{\MatB*\MatI+\MatF*\MatJ+\MatJ*\MatK+\MatL*\MatN}}%
+				\def\MatSQK{\ConvVersFrac*[#2]{\MatC*\MatI+\MatG*\MatJ+\MatK*\MatK+\MatL*\MatO}}%
+				\def\MatSQL{\ConvVersFrac*[#2]{\MatD*\MatI+\MatH*\MatJ+\MatK*\MatL+\MatL*\MatP}}%
+				\def\MatSQM{\ConvVersFrac*[#2]{\MatA*\MatM+\MatE*\MatN+\MatI*\MatO+\MatM*\MatP}}%
+				\def\MatSQN{\ConvVersFrac*[#2]{\MatB*\MatM+\MatF*\MatN+\MatJ*\MatO+\MatN*\MatP}}%
+				\def\MatSQO{\ConvVersFrac*[#2]{\MatC*\MatM+\MatG*\MatN+\MatK*\MatO+\MatO*\MatP}}%
+				\def\MatSQP{\ConvVersFrac*[#2]{\MatD*\MatM+\MatH*\MatN+\MatL*\MatO+\MatP*\MatP}}%
+			}%
+			{%
+				\def\MatSQA{\ConvVersFrac[#2]{\MatA*\MatA+\MatB*\MatE+\MatC*\MatI+\MatD*\MatM}}%
+				\def\MatSQB{\ConvVersFrac[#2]{\MatA*\MatB+\MatB*\MatF+\MatC*\MatJ+\MatD*\MatN}}%
+				\def\MatSQC{\ConvVersFrac[#2]{\MatA*\MatC+\MatB*\MatG+\MatC*\MatK+\MatD*\MatO}}%
+				\def\MatSQD{\ConvVersFrac[#2]{\MatA*\MatD+\MatB*\MatH+\MatC*\MatL+\MatD*\MatP}}%
+				\def\MatSQE{\ConvVersFrac[#2]{\MatA*\MatE+\MatE*\MatF+\MatG*\MatI+\MatH*\MatM}}%
+				\def\MatSQF{\ConvVersFrac[#2]{\MatB*\MatE+\MatF*\MatF+\MatG*\MatJ+\MatH*\MatN}}%
+				\def\MatSQG{\ConvVersFrac[#2]{\MatC*\MatE+\MatF*\MatG+\MatG*\MatK+\MatH*\MatO}}%
+				\def\MatSQH{\ConvVersFrac[#2]{\MatD*\MatE+\MatF*\MatH+\MatG*\MatL+\MatH*\MatP}}%
+				\def\MatSQI{\ConvVersFrac[#2]{\MatA*\MatI+\MatE*\MatJ+\MatI*\MatK+\MatL*\MatM}}%
+				\def\MatSQJ{\ConvVersFrac[#2]{\MatB*\MatI+\MatF*\MatJ+\MatJ*\MatK+\MatL*\MatN}}%
+				\def\MatSQK{\ConvVersFrac[#2]{\MatC*\MatI+\MatG*\MatJ+\MatK*\MatK+\MatL*\MatO}}%
+				\def\MatSQL{\ConvVersFrac[#2]{\MatD*\MatI+\MatH*\MatJ+\MatK*\MatL+\MatL*\MatP}}%
+				\def\MatSQM{\ConvVersFrac[#2]{\MatA*\MatM+\MatE*\MatN+\MatI*\MatO+\MatM*\MatP}}%
+				\def\MatSQN{\ConvVersFrac[#2]{\MatB*\MatM+\MatF*\MatN+\MatJ*\MatO+\MatN*\MatP}}%
+				\def\MatSQO{\ConvVersFrac[#2]{\MatC*\MatM+\MatG*\MatN+\MatK*\MatO+\MatO*\MatP}}%
+				\def\MatSQP{\ConvVersFrac[#2]{\MatD*\MatM+\MatH*\MatN+\MatL*\MatO+\MatP*\MatP}}%
+			}%
+		%l'affichage
+		\IfStrEq{#5}{Aff}%si matrice
+			{%
+				\IfBooleanTF{#1}%
+					{%
+						{\begin{pNiceMatrix}[#3]
+							\ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD} \\
+							\ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} & \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} \\
+							\ConvVersFrac*[#2]{\MatI} & \ConvVersFrac*[#2]{\MatJ} & \ConvVersFrac*[#2]{\MatK} & \ConvVersFrac*[#2]{\MatL} \\
+							\ConvVersFrac*[#2]{\MatM} & \ConvVersFrac*[#2]{\MatN} & \ConvVersFrac*[#2]{\MatO} & \ConvVersFrac*[#2]{\MatP} 
+						\end{pNiceMatrix}}^2=
+					}%
+					{%
+						{\begin{pNiceMatrix}[#3]
+							\ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD} \\
+							\ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} & \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} \\
+							\ConvVersFrac[#2]{\MatI} & \ConvVersFrac[#2]{\MatJ} & \ConvVersFrac[#2]{\MatK} & \ConvVersFrac[#2]{\MatL} \\
+							\ConvVersFrac[#2]{\MatM} & \ConvVersFrac[#2]{\MatN} & \ConvVersFrac[#2]{\MatO} & \ConvVersFrac[#2]{\MatP}
+						\end{pNiceMatrix}}^2=
+					}%
+			}{}%
+		\begin{pNiceMatrix}[#3]
+			{\MatSQA}&{\MatSQB}&{\MatSQC}&{\MatSQD}\\
+			{\MatSQE}&{\MatSQF}&{\MatSQG}&{\MatSQH}\\
+			{\MatSQI}&{\MatSQJ}&{\MatSQK}&{\MatSQL}\\
+			{\MatSQM}&{\MatSQN}&{\MatSQO}&{\MatSQP}
+		\end{pNiceMatrix}%
+	\fi
 	\ifnum \MAMATRICEAlen=3
 		\itemtomacro\MAMATRICEA[1,1]\MatA
 		\itemtomacro\MAMATRICEA[1,2]\MatB
@@ -418,89 +570,6 @@
 			{\MatSQC}&{\MatSQD}
 		\end{pNiceMatrix}%
 	\fi
-	\ifnum \MAMATRICEAlen=4
-		\itemtomacro\MAMATRICEA[1,1]\MatA
-		\itemtomacro\MAMATRICEA[1,2]\MatB
-		\itemtomacro\MAMATRICEA[1,3]\MatC
-		\itemtomacro\MAMATRICEA[1,4]\MatD
-		\itemtomacro\MAMATRICEA[2,1]\MatE
-		\itemtomacro\MAMATRICEA[2,2]\MatF
-		\itemtomacro\MAMATRICEA[2,3]\MatG
-		\itemtomacro\MAMATRICEA[2,4]\MatH
-		\itemtomacro\MAMATRICEA[3,1]\MatI
-		\itemtomacro\MAMATRICEA[3,2]\MatJ
-		\itemtomacro\MAMATRICEA[3,3]\MatK
-		\itemtomacro\MAMATRICEA[3,4]\MatL
-		\itemtomacro\MAMATRICEA[4,1]\MatM
-		\itemtomacro\MAMATRICEA[4,2]\MatN
-		\itemtomacro\MAMATRICEA[4,3]\MatO
-		\itemtomacro\MAMATRICEA[4,4]\MatP
-		%les conversions
-		\IfBooleanTF{#1}%
-			{%
-				\def\MatAffA{\ConvVersFrac*[#2]{\MatA}}%
-				\def\MatAffB{\ConvVersFrac*[#2]{\MatB}}%
-				\def\MatAffC{\ConvVersFrac*[#2]{\MatC}}%
-				\def\MatAffD{\ConvVersFrac*[#2]{\MatD}}%
-				\def\MatAffE{\ConvVersFrac*[#2]{\MatE}}%
-				\def\MatAffF{\ConvVersFrac*[#2]{\MatF}}%
-				\def\MatAffG{\ConvVersFrac*[#2]{\MatG}}%
-				\def\MatAffH{\ConvVersFrac*[#2]{\MatH}}%
-				\def\MatAffI{\ConvVersFrac*[#2]{\MatI}}%
-				\def\MatAffJ{\ConvVersFrac*[#2]{\MatJ}}%
-				\def\MatAffK{\ConvVersFrac*[#2]{\MatK}}%
-				\def\MatAffL{\ConvVersFrac*[#2]{\MatL}}%
-				\def\MatAffM{\ConvVersFrac*[#2]{\MatM}}%
-				\def\MatAffN{\ConvVersFrac*[#2]{\MatN}}%
-				\def\MatAffO{\ConvVersFrac*[#2]{\MatO}}%
-				\def\MatAffP{\ConvVersFrac*[#2]{\MatP}}%
-			}%
-			{%
-				\def\MatAffA{\ConvVersFrac[#2]{\MatA}}%
-				\def\MatAffB{\ConvVersFrac[#2]{\MatB}}%
-				\def\MatAffC{\ConvVersFrac[#2]{\MatC}}%
-				\def\MatAffD{\ConvVersFrac[#2]{\MatD}}%
-				\def\MatAffE{\ConvVersFrac[#2]{\MatE}}%
-				\def\MatAffF{\ConvVersFrac[#2]{\MatF}}%
-				\def\MatAffG{\ConvVersFrac[#2]{\MatG}}%
-				\def\MatAffH{\ConvVersFrac[#2]{\MatH}}%
-				\def\MatAffI{\ConvVersFrac[#2]{\MatI}}%
-				\def\MatAffJ{\ConvVersFrac[#2]{\MatJ}}%
-				\def\MatAffK{\ConvVersFrac[#2]{\MatK}}%
-				\def\MatAffL{\ConvVersFrac[#2]{\MatL}}%
-				\def\MatAffM{\ConvVersFrac[#2]{\MatM}}%
-				\def\MatAffN{\ConvVersFrac[#2]{\MatN}}%
-				\def\MatAffO{\ConvVersFrac[#2]{\MatO}}%
-				\def\MatAffP{\ConvVersFrac[#2]{\MatP}}%
-			}%
-		%l'affichage
-		\IfStrEq{#5}{Aff}%si matrice
-			{%
-				\IfBooleanTF{#1}%
-					{%
-						{\begin{pNiceMatrix}[#3]
-							\ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD} \\
-							\ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} & \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} \\
-							\ConvVersFrac*[#2]{\MatI} & \ConvVersFrac*[#2]{\MatJ} & \ConvVersFrac*[#2]{\MatK} & \ConvVersFrac*[#2]{\MatL} \\
-							\ConvVersFrac*[#2]{\MatM} & \ConvVersFrac*[#2]{\MatN} & \ConvVersFrac*[#2]{\MatO} & \ConvVersFrac*[#2]{\MatP}
-						\end{pNiceMatrix}}^2=
-					}%
-					{%
-						{\begin{pNiceMatrix}[#3]
-							\ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD} \\
-							\ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} & \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} \\
-							\ConvVersFrac[#2]{\MatI} & \ConvVersFrac[#2]{\MatJ} & \ConvVersFrac[#2]{\MatK} & \ConvVersFrac[#2]{\MatL} \\
-							\ConvVersFrac[#2]{\MatM} & \ConvVersFrac[#2]{\MatN} & \ConvVersFrac[#2]{\MatO} & \ConvVersFrac[#2]{\MatP}
-						\end{pNiceMatrix}}^2=
-					}%
-			}{}%
-		\begin{pNiceMatrix}[#3]
-			{\MatAffA} & {\MatAffB} & {\MatAffC} & {\MatAffD} \\
-			{\MatAffE} & {\MatAffF} & {\MatAffG} & {\MatAffH} \\
-			{\MatAffI} & {\MatAffJ} & {\MatAffK} & {\MatAffL} \\
-			{\MatAffM} & {\MatAffN} & {\MatAffO} & {\MatAffP} \\
-			\end{pNiceMatrix}%
-	\fi
 }
 
 %------Commande classique, 2x2 ou 3x3
@@ -508,7 +577,7 @@
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
 	%3=options nicematrix
-	%4=matrice (,,;,,)
+	%4=matrice(,,§,,)
 	%5=Affichage énoncé avec [Aff]
 	%---------------------
 	%lectures des matrices
@@ -631,12 +700,32 @@
 \NewDocumentCommand\DetMatrice{ s O{} r() }{%
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
-	%3=matrice (,,;,,)
+	%3=matrice (,,§,,)
 	%---------------------
 	%lectures des matrices
 	\setsepchar{§/,}%
 	\readlist*\MAMATRICEA{#3}%
 	%les coeffs de A et le déterminant et les coeff de l'inverse
+	\ifnum \MAMATRICEAlen=4
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[1,4]\MatD
+		\itemtomacro\MAMATRICEA[2,1]\MatE
+		\itemtomacro\MAMATRICEA[2,2]\MatF
+		\itemtomacro\MAMATRICEA[2,3]\MatG
+		\itemtomacro\MAMATRICEA[2,4]\MatH
+		\itemtomacro\MAMATRICEA[3,1]\MatI
+		\itemtomacro\MAMATRICEA[3,2]\MatJ
+		\itemtomacro\MAMATRICEA[3,3]\MatK
+		\itemtomacro\MAMATRICEA[3,4]\MatL
+		\itemtomacro\MAMATRICEA[4,1]\MatM
+		\itemtomacro\MAMATRICEA[4,2]\MatN
+		\itemtomacro\MAMATRICEA[4,3]\MatO
+		\itemtomacro\MAMATRICEA[4,4]\MatP
+		%le déterminant
+		\def\DETMATRICE{\xinteval{\MatA*\MatF*\MatK*\MatP-\MatA*\MatF*\MatL*\MatO-\MatA*\MatG*\MatJ*\MatP+\MatA*\MatG*\MatL*\MatN+\MatA*\MatH*\MatJ*\MatO-\MatA*\MatH*\MatK*\MatN-\MatB*\MatE*\MatK*\MatP+\MatB*\MatE*\MatL*\MatO+\MatB*\MatG*\MatI*\MatP-\MatB*\MatG*\MatL*\MatM-\MatB*\MatH*\MatI*\MatO+\MatB*\MatH*\MatK*\MatM+\MatC*\MatE*\MatJ*\MatP-\MatC*\MatE*\MatL*\MatN-\MatC*\MatF*\MatI*\MatP+\MatC*\MatF*\MatL*\MatM+\MatC*\MatH*\MatI*\MatN-\MatC*\MatH*\MatJ*\MatM-\MatD*\MatE*\MatJ*\MatO+\MatD*\MatE*\MatK*\MatN+\MatD*\MatF*\MatI*\MatO-\MatD*\MatF*\MatK*\MatM-\MatD*\MatG*\MatI*\MatN+\MatD*\MatG*\MatJ*\MatM}}%
+	\fi
 	\ifnum \MAMATRICEAlen=3
 		\itemtomacro\MAMATRICEA[1,1]\MatA
 		\itemtomacro\MAMATRICEA[1,2]\MatB
@@ -778,6 +867,28 @@
 	\fi
 }
 
+\NewDocumentCommand\EtatStable{ O{} D<>{} r() }{%
+	%1=options conversion
+	%2=options nicematrix
+	%3=matrice (,,;,,)
+	%---------------------
+	%lectures des matrices
+	\setsepchar{§/,}%
+	\readlist*\MAMATRICEA{#3}%
+	%les coeffs de A et la résolution du système
+	\ifnum \MAMATRICEAlen=2
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[2,1]\MatC
+		\itemtomacro\MAMATRICEA[2,2]\MatD
+		\def\MatEtStabA{\ConvVersFrac[#1]{\MatC/(\MatB+\MatC)}}
+		\def\MatEtStabB{\ConvVersFrac[#1]{\MatB/(\MatB+\MatC)}}
+		\begin{pNiceMatrix}[#2]
+			{\MatEtStabA} & {\MatEtStabB}
+		\end{pNiceMatrix}%
+	\fi
+}
+
 \NewDocumentCommand\ProduitMatrices{ s O{} D<>{} r() r() O{} }{%
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
@@ -1172,6 +1283,309 @@
 						\MatResA & \MatResB & \MatResC \\ \MatResD & \MatResE & \MatResF \\ \MatResG & \MatResH & \MatResI
 					\end{pNiceMatrix}%
 				}{}%fin 3,3*3,3
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==1}% (1,4)*(4,1)
+			{%
+				\itemtomacro\MatA[1,1]\CoeffAa
+				\itemtomacro\MatA[1,2]\CoeffAb
+				\itemtomacro\MatA[1,3]\CoeffAc
+				\itemtomacro\MatA[1,4]\CoeffAd
+				\itemtomacro\MatB[1]\CoeffBa
+				\itemtomacro\MatB[2]\CoeffBb
+				\itemtomacro\MatB[3]\CoeffBc
+				\itemtomacro\MatB[4]\CoeffBd
+				\IfBooleanTF{#1}%version étoilée := moins sur num
+					{%
+						\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+					}%
+					{%
+						\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+					}%
+				\IfStrEq{#6}{Aff}%si matrice
+					{%
+						\IfBooleanTF{#1}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffBa} \\
+									\ConvVersFrac*[#2]{\CoeffBb} \\
+									\ConvVersFrac*[#2]{\CoeffBc} \\
+									\ConvVersFrac*[#2]{\CoeffBd}
+								\end{pNiceMatrix}
+								=
+							}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffBa} \\
+									\ConvVersFrac[#2]{\CoeffBb} \\
+									\ConvVersFrac[#2]{\CoeffBc} \\
+									\ConvVersFrac[#2]{\CoeffBd}
+								\end{pNiceMatrix}
+								=
+							}%
+					}{}%
+				\begin{pNiceMatrix}[#3]
+					{\MatResA}
+				\end{pNiceMatrix}%
+			}{}%fin 1,4*4,1
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==4}% (1,4)*(4,4)
+			{%
+				\itemtomacro\MatA[1,1]\CoeffAa
+				\itemtomacro\MatA[1,2]\CoeffAb
+				\itemtomacro\MatA[1,3]\CoeffAc
+				\itemtomacro\MatA[1,4]\CoeffAd
+				\itemtomacro\MatB[1,1]\CoeffBa
+				\itemtomacro\MatB[1,2]\CoeffBb
+				\itemtomacro\MatB[1,3]\CoeffBc
+				\itemtomacro\MatB[1,4]\CoeffBd
+				\itemtomacro\MatB[2,1]\CoeffBe
+				\itemtomacro\MatB[2,2]\CoeffBf
+				\itemtomacro\MatB[2,3]\CoeffBg
+				\itemtomacro\MatB[2,4]\CoeffBh
+				\itemtomacro\MatB[3,1]\CoeffBi
+				\itemtomacro\MatB[3,2]\CoeffBj
+				\itemtomacro\MatB[3,3]\CoeffBk
+				\itemtomacro\MatB[3,4]\CoeffBl
+				\itemtomacro\MatB[4,1]\CoeffBm
+				\itemtomacro\MatB[4,2]\CoeffBn
+				\itemtomacro\MatB[4,3]\CoeffBo
+				\itemtomacro\MatB[4,4]\CoeffBp
+				\IfBooleanTF{#1}%version étoilée := moins sur num
+					{%
+						\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+						\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+						\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+						\def\MatResD{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+					}%
+					{%
+						\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+						\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+						\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+						\def\MatResD{\ConvVersFrac[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+					}%
+				\IfStrEq{#6}{Aff}%si matrice
+					{%
+						\IfBooleanTF{#1}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \\
+									\ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} & \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} \\
+									\ConvVersFrac*[#2]{\CoeffBi} & \ConvVersFrac*[#2]{\CoeffBj} & \ConvVersFrac*[#2]{\CoeffBk} & \ConvVersFrac*[#2]{\CoeffBl} \\
+									\ConvVersFrac*[#2]{\CoeffBm} & \ConvVersFrac*[#2]{\CoeffBn} & \ConvVersFrac*[#2]{\CoeffBo} & \ConvVersFrac*[#2]{\CoeffBp}
+								\end{pNiceMatrix}
+								=
+							}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \\
+									\ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} & \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} \\
+									\ConvVersFrac[#2]{\CoeffBi} & \ConvVersFrac[#2]{\CoeffBj} & \ConvVersFrac[#2]{\CoeffBk} & \ConvVersFrac[#2]{\CoeffBl} \\
+									\ConvVersFrac[#2]{\CoeffBm} & \ConvVersFrac[#2]{\CoeffBn} & \ConvVersFrac[#2]{\CoeffBo} & \ConvVersFrac[#2]{\CoeffBp}
+								\end{pNiceMatrix}
+								=
+							}%
+					}{}%
+				\begin{pNiceMatrix}[#3]
+					{\MatResA} & {\MatResB} & {\MatResC} & {\MatResD}
+				\end{pNiceMatrix}%
+			}{}%fin 1,4*4,4
+			\xintifboolexpr{\NbLigMatA==4 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==1}% (4,4)*(4,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[1,4]\CoeffAd
+					\itemtomacro\MatA[2,1]\CoeffAe
+					\itemtomacro\MatA[2,2]\CoeffAf
+					\itemtomacro\MatA[2,3]\CoeffAg
+					\itemtomacro\MatA[2,4]\CoeffAh
+					\itemtomacro\MatA[3,1]\CoeffAi
+					\itemtomacro\MatA[3,2]\CoeffAj
+					\itemtomacro\MatA[3,3]\CoeffAk
+					\itemtomacro\MatA[3,4]\CoeffAl
+					\itemtomacro\MatA[4,1]\CoeffAm
+					\itemtomacro\MatA[4,2]\CoeffAn
+					\itemtomacro\MatA[4,3]\CoeffAo
+					\itemtomacro\MatA[4,4]\CoeffAp
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\itemtomacro\MatB[3]\CoeffBc
+					\itemtomacro\MatB[4]\CoeffBd
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBb+\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBb+\CoeffAk*\CoeffBc+\CoeffAl*\CoeffBd}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBb+\CoeffAo*\CoeffBc+\CoeffAp*\CoeffBd}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBb+\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBb+\CoeffAk*\CoeffBc+\CoeffAl*\CoeffBd}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBb+\CoeffAo*\CoeffBc+\CoeffAp*\CoeffBd}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \\
+										\ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} & \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} \\
+										\ConvVersFrac*[#2]{\CoeffAi} & \ConvVersFrac*[#2]{\CoeffAj} & \ConvVersFrac*[#2]{\CoeffAk} & \ConvVersFrac*[#2]{\CoeffAl} \\
+										\ConvVersFrac*[#2]{\CoeffAm} & \ConvVersFrac*[#2]{\CoeffAn} & \ConvVersFrac*[#2]{\CoeffAo} & \ConvVersFrac*[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} \\ \ConvVersFrac*[#2]{\CoeffBd}
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \\
+										\ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} & \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} \\
+										\ConvVersFrac[#2]{\CoeffAi} & \ConvVersFrac[#2]{\CoeffAj} & \ConvVersFrac[#2]{\CoeffAk} & \ConvVersFrac[#2]{\CoeffAl} \\
+										\ConvVersFrac[#2]{\CoeffAm} & \ConvVersFrac[#2]{\CoeffAn} & \ConvVersFrac[#2]{\CoeffAo} & \ConvVersFrac[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \\ \ConvVersFrac[#2]{\CoeffBd}
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						{\MatResA} \\ {\MatResB} \\ {\MatResC} \\ {\MatResD}
+					\end{pNiceMatrix}%
+				}{}%fin 4x4,4,1
+			\xintifboolexpr{\NbLigMatA==4 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==4}% (4,4)*(4,4)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[1,4]\CoeffAd
+					\itemtomacro\MatA[2,1]\CoeffAe
+					\itemtomacro\MatA[2,2]\CoeffAf
+					\itemtomacro\MatA[2,3]\CoeffAg
+					\itemtomacro\MatA[2,4]\CoeffAh
+					\itemtomacro\MatA[3,1]\CoeffAi
+					\itemtomacro\MatA[3,2]\CoeffAj
+					\itemtomacro\MatA[3,3]\CoeffAk
+					\itemtomacro\MatA[3,4]\CoeffAl
+					\itemtomacro\MatA[4,1]\CoeffAm
+					\itemtomacro\MatA[4,2]\CoeffAn
+					\itemtomacro\MatA[4,3]\CoeffAo
+					\itemtomacro\MatA[4,4]\CoeffAp
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[1,3]\CoeffBc
+					\itemtomacro\MatB[1,4]\CoeffBd
+					\itemtomacro\MatB[2,1]\CoeffBe
+					\itemtomacro\MatB[2,2]\CoeffBf
+					\itemtomacro\MatB[2,3]\CoeffBg
+					\itemtomacro\MatB[2,4]\CoeffBh
+					\itemtomacro\MatB[3,1]\CoeffBi
+					\itemtomacro\MatB[3,2]\CoeffBj
+					\itemtomacro\MatB[3,3]\CoeffBk
+					\itemtomacro\MatB[3,4]\CoeffBl
+					\itemtomacro\MatB[4,1]\CoeffBm
+					\itemtomacro\MatB[4,2]\CoeffBn
+					\itemtomacro\MatB[4,3]\CoeffBo
+					\itemtomacro\MatB[4,4]\CoeffBp
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+							\def\MatResE{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBe+\CoeffAg*\CoeffBi+\CoeffAh*\CoeffBm}}%
+							\def\MatResF{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBf+\CoeffAg*\CoeffBj+\CoeffAh*\CoeffBn}}%
+							\def\MatResG{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBc+\CoeffAf*\CoeffBg+\CoeffAg*\CoeffBk+\CoeffAh*\CoeffBo}}%
+							\def\MatResH{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBh+\CoeffAg*\CoeffBl+\CoeffAh*\CoeffBp}}%
+							\def\MatResI{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBe+\CoeffAk*\CoeffBi+\CoeffAl*\CoeffBm}}%
+							\def\MatResJ{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBb+\CoeffAj*\CoeffBf+\CoeffAk*\CoeffBj+\CoeffAl*\CoeffBn}}%
+							\def\MatResK{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBc+\CoeffAj*\CoeffBg+\CoeffAk*\CoeffBk+\CoeffAl*\CoeffBo}}%
+							\def\MatResL{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBd+\CoeffAj*\CoeffBh+\CoeffAk*\CoeffBl+\CoeffAl*\CoeffBp}}%
+							\def\MatResM{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBe+\CoeffAo*\CoeffBi+\CoeffAp*\CoeffBm}}%
+							\def\MatResN{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBb+\CoeffAn*\CoeffBf+\CoeffAo*\CoeffBj+\CoeffAp*\CoeffBn}}%
+							\def\MatResO{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBc+\CoeffAn*\CoeffBg+\CoeffAo*\CoeffBk+\CoeffAp*\CoeffBo}}%
+							\def\MatResP{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBd+\CoeffAn*\CoeffBh+\CoeffAo*\CoeffBl+\CoeffAp*\CoeffBp}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+							\def\MatResE{\ConvVersFrac[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBe+\CoeffAg*\CoeffBi+\CoeffAh*\CoeffBm}}%
+							\def\MatResF{\ConvVersFrac[#2]{\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBf+\CoeffAg*\CoeffBj+\CoeffAh*\CoeffBn}}%
+							\def\MatResG{\ConvVersFrac[#2]{\CoeffAe*\CoeffBc+\CoeffAf*\CoeffBg+\CoeffAg*\CoeffBk+\CoeffAh*\CoeffBo}}%
+							\def\MatResH{\ConvVersFrac[#2]{\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBh+\CoeffAg*\CoeffBl+\CoeffAh*\CoeffBp}}%
+							\def\MatResI{\ConvVersFrac[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBe+\CoeffAk*\CoeffBi+\CoeffAl*\CoeffBm}}%
+							\def\MatResJ{\ConvVersFrac[#2]{\CoeffAi*\CoeffBb+\CoeffAj*\CoeffBf+\CoeffAk*\CoeffBj+\CoeffAl*\CoeffBn}}%
+							\def\MatResK{\ConvVersFrac[#2]{\CoeffAi*\CoeffBc+\CoeffAj*\CoeffBg+\CoeffAk*\CoeffBk+\CoeffAl*\CoeffBo}}%
+							\def\MatResL{\ConvVersFrac[#2]{\CoeffAi*\CoeffBd+\CoeffAj*\CoeffBh+\CoeffAk*\CoeffBl+\CoeffAl*\CoeffBp}}%
+							\def\MatResM{\ConvVersFrac[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBe+\CoeffAo*\CoeffBi+\CoeffAp*\CoeffBm}}%
+							\def\MatResN{\ConvVersFrac[#2]{\CoeffAm*\CoeffBb+\CoeffAn*\CoeffBf+\CoeffAo*\CoeffBj+\CoeffAp*\CoeffBn}}%
+							\def\MatResO{\ConvVersFrac[#2]{\CoeffAm*\CoeffBc+\CoeffAn*\CoeffBg+\CoeffAo*\CoeffBk+\CoeffAp*\CoeffBo}}%
+							\def\MatResP{\ConvVersFrac[#2]{\CoeffAm*\CoeffBd+\CoeffAn*\CoeffBh+\CoeffAo*\CoeffBl+\CoeffAp*\CoeffBp}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \\
+										\ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} & \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} \\
+										\ConvVersFrac*[#2]{\CoeffAi} & \ConvVersFrac*[#2]{\CoeffAj} & \ConvVersFrac*[#2]{\CoeffAk} & \ConvVersFrac*[#2]{\CoeffAl} \\
+										\ConvVersFrac*[#2]{\CoeffAm} & \ConvVersFrac*[#2]{\CoeffAn} & \ConvVersFrac*[#2]{\CoeffAo} & \ConvVersFrac*[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \\
+										\ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} & \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} \\
+										\ConvVersFrac*[#2]{\CoeffBi} & \ConvVersFrac*[#2]{\CoeffBj} & \ConvVersFrac*[#2]{\CoeffBk} & \ConvVersFrac*[#2]{\CoeffBl} \\
+										\ConvVersFrac*[#2]{\CoeffBm} & \ConvVersFrac*[#2]{\CoeffBn} & \ConvVersFrac*[#2]{\CoeffBo} & \ConvVersFrac*[#2]{\CoeffBp}
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \\
+										\ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} & \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} \\
+										\ConvVersFrac[#2]{\CoeffAi} & \ConvVersFrac[#2]{\CoeffAj} & \ConvVersFrac[#2]{\CoeffAk} & \ConvVersFrac[#2]{\CoeffAl} \\
+										\ConvVersFrac[#2]{\CoeffAm} & \ConvVersFrac[#2]{\CoeffAn} & \ConvVersFrac[#2]{\CoeffAo} & \ConvVersFrac[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \\
+										\ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} & \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} \\
+										\ConvVersFrac[#2]{\CoeffBi} & \ConvVersFrac[#2]{\CoeffBj} & \ConvVersFrac[#2]{\CoeffBk} & \ConvVersFrac[#2]{\CoeffBl} \\
+										\ConvVersFrac[#2]{\CoeffBm} & \ConvVersFrac[#2]{\CoeffBn} & \ConvVersFrac[#2]{\CoeffBo} & \ConvVersFrac[#2]{\CoeffBp}
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						{\MatResA} & {\MatResB} & {\MatResC} & {\MatResD} \\
+						{\MatResE} & {\MatResF} & {\MatResG} & {\MatResH} \\
+						{\MatResI} & {\MatResJ} & {\MatResK} & {\MatResL} \\
+						{\MatResM} & {\MatResN} & {\MatResO} & {\MatResP}
+					\end{pNiceMatrix}%
+				}{}%fin 4x4,4,4
 		}%
 }
 
@@ -1538,6 +1952,95 @@
 	\fi
 }
 
+\NewDocumentCommand\EtatStablePY{ s O{} D<>{} r() }{%
+	%*=fractions avec - sur le numérateur
+	%2=options conversion
+	%3=options nicematrix
+	%4=matrice (,,;,,)
+	%---------------------
+	%lectures des matrices
+	\setsepchar{§/,}%
+	\readlist*\MAMATRICEA{#4}%
+	%les coeffs de A et la résolution du système
+	\ifnum \MAMATRICEAlen=2
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[2,1]\MatC
+		\itemtomacro\MAMATRICEA[2,2]\MatD
+		\IfBooleanTF{#1}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac*[#2]{\MatC/(\MatB+\MatC)}}
+			\def\MatEtStabB{\ConvVersFrac*[#2]{\MatB/(\MatB+\MatC)}}
+		}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac[#2]{\MatC/(\MatB+\MatC)}}
+			\def\MatEtStabB{\ConvVersFrac[#2]{\MatB/(\MatB+\MatC)}}
+		}%
+		\begin{pNiceMatrix}[#3]
+			{\MatEtStabA} & {\MatEtStabB}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=3
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[2,1]\MatD
+		\itemtomacro\MAMATRICEA[2,2]\MatE
+		\itemtomacro\MAMATRICEA[2,3]\MatF
+		\itemtomacro\MAMATRICEA[3,1]\MatG
+		\itemtomacro\MAMATRICEA[3,2]\MatH
+		\itemtomacro\MAMATRICEA[3,3]\MatI
+		\IfBooleanTF{#1}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac*[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[x]}}}
+			\def\MatEtStabB{\ConvVersFrac*[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[y]}}}
+			\def\MatEtStabC{\ConvVersFrac*[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[z]}}}
+		}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[x]}}}
+			\def\MatEtStabB{\ConvVersFrac[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[y]}}}
+			\def\MatEtStabC{\ConvVersFrac[#2]{\py{resol_etat_stable_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[z]}}}
+		}%
+		\begin{pNiceMatrix}[#3]
+			{\MatEtStabA} & {\MatEtStabB} & {\MatEtStabC}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=4
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[1,4]\MatD
+		\itemtomacro\MAMATRICEA[2,1]\MatE
+		\itemtomacro\MAMATRICEA[2,2]\MatF
+		\itemtomacro\MAMATRICEA[2,3]\MatG
+		\itemtomacro\MAMATRICEA[2,4]\MatH
+		\itemtomacro\MAMATRICEA[3,1]\MatI
+		\itemtomacro\MAMATRICEA[3,2]\MatJ
+		\itemtomacro\MAMATRICEA[3,3]\MatK
+		\itemtomacro\MAMATRICEA[3,4]\MatL
+		\itemtomacro\MAMATRICEA[4,1]\MatM
+		\itemtomacro\MAMATRICEA[4,2]\MatN
+		\itemtomacro\MAMATRICEA[4,3]\MatO
+		\itemtomacro\MAMATRICEA[4,4]\MatP
+		\IfBooleanTF{#1}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac*[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[x]}}}
+			\def\MatEtStabB{\ConvVersFrac*[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[y]}}}
+			\def\MatEtStabC{\ConvVersFrac*[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[z]}}}
+			\def\MatEtStabD{\ConvVersFrac*[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[t]}}}
+		}%
+		{%
+			\def\MatEtStabA{\ConvVersFrac[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[x]}}}
+			\def\MatEtStabB{\ConvVersFrac[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[y]}}}
+			\def\MatEtStabC{\ConvVersFrac[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[z]}}}
+			\def\MatEtStabD{\ConvVersFrac[#2]{\py{resol_etat_stable_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[t]}}}
+		}%
+		\begin{pNiceMatrix}[#3]
+			{\MatEtStabA} & {\MatEtStabB} & {\MatEtStabC} & {\MatEtStabD}
+		\end{pNiceMatrix}%
+	\fi
+}
+
 \NewDocumentCommand\MatricePuissancePY{ s O{} D<>{} r() r() O{} }{%
 	%*=fractions avec - sur le numérateur
 	%2=options conversion
@@ -1795,6 +2298,790 @@
 			\ConvVersFrac[#2]{\DETMATRICE}%
 		}%
 }
+
+\NewDocumentCommand\ProduitMatricesPY{ s O{} D<>{} r() r() O{} }{%
+	%*=fractions avec - sur le numérateur
+	%2=options conversion
+	%3=options nicematrix globales ?
+	%4=matrice (,,§,,) A
+	%5=matrice (,,§,,) B
+	%---------------------
+	%lectures des matrices et dimensions
+	\setsepchar{§/,}%
+	\readlist*\MatA{#4}%
+	\readlist*\MatB{#5}%
+	\def\NbLigMatA{\MatAlen}%
+	\def\NbLigMatB{\MatBlen}%
+	\itemtomacro\MatA[1]{\MatAligne}%
+	\itemtomacro\MatB[1]{\MatBligne}%
+	\setsepchar{,}%
+	\readlist*\TmpA{\MatAligne}%
+	\readlist*\TmpB{\MatBligne}%
+	\def\NbColMatA{\TmpAlen}%
+	\def\NbColMatB{\TmpBlen}%
+	%test de dimensions !!
+	\xintifboolexpr{\NbColMatA != \NbLigMatB}
+		{\text{Erreur de dimensions}}%
+		{
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==1}% (1,2)*(2,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatRes{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+						}%
+						{%
+							\def\MatRes{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatRes
+					\end{pNiceMatrix}%
+				}{}%fin 1,2*2,1
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==2}% (1,2)*(2,2)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[2,1]\CoeffBc
+					\itemtomacro\MatB[2,2]\CoeffBd
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBd}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBd}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA & \MatResB
+					\end{pNiceMatrix}%
+				}{}%fin 1,2*2,1
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==1}% (1,3)*(3,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\itemtomacro\MatB[3]\CoeffBc
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatRes{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+						}%
+						{%
+							\def\MatRes{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatRes
+					\end{pNiceMatrix}%
+				}{}%fin 1,3*3,1
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==3}% (1,3)*(3,3)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[1,3]\CoeffBc
+					\itemtomacro\MatB[2,1]\CoeffBd
+					\itemtomacro\MatB[2,2]\CoeffBe
+					\itemtomacro\MatB[2,3]\CoeffBf
+					\itemtomacro\MatB[3,1]\CoeffBg
+					\itemtomacro\MatB[3,2]\CoeffBh
+					\itemtomacro\MatB[3,3]\CoeffBi
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \\
+										\ConvVersFrac*[#2]{\CoeffBd} & \ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} \\
+										\ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} & \ConvVersFrac*[#2]{\CoeffBi} 
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} \\
+										\ConvVersFrac[#2]{\CoeffBd} & \ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} \\
+										\ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} & \ConvVersFrac[#2]{\CoeffBi} 
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA & \MatResB & \MatResC
+					\end{pNiceMatrix}%
+				}{}%fin 1,3*3,3
+			\xintifboolexpr{\NbLigMatA==2 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==1}% (2,2)*(2,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[2,1]\CoeffAc
+					\itemtomacro\MatA[2,2]\CoeffAd
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBb}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBb}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \\ \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \\ \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA \\ \MatResB
+					\end{pNiceMatrix}%
+				}{}%fin 2,2*2,1
+			\xintifboolexpr{\NbLigMatA==2 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==2}% (2,2)*(2,2)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[2,1]\CoeffAc
+					\itemtomacro\MatA[2,2]\CoeffAd
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[2,1]\CoeffBc
+					\itemtomacro\MatB[2,2]\CoeffBd
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAd*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBc}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBb+\CoeffAd*\CoeffBd}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAd*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBc}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAc*\CoeffBb+\CoeffAd*\CoeffBd}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \\ \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \\ \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA & \MatResB \\ \MatResC & \MatResD
+					\end{pNiceMatrix}%
+				}{}%fin 2,2*2,1
+			\xintifboolexpr{\NbLigMatA==3 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==1}% (3,3)*(3,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[2,1]\CoeffAd
+					\itemtomacro\MatA[2,2]\CoeffAe
+					\itemtomacro\MatA[2,3]\CoeffAf
+					\itemtomacro\MatA[3,1]\CoeffAg
+					\itemtomacro\MatA[3,2]\CoeffAh
+					\itemtomacro\MatA[3,3]\CoeffAi
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\itemtomacro\MatB[3]\CoeffBc
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBc}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBb+\CoeffAi*\CoeffBc}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBc}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBb+\CoeffAi*\CoeffBc}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \\
+										\ConvVersFrac*[#2]{\CoeffAd} & \ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} \\
+										\ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} & \ConvVersFrac*[#2]{\CoeffAi}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} \end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \\
+										\ConvVersFrac[#2]{\CoeffAd} & \ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} \\
+										\ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} & \ConvVersFrac[#2]{\CoeffAi}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA \\ \MatResB \\ \MatResC
+					\end{pNiceMatrix}%
+				}{}%fin 3,3*3,1
+			\xintifboolexpr{\NbLigMatA==3 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==3}% (3,3)*(3,3)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[2,1]\CoeffAd
+					\itemtomacro\MatA[2,2]\CoeffAe
+					\itemtomacro\MatA[2,3]\CoeffAf
+					\itemtomacro\MatA[3,1]\CoeffAg
+					\itemtomacro\MatA[3,2]\CoeffAh
+					\itemtomacro\MatA[3,3]\CoeffAi
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[1,3]\CoeffBc
+					\itemtomacro\MatB[2,1]\CoeffBd
+					\itemtomacro\MatB[2,2]\CoeffBe
+					\itemtomacro\MatB[1,3]\CoeffBf
+					\itemtomacro\MatB[3,1]\CoeffBg
+					\itemtomacro\MatB[3,2]\CoeffBh
+					\itemtomacro\MatB[3,3]\CoeffBi
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBg}}%
+							\def\MatResE{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBb+\CoeffAe*\CoeffBe+\CoeffAf*\CoeffBh}}%
+							\def\MatResF{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBc+\CoeffAe*\CoeffBf+\CoeffAf*\CoeffBi}}%
+							\def\MatResG{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBd+\CoeffAi*\CoeffBg}}%
+							\def\MatResH{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBb+\CoeffAh*\CoeffBe+\CoeffAi*\CoeffBh}}%
+							\def\MatResI{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBf+\CoeffAi*\CoeffBi}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBg}}%
+							\def\MatResE{\ConvVersFrac[#2]{\CoeffAd*\CoeffBb+\CoeffAe*\CoeffBe+\CoeffAf*\CoeffBh}}%
+							\def\MatResF{\ConvVersFrac[#2]{\CoeffAd*\CoeffBc+\CoeffAe*\CoeffBf+\CoeffAf*\CoeffBi}}%
+							\def\MatResG{\ConvVersFrac[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBd+\CoeffAi*\CoeffBg}}%
+							\def\MatResH{\ConvVersFrac[#2]{\CoeffAg*\CoeffBb+\CoeffAh*\CoeffBe+\CoeffAi*\CoeffBh}}%
+							\def\MatResI{\ConvVersFrac[#2]{\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBf+\CoeffAi*\CoeffBi}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \\
+										\ConvVersFrac*[#2]{\CoeffAd} & \ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} \\
+										\ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} & \ConvVersFrac*[#2]{\CoeffAi}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \\
+										\ConvVersFrac*[#2]{\CoeffBd} & \ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} \\
+										\ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} & \ConvVersFrac*[#2]{\CoeffBi}
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \\
+										\ConvVersFrac[#2]{\CoeffAd} & \ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} \\
+										\ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} & \ConvVersFrac[#2]{\CoeffAi}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} \\
+										\ConvVersFrac[#2]{\CoeffBd} & \ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} \\
+										\ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} & \ConvVersFrac[#2]{\CoeffBi}
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						\MatResA & \MatResB & \MatResC \\ \MatResD & \MatResE & \MatResF \\ \MatResG & \MatResH & \MatResI
+					\end{pNiceMatrix}%
+				}{}%fin 3,3*3,3
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==1}% (1,4)*(4,1)
+			{%
+				\itemtomacro\MatA[1,1]\CoeffAa
+				\itemtomacro\MatA[1,2]\CoeffAb
+				\itemtomacro\MatA[1,3]\CoeffAc
+				\itemtomacro\MatA[1,4]\CoeffAd
+				\itemtomacro\MatB[1]\CoeffBa
+				\itemtomacro\MatB[2]\CoeffBb
+				\itemtomacro\MatB[3]\CoeffBc
+				\itemtomacro\MatB[4]\CoeffBd
+				\IfBooleanTF{#1}%version étoilée := moins sur num
+					{%
+						\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+					}%
+					{%
+						\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+					}%
+				\IfStrEq{#6}{Aff}%si matrice
+					{%
+						\IfBooleanTF{#1}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffBa} \\
+									\ConvVersFrac*[#2]{\CoeffBb} \\
+									\ConvVersFrac*[#2]{\CoeffBc} \\
+									\ConvVersFrac*[#2]{\CoeffBd}
+								\end{pNiceMatrix}
+								=
+							}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffBa} \\
+									\ConvVersFrac[#2]{\CoeffBb} \\
+									\ConvVersFrac[#2]{\CoeffBc} \\
+									\ConvVersFrac[#2]{\CoeffBd}
+								\end{pNiceMatrix}
+								=
+							}%
+					}{}%
+				\begin{pNiceMatrix}[#3]
+					{\MatResA}
+				\end{pNiceMatrix}%
+			}{}%fin 1,4*4,1
+			\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==4}% (1,4)*(4,4)
+			{%
+				\itemtomacro\MatA[1,1]\CoeffAa
+				\itemtomacro\MatA[1,2]\CoeffAb
+				\itemtomacro\MatA[1,3]\CoeffAc
+				\itemtomacro\MatA[1,4]\CoeffAd
+				\itemtomacro\MatB[1,1]\CoeffBa
+				\itemtomacro\MatB[1,2]\CoeffBb
+				\itemtomacro\MatB[1,3]\CoeffBc
+				\itemtomacro\MatB[1,4]\CoeffBd
+				\itemtomacro\MatB[2,1]\CoeffBe
+				\itemtomacro\MatB[2,2]\CoeffBf
+				\itemtomacro\MatB[2,3]\CoeffBg
+				\itemtomacro\MatB[2,4]\CoeffBh
+				\itemtomacro\MatB[3,1]\CoeffBi
+				\itemtomacro\MatB[3,2]\CoeffBj
+				\itemtomacro\MatB[3,3]\CoeffBk
+				\itemtomacro\MatB[3,4]\CoeffBl
+				\itemtomacro\MatB[4,1]\CoeffBm
+				\itemtomacro\MatB[4,2]\CoeffBn
+				\itemtomacro\MatB[4,3]\CoeffBo
+				\itemtomacro\MatB[4,4]\CoeffBp
+				\IfBooleanTF{#1}%version étoilée := moins sur num
+					{%
+						\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+						\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+						\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+						\def\MatResD{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+					}%
+					{%
+						\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+						\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+						\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+						\def\MatResD{\ConvVersFrac[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+					}%
+				\IfStrEq{#6}{Aff}%si matrice
+					{%
+						\IfBooleanTF{#1}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \\
+									\ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} & \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} \\
+									\ConvVersFrac*[#2]{\CoeffBi} & \ConvVersFrac*[#2]{\CoeffBj} & \ConvVersFrac*[#2]{\CoeffBk} & \ConvVersFrac*[#2]{\CoeffBl} \\
+									\ConvVersFrac*[#2]{\CoeffBm} & \ConvVersFrac*[#2]{\CoeffBn} & \ConvVersFrac*[#2]{\CoeffBo} & \ConvVersFrac*[#2]{\CoeffBp}
+								\end{pNiceMatrix}
+								=
+							}%
+							{%
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd}
+								\end{pNiceMatrix}
+								\times
+								\begin{pNiceMatrix}[#3]
+									\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \\
+									\ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} & \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} \\
+									\ConvVersFrac[#2]{\CoeffBi} & \ConvVersFrac[#2]{\CoeffBj} & \ConvVersFrac[#2]{\CoeffBk} & \ConvVersFrac[#2]{\CoeffBl} \\
+									\ConvVersFrac[#2]{\CoeffBm} & \ConvVersFrac[#2]{\CoeffBn} & \ConvVersFrac[#2]{\CoeffBo} & \ConvVersFrac[#2]{\CoeffBp}
+								\end{pNiceMatrix}
+								=
+							}%
+					}{}%
+				\begin{pNiceMatrix}[#3]
+					{\MatResA} & {\MatResB} & {\MatResC} & {\MatResD}
+				\end{pNiceMatrix}%
+			}{}%fin 1,4*4,4
+			\xintifboolexpr{\NbLigMatA==4 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==1}% (4,4)*(4,1)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[1,4]\CoeffAd
+					\itemtomacro\MatA[2,1]\CoeffAe
+					\itemtomacro\MatA[2,2]\CoeffAf
+					\itemtomacro\MatA[2,3]\CoeffAg
+					\itemtomacro\MatA[2,4]\CoeffAh
+					\itemtomacro\MatA[3,1]\CoeffAi
+					\itemtomacro\MatA[3,2]\CoeffAj
+					\itemtomacro\MatA[3,3]\CoeffAk
+					\itemtomacro\MatA[3,4]\CoeffAl
+					\itemtomacro\MatA[4,1]\CoeffAm
+					\itemtomacro\MatA[4,2]\CoeffAn
+					\itemtomacro\MatA[4,3]\CoeffAo
+					\itemtomacro\MatA[4,4]\CoeffAp
+					\itemtomacro\MatB[1]\CoeffBa
+					\itemtomacro\MatB[2]\CoeffBb
+					\itemtomacro\MatB[3]\CoeffBc
+					\itemtomacro\MatB[4]\CoeffBd
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBb+\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBb+\CoeffAk*\CoeffBc+\CoeffAl*\CoeffBd}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBb+\CoeffAo*\CoeffBc+\CoeffAp*\CoeffBd}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc+\CoeffAd*\CoeffBd}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBb+\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBd}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBb+\CoeffAk*\CoeffBc+\CoeffAl*\CoeffBd}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBb+\CoeffAo*\CoeffBc+\CoeffAp*\CoeffBd}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \\
+										\ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} & \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} \\
+										\ConvVersFrac*[#2]{\CoeffAi} & \ConvVersFrac*[#2]{\CoeffAj} & \ConvVersFrac*[#2]{\CoeffAk} & \ConvVersFrac*[#2]{\CoeffAl} \\
+										\ConvVersFrac*[#2]{\CoeffAm} & \ConvVersFrac*[#2]{\CoeffAn} & \ConvVersFrac*[#2]{\CoeffAo} & \ConvVersFrac*[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} \\ \ConvVersFrac*[#2]{\CoeffBd}
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \\
+										\ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} & \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} \\
+										\ConvVersFrac[#2]{\CoeffAi} & \ConvVersFrac[#2]{\CoeffAj} & \ConvVersFrac[#2]{\CoeffAk} & \ConvVersFrac[#2]{\CoeffAl} \\
+										\ConvVersFrac[#2]{\CoeffAm} & \ConvVersFrac[#2]{\CoeffAn} & \ConvVersFrac[#2]{\CoeffAo} & \ConvVersFrac[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \\ \ConvVersFrac[#2]{\CoeffBd}
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						{\MatResA} \\ {\MatResB} \\ {\MatResC} \\ {\MatResD}
+					\end{pNiceMatrix}%
+				}{}%fin 4x4,4,1
+			\xintifboolexpr{\NbLigMatA==4 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==4}% (4,4)*(4,4)
+				{%
+					\itemtomacro\MatA[1,1]\CoeffAa
+					\itemtomacro\MatA[1,2]\CoeffAb
+					\itemtomacro\MatA[1,3]\CoeffAc
+					\itemtomacro\MatA[1,4]\CoeffAd
+					\itemtomacro\MatA[2,1]\CoeffAe
+					\itemtomacro\MatA[2,2]\CoeffAf
+					\itemtomacro\MatA[2,3]\CoeffAg
+					\itemtomacro\MatA[2,4]\CoeffAh
+					\itemtomacro\MatA[3,1]\CoeffAi
+					\itemtomacro\MatA[3,2]\CoeffAj
+					\itemtomacro\MatA[3,3]\CoeffAk
+					\itemtomacro\MatA[3,4]\CoeffAl
+					\itemtomacro\MatA[4,1]\CoeffAm
+					\itemtomacro\MatA[4,2]\CoeffAn
+					\itemtomacro\MatA[4,3]\CoeffAo
+					\itemtomacro\MatA[4,4]\CoeffAp
+					\itemtomacro\MatB[1,1]\CoeffBa
+					\itemtomacro\MatB[1,2]\CoeffBb
+					\itemtomacro\MatB[1,3]\CoeffBc
+					\itemtomacro\MatB[1,4]\CoeffBd
+					\itemtomacro\MatB[2,1]\CoeffBe
+					\itemtomacro\MatB[2,2]\CoeffBf
+					\itemtomacro\MatB[2,3]\CoeffBg
+					\itemtomacro\MatB[2,4]\CoeffBh
+					\itemtomacro\MatB[3,1]\CoeffBi
+					\itemtomacro\MatB[3,2]\CoeffBj
+					\itemtomacro\MatB[3,3]\CoeffBk
+					\itemtomacro\MatB[3,4]\CoeffBl
+					\itemtomacro\MatB[4,1]\CoeffBm
+					\itemtomacro\MatB[4,2]\CoeffBn
+					\itemtomacro\MatB[4,3]\CoeffBo
+					\itemtomacro\MatB[4,4]\CoeffBp
+					\IfBooleanTF{#1}%version étoilée := moins sur num
+						{%
+							\def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+							\def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+							\def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+							\def\MatResD{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+							\def\MatResE{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBe+\CoeffAg*\CoeffBi+\CoeffAh*\CoeffBm}}%
+							\def\MatResF{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBf+\CoeffAg*\CoeffBj+\CoeffAh*\CoeffBn}}%
+							\def\MatResG{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBc+\CoeffAf*\CoeffBg+\CoeffAg*\CoeffBk+\CoeffAh*\CoeffBo}}%
+							\def\MatResH{\ConvVersFrac*[#2]{\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBh+\CoeffAg*\CoeffBl+\CoeffAh*\CoeffBp}}%
+							\def\MatResI{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBe+\CoeffAk*\CoeffBi+\CoeffAl*\CoeffBm}}%
+							\def\MatResJ{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBb+\CoeffAj*\CoeffBf+\CoeffAk*\CoeffBj+\CoeffAl*\CoeffBn}}%
+							\def\MatResK{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBc+\CoeffAj*\CoeffBg+\CoeffAk*\CoeffBk+\CoeffAl*\CoeffBo}}%
+							\def\MatResL{\ConvVersFrac*[#2]{\CoeffAi*\CoeffBd+\CoeffAj*\CoeffBh+\CoeffAk*\CoeffBl+\CoeffAl*\CoeffBp}}%
+							\def\MatResM{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBe+\CoeffAo*\CoeffBi+\CoeffAp*\CoeffBm}}%
+							\def\MatResN{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBb+\CoeffAn*\CoeffBf+\CoeffAo*\CoeffBj+\CoeffAp*\CoeffBn}}%
+							\def\MatResO{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBc+\CoeffAn*\CoeffBg+\CoeffAo*\CoeffBk+\CoeffAp*\CoeffBo}}%
+							\def\MatResP{\ConvVersFrac*[#2]{\CoeffAm*\CoeffBd+\CoeffAn*\CoeffBh+\CoeffAo*\CoeffBl+\CoeffAp*\CoeffBp}}%
+						}%
+						{%
+							\def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBi+\CoeffAd*\CoeffBm}}%
+							\def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBj+\CoeffAd*\CoeffBn}}%
+							\def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBg+\CoeffAc*\CoeffBk+\CoeffAd*\CoeffBo}}%
+							\def\MatResD{\ConvVersFrac[#2]{\CoeffAa*\CoeffBd+\CoeffAb*\CoeffBh+\CoeffAc*\CoeffBl+\CoeffAd*\CoeffBp}}%
+							\def\MatResE{\ConvVersFrac[#2]{\CoeffAe*\CoeffBa+\CoeffAf*\CoeffBe+\CoeffAg*\CoeffBi+\CoeffAh*\CoeffBm}}%
+							\def\MatResF{\ConvVersFrac[#2]{\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBf+\CoeffAg*\CoeffBj+\CoeffAh*\CoeffBn}}%
+							\def\MatResG{\ConvVersFrac[#2]{\CoeffAe*\CoeffBc+\CoeffAf*\CoeffBg+\CoeffAg*\CoeffBk+\CoeffAh*\CoeffBo}}%
+							\def\MatResH{\ConvVersFrac[#2]{\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBh+\CoeffAg*\CoeffBl+\CoeffAh*\CoeffBp}}%
+							\def\MatResI{\ConvVersFrac[#2]{\CoeffAi*\CoeffBa+\CoeffAj*\CoeffBe+\CoeffAk*\CoeffBi+\CoeffAl*\CoeffBm}}%
+							\def\MatResJ{\ConvVersFrac[#2]{\CoeffAi*\CoeffBb+\CoeffAj*\CoeffBf+\CoeffAk*\CoeffBj+\CoeffAl*\CoeffBn}}%
+							\def\MatResK{\ConvVersFrac[#2]{\CoeffAi*\CoeffBc+\CoeffAj*\CoeffBg+\CoeffAk*\CoeffBk+\CoeffAl*\CoeffBo}}%
+							\def\MatResL{\ConvVersFrac[#2]{\CoeffAi*\CoeffBd+\CoeffAj*\CoeffBh+\CoeffAk*\CoeffBl+\CoeffAl*\CoeffBp}}%
+							\def\MatResM{\ConvVersFrac[#2]{\CoeffAm*\CoeffBa+\CoeffAn*\CoeffBe+\CoeffAo*\CoeffBi+\CoeffAp*\CoeffBm}}%
+							\def\MatResN{\ConvVersFrac[#2]{\CoeffAm*\CoeffBb+\CoeffAn*\CoeffBf+\CoeffAo*\CoeffBj+\CoeffAp*\CoeffBn}}%
+							\def\MatResO{\ConvVersFrac[#2]{\CoeffAm*\CoeffBc+\CoeffAn*\CoeffBg+\CoeffAo*\CoeffBk+\CoeffAp*\CoeffBo}}%
+							\def\MatResP{\ConvVersFrac[#2]{\CoeffAm*\CoeffBd+\CoeffAn*\CoeffBh+\CoeffAo*\CoeffBl+\CoeffAp*\CoeffBp}}%
+						}%
+					\IfStrEq{#6}{Aff}%si matrice
+						{%
+							\IfBooleanTF{#1}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \\
+										\ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} & \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} \\
+										\ConvVersFrac*[#2]{\CoeffAi} & \ConvVersFrac*[#2]{\CoeffAj} & \ConvVersFrac*[#2]{\CoeffAk} & \ConvVersFrac*[#2]{\CoeffAl} \\
+										\ConvVersFrac*[#2]{\CoeffAm} & \ConvVersFrac*[#2]{\CoeffAn} & \ConvVersFrac*[#2]{\CoeffAo} & \ConvVersFrac*[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \\
+										\ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} & \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} \\
+										\ConvVersFrac*[#2]{\CoeffBi} & \ConvVersFrac*[#2]{\CoeffBj} & \ConvVersFrac*[#2]{\CoeffBk} & \ConvVersFrac*[#2]{\CoeffBl} \\
+										\ConvVersFrac*[#2]{\CoeffBm} & \ConvVersFrac*[#2]{\CoeffBn} & \ConvVersFrac*[#2]{\CoeffBo} & \ConvVersFrac*[#2]{\CoeffBp}
+									\end{pNiceMatrix}
+									=
+								}%
+								{%
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \\
+										\ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} & \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} \\
+										\ConvVersFrac[#2]{\CoeffAi} & \ConvVersFrac[#2]{\CoeffAj} & \ConvVersFrac[#2]{\CoeffAk} & \ConvVersFrac[#2]{\CoeffAl} \\
+										\ConvVersFrac[#2]{\CoeffAm} & \ConvVersFrac[#2]{\CoeffAn} & \ConvVersFrac[#2]{\CoeffAo} & \ConvVersFrac[#2]{\CoeffAp}
+									\end{pNiceMatrix}
+									\times
+									\begin{pNiceMatrix}[#3]
+										\ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \\
+										\ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} & \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} \\
+										\ConvVersFrac[#2]{\CoeffBi} & \ConvVersFrac[#2]{\CoeffBj} & \ConvVersFrac[#2]{\CoeffBk} & \ConvVersFrac[#2]{\CoeffBl} \\
+										\ConvVersFrac[#2]{\CoeffBm} & \ConvVersFrac[#2]{\CoeffBn} & \ConvVersFrac[#2]{\CoeffBo} & \ConvVersFrac[#2]{\CoeffBp}
+									\end{pNiceMatrix}
+									=
+								}%
+						}{}%
+					\begin{pNiceMatrix}[#3]
+						{\MatResA} & {\MatResB} & {\MatResC} & {\MatResD} \\
+						{\MatResE} & {\MatResF} & {\MatResG} & {\MatResH} \\
+						{\MatResI} & {\MatResJ} & {\MatResK} & {\MatResL} \\
+						{\MatResM} & {\MatResN} & {\MatResO} & {\MatResP}
+					\end{pNiceMatrix}%
+				}{}%fin 4x4,4,4
+		}%
+}
+
+\NewDocumentCommand\EtatProbPY{ O{dec} D<>{} r() r() r() }{%
+	%1=options conversion
+	%2=options nicematrix
+	%3=matrice initiale
+	%4=matrice (,,;,,)
+	%5=niveau
+	%---------------------
+	%lectures des matrices
+	\setsepchar{,}%
+	\readlist*\MAMATRICEINIT{#3}%
+	\setsepchar{§/,}%
+	\readlist*\MAMATRICEA{#4}%
+	%les coeffs de A et le déterminant et les coeff de l'inverse
+	\ifnum \MAMATRICEAlen=4
+		\itemtomacro\MAMATRICEINIT[1]\MatInitA
+		\itemtomacro\MAMATRICEINIT[2]\MatInitB
+		\itemtomacro\MAMATRICEINIT[3]\MatInitC
+		\itemtomacro\MAMATRICEINIT[4]\MatInitD
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[1,4]\MatD
+		\itemtomacro\MAMATRICEA[2,1]\MatE
+		\itemtomacro\MAMATRICEA[2,2]\MatF
+		\itemtomacro\MAMATRICEA[2,3]\MatG
+		\itemtomacro\MAMATRICEA[2,4]\MatH
+		\itemtomacro\MAMATRICEA[3,1]\MatI
+		\itemtomacro\MAMATRICEA[3,2]\MatJ
+		\itemtomacro\MAMATRICEA[3,3]\MatK
+		\itemtomacro\MAMATRICEA[3,4]\MatL
+		\itemtomacro\MAMATRICEA[4,1]\MatM
+		\itemtomacro\MAMATRICEA[4,2]\MatN
+		\itemtomacro\MAMATRICEA[4,3]\MatO
+		\itemtomacro\MAMATRICEA[4,4]\MatP
+		%les solutions
+		\def\MatPuissA{\ConvVersFrac[#1]{\py{etat_prob_QQ(\MatInitA,\MatInitB,\MatInitC,\MatInitD,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[0]}}}%
+		\def\MatPuissB{\ConvVersFrac[#1]{\py{etat_prob_QQ(\MatInitA,\MatInitB,\MatInitC,\MatInitD,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[1]}}}%
+		\def\MatPuissC{\ConvVersFrac[#1]{\py{etat_prob_QQ(\MatInitA,\MatInitB,\MatInitC,\MatInitD,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[2]}}}%
+		\def\MatPuissD{\ConvVersFrac[#1]{\py{etat_prob_QQ(\MatInitA,\MatInitB,\MatInitC,\MatInitD,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[3]}}}%
+		%
+		\begin{pNiceMatrix}[#2]
+			{\MatPuissA} & {\MatPuissB} & {\MatPuissC} & {\MatPuissD}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=3
+		\itemtomacro\MAMATRICEINIT[1]\MatInitA
+		\itemtomacro\MAMATRICEINIT[2]\MatInitB
+		\itemtomacro\MAMATRICEINIT[3]\MatInitC
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[1,3]\MatC
+		\itemtomacro\MAMATRICEA[2,1]\MatD
+		\itemtomacro\MAMATRICEA[2,2]\MatE
+		\itemtomacro\MAMATRICEA[2,3]\MatF
+		\itemtomacro\MAMATRICEA[3,1]\MatG
+		\itemtomacro\MAMATRICEA[3,2]\MatH
+		\itemtomacro\MAMATRICEA[3,3]\MatI
+		%les solutions
+		\def\MatPuissA{\ConvVersFrac[#1]{\py{etat_prob_TT(\MatInitA,\MatInitB,\MatInitC,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[0]}}}%
+		\def\MatPuissB{\ConvVersFrac[#1]{\py{etat_prob_TT(\MatInitA,\MatInitB,\MatInitC,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[1]}}}%
+		\def\MatPuissC{\ConvVersFrac[#1]{\py{etat_prob_TT(\MatInitA,\MatInitB,\MatInitC,\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[2]}}}%
+		%
+		\begin{pNiceMatrix}[#2]
+			{\MatPuissA} & {\MatPuissB} & {\MatPuissC}
+		\end{pNiceMatrix}%
+	\fi
+	\ifnum \MAMATRICEAlen=2
+		\itemtomacro\MAMATRICEINIT[1]\MatInitA
+		\itemtomacro\MAMATRICEINIT[2]\MatInitB
+		\itemtomacro\MAMATRICEA[1,1]\MatA
+		\itemtomacro\MAMATRICEA[1,2]\MatB
+		\itemtomacro\MAMATRICEA[2,1]\MatC
+		\itemtomacro\MAMATRICEA[2,2]\MatD
+		%les solutions
+		\def\MatPuissA{\ConvVersFrac[#1]{\py{etat_prob_DD(\MatInitA,\MatInitB,\MatA,\MatB,\MatC,\MatD,#5)[0]}}}%
+		\def\MatPuissB{\ConvVersFrac[#1]{\py{etat_prob_DD(\MatInitA,\MatInitB,\MatA,\MatB,\MatC,\MatD,#5)[1]}}}%
+		%
+		\begin{pNiceMatrix}[#2]
+			{\MatPuissA} & {\MatPuissB}
+		\end{pNiceMatrix}%
+	\fi
+}
+
 \fi
 
 \endinput
\ No newline at end of file



More information about the tex-live-commits mailing list.