{"cells":[{"metadata":{},"cell_type":"markdown","source":"![En tête general](https://raw.githubusercontent.com/PythonLycee/PyLyc/master/img/En_tete_general.png)\n\n\n© Copyright Franck CHEVRIER 2019-2021 https://www.python-lycee.com.
\nLes activités partagées sur Capytale sont sous licence Creative Commons.\n\n\n Pour exécuter une saisie Python, sélectionner la cellule et valider avec SHIFT+Entrée."},{"metadata":{},"cell_type":"markdown","source":"
\n\n"},{"metadata":{},"cell_type":"markdown","source":"Programme officiel : Programme Tale Math Expertes\n\nLiens vers les exercices et démonstrations du manuel : Collection Barbazo - Option Mathématiques Expertes - Programme 2020.\n\nPour consulter le manuel, cliquer ici."},{"metadata":{},"cell_type":"markdown","source":"COURS DE TERMINALE - MATHEMATIQUES EXPERTES
\n\n
\n"},{"metadata":{},"cell_type":"markdown","source":"### Sommaire\n\nCalcul matriciel
\n
\n"},{"metadata":{},"cell_type":"markdown","source":"Une entreprise de fabrication de pièces de quincaillerie possède deux chaînes de production qui usinent des vis, des clous et des écrous.1. Activité d'introduction
\n
\n"},{"metadata":{},"cell_type":"markdown","source":"2. Opérations sur les matrices
\n
\n"},{"metadata":{},"cell_type":"markdown","source":"2.1. Notion de matrice
\n
\nDéfinition : Matrice à coefficients réels.\n\n
\n On appelle matrice à coefficients réels un tableau dont les élements sont des nombres réels.
\nSi la matrice comporte $n$ lignes et $m$ colonnes, on dit qu'elle est de dimension $n \\times m$.
\n ($n \\in \\mathbb{N}^*$ et $m \\in \\mathbb{N}^*$)\n
MATRICES CARRÉES\n
Dans le cas où une matrice a autant de lignes que de colonnes, on dit que c'est une matrice carrée d'ordre $n$ (où $n$ est le nombre de lignes et le nombre de colonnes).
\n Notation :
\n L'ensemble des matrices carrées de dimension $n \\times n$, que nous étudierons plus particulièrement, est noté $\\mathcal M_n(\\mathbb{R})$.
On les appelle matrices carrées d'ordre $n$. \n
\n"},{"metadata":{},"cell_type":"markdown","source":"2.2. Produit d'une matrice par un réel, et somme de matrices
\n
\nDéfinition : Produit d'une matrice par un réel.\n
\nSi $A$ est une matrice et $k \\in \\mathbb{R}$, alors on note $k \\times A=kA$ la matrice obtenue en multipliant les coefficients de $A$ par $k$.\n
\n
\n\n$$k \\; A = k \\; \\begin{pmatrix}\n a_{1,1} & ... & a_{1,j}& ...& a_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n a_{i,1} & ... & \\color{green}{a_{i,j}}& ...& a_{i,m} \\\\\n ... & ... & ... & ...& ... \\\\\n a_{n,1} & ... & a_{n,j}& ...& a_{n,m} \\end{pmatrix}\n \\;=\\;\n \\begin{pmatrix}\n k\\;a_{1,1} & ... & k\\;a_{1,j}& ...& k\\;a_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n k\\;a_{i,1} & ... & \\color{green}{k\\;a_{i,j}}& ...& k\\;a_{i,m} \\\\\n ... & ... & ... & ...& ... \\\\\n k\\;a_{n,1} & ... & k\\;a_{n,j}& ...& k\\;a_{n,m} \\end{pmatrix}\n $$\n
\n\n\n\n\n\n
\nDéfinition :Somme de matrices.\n
\n Si $A$ et $B$ sont des matrices de même dimension, alors on appelle somme de $A$ et $B$ et on note $A+B$ la matrice dont les coefficients sont les sommes des coefficients des matrices $A$ et $B$ qui se correspondent deux à deux.\n
\n\n$$\\color{blue}{A}+\\color{green}{B}= \n \\begin{pmatrix} \n a_{1,1} & ... & a_{1,j}& ...& a_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n a_{i,1} & ... & \\color{blue}{a_{i,j}}& ...& a_{i,m} \\\\\n ... & ... & ... & ...& ... \\\\\n a_{n,1} & ... & a_{n,j}& ...& a_{n,m} \\end{pmatrix}\n \\;+\\;\n \\begin{pmatrix}\n b_{1,1} & ... & b_{1,j}& ...& b_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n b_{i,1} & ... & \\color{green}{b_{i,j}}& ...& b_{i,m} \\\\\n ... & ... & ... & ...& ... \\\\\n b_{n,1} & ... & b_{n,j}& ...& b_{n,m} \\end{pmatrix}\n \\;=\\;\n \\begin{pmatrix}\n a_{1,1}+b_{1,1} & ... & a_{1,1}+b_{1,j}& ...& a_{1,1}+b_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n a_{i,1}+b_{i,1} & ... & \\color{blue}{a_{i,j}}+\\color{green}{b_{i,j}}& ...& a_{i,m}+b_{i,m} \\\\\n ... & ... & ... & ...& ... \\\\\n a_{n,1}+b_{n,1} & ... & a_{n,j}+a_{n,j}& ...& a_{n,m}+b_{n,m} \\end{pmatrix}\n $$\n
\n\n
\n"},{"metadata":{},"cell_type":"markdown","source":"2.3. Produit de deux matrices
\n
\nDéfinition : Produit d'une matrice ligne par une matrice colonne.\n
\n Si $L$ est une matrice ligne $1 \\times n$ et $C$ est une matrice colonne $n \\times 1$, alors on appelle produit de $L$ par $C$ et on note $L\\times C=LC$ la matrice $1 \\times 1$ dont l'unique coefficient est obtenu en sommant les produits des coefficients de $L$ par $C$ pris deux à deux, dans l'ordre.\n
\n\n$$\\color{blue}{L}\\color{green}{C}=\\color{blue}{\\begin{pmatrix}l_1 & l_2 & ... & l_k & ... & l_n \\end{pmatrix}}\\color{green}{\\begin{pmatrix} c_1 \\\\ c_2 \\\\ ... \\\\ c_k \\\\ ... \\\\ c_n \\end{pmatrix} }=\\begin{pmatrix}\\color{blue}{l_1}\\color{green}{c_1}+\\color{blue}{l_2}\\color{green}{c_2}+...+\\color{blue}{l_k}\\color{green}{c_k}+...\\color{blue}{l_n}\\color{green}{c_n} \\end{pmatrix}\n$$\n\n\n\n
Opération posée :\n\n$$\\begin{array}{c|c|c}\n \\begin{matrix}\\curvearrowright \\\\ \\times \\end{matrix} \n & \\begin{matrix} \n \\color{green}{\\begin{pmatrix} c_1 \\\\ c_2 \\\\ ... \\\\ c_k \\\\ ... \\\\ c_n \\end{pmatrix} }\n &\n \\color{red}{\\downarrow} \n \\end{matrix} \\\\\n \\hline\n \\begin{matrix}\n \\color{blue}{\\begin{pmatrix}l_1 & l_2 & ... & l_k & ... & l_n \\end{pmatrix}} \\\\\n \\color{red}{\\longrightarrow}\n \\end{matrix} \n & \n \\begin{matrix}\n \\begin{pmatrix}\\color{blue}{l_1}\\color{green}{c_1}+\\color{blue}{l_2}\\color{green}{c_2}+...+\\color{blue}{l_k}\\color{green}{c_k}+...\\color{blue}{l_n}\\color{green}{c_n} \\end{pmatrix} \\\\\n \\;\n \\end{matrix} \n\\end{array}$$\n
\nDéfinition : Produit de deux matrices.\n\n\n
\n Si $A$ est une matrice $n \\times m$ et $B$ est une matrice $m \\times p$, alors on appelle produit de $A$ par $B$ et on note $A\\times B=AB$ la matrice $n \\times p$ dont le coefficient de la i ème ligne et de la j ème colonne est obtenu en multipliant la i ème ligne de $A$ par la j ème colonne de $B$.\n
\n\n$$\\color{blue}{A}\\color{green}{B}=\\begin{pmatrix}\n a_{1,1} & ... & a_{1,k}& ...& a_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n \\color{blue}{a_{i,1}} & \\color{blue}{...} & \\color{blue}{a_{i,k}}& \\color{blue}{...} & \\color{blue}{a_{i,m}} \\\\\n ... & ... & ... & ...& ... \\\\\n a_{n,1} & ... & a_{n,k}& ...& a_{n,m}\n \\end{pmatrix}\n \\begin{pmatrix} \n b_{1,1} & ... & \\color{green}{b_{1,j}}& ...& b_{1,p} \\\\ \n ... & ... & \\color{green}{...} & ...& ... \\\\\n b_{k,1} & ... & \\color{green}{b_{k,j}}& ...& b_{k,p} \\\\\n ... & ... & \\color{green}{...} & ...& ... \\\\\n b_{m,1} & ... & \\color{green}{b_{m,j}}& ...& b_{m,p} \n \\end{pmatrix}\n =\n \\begin{pmatrix}\n ... & ... & ... \\\\ \n ... & ... & ... \\\\\n ... & \\color{blue}{a_{i,1}}\\color{green}{b_{1,j}}+\\color{blue}{a_{i,2}}\\color{green}{b_{2,j}}+...+\\color{blue}{a_{i,k}}\\color{green}{b_{k,j}}+...\\color{blue}{a_{i,m}}\\color{green}{b_{m,j}}& ... \\\\\n ... & ... & ... \\\\\n ... & ... & ... \\\\\n \\end{pmatrix}\n$$\n\n\n\n\nRemarques :
Opération posée :\n\n\n$$\\begin{array}{c|c|c}\n \\begin{matrix}\\curvearrowright \\\\ \\times \\end{matrix} \n & \n \\begin{matrix} \n \\begin{pmatrix} \n b_{1,1} & ... & \\color{green}{b_{1,j}}& ...& b_{1,p} \\\\ \n ... & ... & \\color{green}{...} & ...& ... \\\\\n b_{k,1} & ... & \\color{green}{b_{k,j}}& ...& b_{k,p} \\\\\n ... & ... & \\color{green}{...} & ...& ... \\\\\n b_{m,1} & ... & \\color{green}{b_{m,j}}& ...& b_{m,p} \n \\end{pmatrix}\n &\n \\color{red}{\\downarrow} \n \\end{matrix} \\\\\n \\hline\n \\begin{matrix}\n \\begin{pmatrix}\n a_{1,1} & ... & a_{1,k}& ...& a_{1,m} \\\\ \n ... & ... & ... & ...& ... \\\\\n \\color{blue}{a_{i,1}} & \\color{blue}{...} & \\color{blue}{a_{i,k}}& \\color{blue}{...} & \\color{blue}{a_{i,m}} \\\\\n ... & ... & ... & ...& ... \\\\\n a_{n,1} & ... & a_{n,k}& ...& a_{n,m}\n \\end{pmatrix} \\\\\n \\color{red}{\\longrightarrow}\n \\end{matrix}\n & \n \\begin{matrix}\n \\begin{pmatrix}\n ... & ... & ... \\\\ \n ... & ... & ... \\\\\n ... & \\color{blue}{a_{i,1}}\\color{green}{b_{1,j}}+\\color{blue}{a_{i,2}}\\color{green}{b_{2,j}}+...+\\color{blue}{a_{i,k}}\\color{green}{b_{k,j}}+...\\color{blue}{a_{i,m}}\\color{green}{b_{m,j}}& ... \\\\\n ... & ... & ... \\\\\n ... & ... & ... \\\\\n \\end{pmatrix} \\\\\n \\;\n \\end{matrix} \n\\end{array}$$\n\n
\n\n\n\n
\n- Attention, même quand le produit $AB$ de deux matrices peut être effectué, le produit $BA$ n'existe pas forcément.
\n
\n De plus, même si $AB$ et $BA$ existent, on a en général $AB \\ne BA$.\n
\n\n \n"},{"metadata":{},"cell_type":"markdown","source":"Exercices :\n
- Si $A \\in \\mathcal M_n(\\mathbb{R})$ et $B \\in \\mathcal M_n(\\mathbb{R})$ alors $AB \\in \\mathcal M_n(\\mathbb{R})$.
\n- Si $A \\in \\mathcal M_n(\\mathbb{R})$ et $C$ est une matrice colonne $n \\times 1$ alors $AC$ est une matrice colonne $n \\times 1$.
\n \n
\n Par exemple, pour $n=2$ :
\n$$\\begin{array}{c|c|c}\n \\begin{matrix}\\curvearrowright \\\\ \\times \\end{matrix} \n & \n \\begin{matrix} \n \\begin{pmatrix} \n c_1 \\\\\n c_2 \n \\end{pmatrix}\n &\n \\color{red}{\\downarrow} \n \\end{matrix} \\\\\n \\hline\n \\begin{matrix}\n \\begin{pmatrix}\n a_{1,1} & a_{1,2} \\\\\n a_{2,1} & a_{2,2} \\\\\n \\end{pmatrix} \\\\\n \\color{red}{\\longrightarrow}\n \\end{matrix}\n & \n \\begin{matrix}\n \\begin{pmatrix}\n a_{1,1}c_1 + a_{1,2}c_2 \\\\ \n a_{2,1}c_1 + a_{2,2}c_2 \\\\\n \\end{pmatrix} \\\\\n \\;\n \\end{matrix} \n\\end{array}$$ \n- Si $L$ est une matrice ligne $1 \\times n$ et $B \\in \\mathcal M_n(\\mathbb{R})$ alors $LA$ est une matrice ligne $1 \\times n$.
\n
\n Par exemple, pour $n=2$ :
\n$$\\begin{array}{c|c|c}\n \\begin{matrix}\\curvearrowright \\\\ \\times \\end{matrix} \n & \n \\begin{matrix} \n \\begin{pmatrix} \n b_{1,1} & b_{1,2} \\\\\n b_{2,1} & b_{2,2} \\\\\n \\end{pmatrix}\n &\n \\color{red}{\\downarrow} \n \\end{matrix} \\\\\n \\hline\n \\begin{matrix}\n \\begin{pmatrix}\n l_1 &\n l_2 \n \\end{pmatrix} \\\\\n \\color{red}{\\longrightarrow}\n \\end{matrix}\n & \n \\begin{matrix}\n \\begin{pmatrix}\n l_1b_{1,1} + l_2b_{2,1} & \n l_1b_{1,2} + l_2b_{2,2} \\\\\n \\end{pmatrix} \\\\\n \\;\n \\end{matrix} \n\\end{array}$$ \n
\nPropriété : Associativité et distributivité du produit de matrices.\nRemarques :
\nPour toutes matrices $A$ , $B$ et $C$ dont les dimensions permettent d'effectuer les calculs ci-dessous, on a:\n\n
\n- $A(BC)=(AB)C$
\n- $A(B+C)=AB+AC$ et $(A+B)C=AC+BC$
\n
\n"},{"metadata":{},"cell_type":"markdown","source":"2.4. Matrice identité et puissance d'une matrice.
\n
\nDéfinition : Matrice identité d'ordre n.\n\nRemarque :
\nSoit $n \\in \\mathbb{N}^*$.
\n On appelle matrice identité d'ordre $n$ , et on note $I_n \\in \\mathcal M_n(\\mathbb{R})$ la matrice composée :\n\n
\n \n \n$$I_n = \\begin{pmatrix} \n \\color{coral}{1} & 0 & 0 & ... & ... & ... & 0 \\\\ \n 0 & \\color{coral}{1} & 0 & ... & ... & ... & ...\\\\\n 0 & 0 & \\color{coral}{1} & 0 & ... & ... & ...\\\\\n... & ... & 0 & \\color{coral}{1} & ... & ... & ...\\\\\n... & ... & ... & ... & ... & ... & ...\\\\\n... & ... & ... & ... & ... & \\color{coral}{1} & 0 \\\\\n 0 & ... & ... & ... & ... & 0 & \\color{coral}{1} \\end{pmatrix}$$\n- de coefficients $1$ sur la diagonale principale ;
\n
\n (les coefficients de la diagonale principale sont ceux dont l'indice de ligne est égal à l'indice de colonne)\n- de coefficients nuls ailleurs.
\n
\nPropriété : Élément neutre pour la multiplication dans $M_n(\\mathbb{R}).$
\n$\\forall A \\in M_n(\\mathbb{R})$ , on a :\n\n
\n"},{"metadata":{},"cell_type":"markdown","source":"Exercice :- $AI_n=A$
\n- $I_nA=A$
\n
\nDémontrer la propriété ci-dessus dans le cas où $n=2$, en détaillant les calculs.\n "},{"metadata":{},"cell_type":"markdown","source":"\nDéfinition : Puissance d'une matrice carrée.
\nSoit $n \\in \\mathbb{N}^*$.
\nSoit $A \\in M_n(\\mathbb{R})$ et $k \\in \\mathbb{N}$.
\nOn appelle puissance $k^{\\text{ème}}$ de $A$ la matrice définie par :\n\n
"},{"metadata":{},"cell_type":"markdown","source":"Exercices :\n- $A^0=I_n$ si $k=0$;
\n- $A^k=\\underbrace{A \\times A \\times A \\times ... \\times A}_{k \\text{ facteurs}}$ si $k>0$.
\n\n
\nNB: La fonction Python matrix_power incluse dans le module numpy.linalg permet également de calculer la puissance d'une matrice."},{"metadata":{"trusted":false},"cell_type":"code","source":"#Question 2 : Saisir et stocker A dans cette cellule\nfrom numpy import*\nfrom numpy.linalg import*\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Question 2 : Tester les syntaxes\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Question 3 : Écrire la fonction puissance\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Question 4 : Tester la fonction puissance\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"- Dans le manuel : n°14,17,16 p195
\n- Dans le manuel : n°53,48 p199,200
\n- Syntaxe Python :
\n On considère la matrice $A=\\begin{pmatrix} 1 & -2 \\\\ 3 & -1 \\end{pmatrix}$.\n\n
\n- Calculer, à la main, les matrices $A^2$ et $A^3$.
\n- Saisir et stocker dans A la matrice $A$ dans Python, puis tester les syntaxes A**2 et A**3.
\n
\n Ces syntaxes permettent-elles de calculer les puissances de la matrice $A$ ?\n- Écrire une fonction Python puissance qui reçoit en argument une matrice A et un entier k et renvoie la matrice qui est la puissance $k^{\\text{ème}}$ de A.
\n
\n (on pourra utiliser une boucle)\n- Tester cette fonction pour la matrice $A$ de l'énoncé
\n\n"},{"metadata":{},"cell_type":"markdown","source":"3. Résolution matricielle de systèmes d'équations
\n\n"},{"metadata":{},"cell_type":"markdown","source":"3.1. Inverse d'une matrice carrée.
\n\nDéfinition : Inversibilité d'une matrice carrée.\n
\nSoit $n \\in \\mathbb{N}^*$.
\nSoit $A \\in \\mathcal M_n(\\mathbb{R})$\nOn dit que $A$ est inversible s'il existe une matrice $B$ telle que $AB=I_n$ et $BA=I_n$.\n\nPropriété : Conditions suffisantes pour l'inversibilité d'une matrice carrée.\nRemarque :
\nSoit $n \\in \\mathbb{N}^*$.
\nSoit $A \\in \\mathcal M_n(\\mathbb{R})$ et $B \\in \\mathcal M_n(\\mathbb{R})$.
\nOn a :\n$AB=I_n \\Longleftrightarrow BA=I_n$\n
\nCette propriété (admise car difficile à démontrer) permet de ne pas avoir à effectuer deux calculs pour prouver qu'une matrice est inversible : Une seule des deux conditions suffit.\n\nPropriété : Unicité de la matrice pour l'inversibilité d'une matrice carrée.\n\nExercice :
\nSoit $n \\in \\mathbb{N}^*$.
\nSi $A \\in \\mathcal M_n(\\mathbb{R})$ est inversible, alors il existe une unique matrice $B \\in \\mathcal M_n(\\mathbb{R})$ telle que $AB=BA=I_n$.
\n
\nDémontrons la propriété ci-dessus. Supposons que $B_1$ et $B_2$ vérifient toutes deux la propriété énoncée.
\nDémontrer que $B_1AB_2=B_2$ puis que $B_1AB_2=B_1$. Conclure.\n\nCette propriété justifie la définition suivante :\n\nDéfinition : Inverse d'une matrice carrée."},{"metadata":{},"cell_type":"markdown","source":"Exercices :
\nSoit $n \\in \\mathbb{N}^*$.
\nSoit $A \\in \\mathcal M_n(\\mathbb{R})$ inversible.
\nLa matrice $B$ qui vérifie $AB=BA=I_n$ est appelée matrice inverse de $A$ , et on la note $A^{-1}$.\n
\n\n
- Dans le manuel : n°26,27,32 p195
\n- Dans le manuel : n°39,40 p198
\n- Dans le manuel : n°68 p203
\n- Syntaxe Python :
"},{"metadata":{"trusted":false},"cell_type":"code","source":"#Saisir les matrices A et B\nfrom numpy import*\nfrom numpy.linalg import*\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Tester ici l'appel à la fonction inv pour A\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Tester ici l'appel à la fonction inv pour B\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Pour déterminer si une matrice carrée d'ordre 2 est inversible et déterminer dans ce cas son inverse, il existe une méthode générale...\n"},{"metadata":{},"cell_type":"markdown","source":"Exercice :
\n La fonction Python inv incluse dans le module numpy.linalg permet de calculer l'inverse d'une matrice.
Tester cette fonction pour les matrices $A=\\begin{pmatrix} 4 & -2 \\\\ 2 & 3 \\end{pmatrix}$ et $\\begin{pmatrix} 5 & 2 \\\\ 10 & 4 \\end{pmatrix}$.
Que peut-on conclure ?\n
\nDans le manuel : n°66 p203\n
\nCet exercice permet d'énoncer :"},{"metadata":{},"cell_type":"markdown","source":"\nPropriété : Inversion d'une matrice carrée d'ordre 2\n\n\nExercices :
\nSoit $A = \\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix} \\in \\mathcal M_2(\\mathbb{R})$.
\nAlors : \n\n
- $A$ est inversible $\\Longleftrightarrow ad-bc \\ne 0$ ;
\n- Dans le cas où $ad-bc \\ne 0$ , l'inverse de $A$ est :
\n
\n $A^{-1} = \\frac{1}{ad-bc} \\begin{pmatrix} d & -b \\\\ -c & a \\end{pmatrix}$\n
\n\n
- Dans le manuel : n°30,31(sans calculatrice) p196,197
\n- Dans le manuel : n°38 p198
\n"},{"metadata":{},"cell_type":"markdown","source":"\n"},{"metadata":{},"cell_type":"markdown","source":"3.2. Écriture matricielle d'un système linéaire d'équations
\n\nDéfinition : Système linéaire d'équations.
\n\n$(S) : \\begin{Bmatrix}\n \\color{blue}{a_{1,1}}\\color{red}{x_1}+\\color{blue}{a_{1,2}}\\color{red}{x_2}+...+\\color{blue}{a_{1,j}}\\color{red}{x_j}+...+\\color{blue}{a_{1,n}}\\color{red}{x_n}=\\color{green}{b_1} \\\\\n \\color{blue}{a_{2,1}}\\color{red}{x_1}+\\color{blue}{a_{2,2}}\\color{red}{x_2}+...+\\color{blue}{a_{2,j}}\\color{red}{x_j}+...+\\color{blue}{a_{2,n}}\\color{red}{x_n}=\\color{green}{b_2} \\\\\n ...\\\\\n \\color{blue}{a_{i,1}}\\color{red}{x_1}+\\color{blue}{a_{i,2}}\\color{red}{x_2}+...+\\color{blue}{a_{i,j}}\\color{red}{x_j}+...+\\color{blue}{a_{i,n}}\\color{red}{x_n}=\\color{green}{b_i} \\\\\n ...\\\\\n \\color{blue}{a_{n,n}}\\color{red}{x_1}+\\color{blue}{a_{n,2}}\\color{red}{x_2}+...+\\color{blue}{a_{n,j}}\\color{red}{x_j}+...+\\color{blue}{a_{n,n}}\\color{red}{x_n}=\\color{green}{b_n} \n \\end{Bmatrix}$\n
\noù :\n\n
\nest appelé système linéaire à $n$ équations et $n$ inconnues.\n"},{"metadata":{},"cell_type":"markdown","source":"- $n \\in \\mathbb{N}, n \\geq 2,$
\n- $(a_{i,j})_{ \\begin{matrix} 1 \\leq i \\leq n \\\\ 1 \\leq j \\ n \\end{matrix} }$ des coefficients fixés ;
\n- $(b_i)_{1 \\leq i \\leq n}$ des coefficients réels fixés ;
\n- $(x_j)_{1 \\leq j \\leq n}$ sont des inconnues réelles à déterminer ;
\n\nPropriété : Écriture matricielle d'un système linéaire."},{"metadata":{},"cell_type":"markdown","source":"Exercice :
\nLe système $(S)$ est équivalent à $AX=B$ où :
\n\n$\\color{blue}{A=\\begin{pmatrix}\n a_{1,1} & a_{1,2} & ... & a_{1,j} & ... & a_{1,n} \\\\\n a_{2,1} & a_{2,2} & ... & a_{2,j} & ... & a_{2,n} \\\\\n ... & ... & ... & ... & ... & ... \\\\\n a_{i,1} & a_{i,2} & ... & a_{i,j} & ... & a_{i,n} \\\\\n ... & ... & ... & ... & ... & ... \\\\\n a_{n,1} & a_{n,2} & ... & a_{n,j} & ... & a_{n,n} \\\\\n \\end{pmatrix}}\n \\;\\;\\text{ ; }\\;\\;\n \\color{red}{X=\\begin{pmatrix}\n x_1 \\\\\n x_2 \\\\\n ... \\\\\n x_j \\\\\n ... \\\\\n x_n \\\\\n \\end{pmatrix}}\n \\;\\;\\text{ et }\\;\\;\n \\color{green}{B=\\begin{pmatrix}\n b_1 \\\\\n b_2 \\\\\n ... \\\\\n b_i \\\\\n ... \\\\\n b_n \\\\\n \\end{pmatrix}}\n $\n
\nRésoudre le système $(S)$ revient donc à déterminer les matrices $X$ vérifiant l'égalité matricielle $AX=B$.\n
\nDans le manuel : n°33 p197"},{"metadata":{},"cell_type":"markdown","source":"\n"},{"metadata":{},"cell_type":"markdown","source":"3.3. Méthode de résolution d'un système matriciel
\n\nMéthode : Méthode générale de résolution d'un système linéaire à $n$ équations et $n$ inconnues\n\nRemarque :
\n\n\n
\n- Écrire le système d'équations sous la forme $AX=B$ où $A \\in \\mathcal M_n(\\mathbb{R})$ et $X,B$ sont des matrices colonnes $n \\times 1$;
\n- Déterminer si la matrice $A$ est inversible. Arrêter si ce n'est pas le cas (voir remarque).
\n- Déterminer $A^{-1}$.
\n- $AX=B$ devient :
\n
\n $A^{-1}AX=A^{-1}B$ (en multipliant à gauche par $A^{-1}$)
\n $X=A^{-1}B$ (car $A^{-1}A=I$)
\n Il s'agit même d'une équivalence puisqu'on peut remonter les étapes en multipliant à gauche par $A$.\n- Calculer $X=A^{-1}B$ et conclure :
\n
Il existe une unique matrice $X=\\begin{pmatrix}\n x_1 \\\\\n x_2 \\\\\n ... \\\\\n x_j \\\\\n ... \\\\\n x_n \\\\\n \\end{pmatrix}$ solution, et le système admet donc une unique solution $(x_1;x_2;...;x_j;..;x_n)$.
\nDans le cas où la matrice $A$ n'est pas inversible, on admet que le système a :
\n\n
\n\n"},{"metadata":{},"cell_type":"markdown","source":"Exercice :- soit une infinité de solutions ;
\n- soit aucune solution.
\n
\n\n
\n"},{"metadata":{"trusted":false},"cell_type":"code","source":"#Zone de saisie pour l'exercice n°37 p197\nfrom numpy import*\nfrom numpy.linalg import*\n\nA=array([[3,-2,1],\n [-1,1,-2],\n [2,-2,3]])\nB=array([[17],[-12],[20]])\n\nX=dot(inv(A),B)\nX","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"#Zones de saisies pour vérification des résolutions du n°44 p198\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"cell_type":"code","source":"\n","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.10"}},"nbformat":4,"nbformat_minor":2}- Dans le manuel : n°34 (sans calculatrice, en justifiant), 35,36 p197
\n- Dans le manuel : n°37 p197(effectuer la résolution du système)
\n- Résoudre les systèmes de l'exercice du manuel n°44 p198 puis effectuer des saisies Python pour vérifier les résultats.
\n