Demandes associées au chapitre-notebook: "calcul matriciel élémentaire"

Pour accéder au code relatif à un exemple, double-cliquer sur le triangle du crochet icônique à droite.

Exemple 1

matrice = {{a, b}, {c, d}}; autreMatrice={{a',b'},{c',d'}};

MatrixForm[matrice]

MatrixForm[x matrice]

MatrixForm[matrice + autreMatrice]

MatrixForm[matrice.autreMatrice]

MatrixForm[matrice autreMatrice]

MatrixForm[matrice  * autreMatrice]

MatrixForm[Inverse[matrice]]

Det [%]

Inverse[matrice] /. {a -> 1, b -> 2, c -> 2, d -> 4}

Clear[matrice]

Exemple 2

matrice = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}

MatrixForm[%]

Det[matrice]

MatrixForm[Inverse[matrice]]

Exemple 3

matrice = {{4, 5, 6}, {1, 2, 3}, {-2, 1, 0}};

MatrixForm[%]

MatrixForm[Inverse[matrice]]

MatrixForm[matrice.Inverse[matrice]]

MatrixForm[Inverse[Inverse[matrice]]]

Clear[matrice]

Exemple 4

matrice = {{4., 5, 6}, {1, 2, 3}, {-2, 1, 0}};

MatrixForm[%]

MatrixForm[Inverse[matrice]]

Inverse[matrice].matrice

MatrixForm[Inverse[Inverse[matrice]]]

Exemple 5

matrice = {{4.3, 5, 6}, {1.23, 2, 3}, {-2, 1, 0}};

MatrixForm[%]

MatrixForm[Inverse[matrice]]

MatrixForm[Inverse[matrice].matrice]

matriceExacte = {{(43/10), 5, 6}, {(123/100), 2, 3}, {-2, 1, 0}};

MatrixForm[%]

MatrixForm [Inverse[matriceExacte]]

MatrixForm[matriceExacte.Inverse[matriceExacte]]

Clear[matrice,  matriceExacte]

matrice[1]=(({{-16483, -21528, -26788, -32226, -37820, -43554}, {-47335, 53028, 58997, -65201, -71609, -78199}, {13289, 7430, 1274, -5133, -11757, -18563}, {-85608, -91692, -98037, -104606, -111371, -118310}, {-68268, -59946, -77749, -82762, -87920, -93207}, {-107048, -11260, -117801, -123515, -129433, -135492}}));

matrice[2]=(({{-26942, -31529, -36367, -41415, -46677, -52135}, {16596, 11045, 5296, -754, -6954, -12954}, {4500, -5500, -14800, -24800, -35400, -46600}, {-12626, -17638, -22831, -28173, -33645, -39228}, {14319, 9539, 4489, -611, -5911, -11211}, {-7336, -10576, -13926, -17496, -21176, -24976}}));

MatrixForm [Inverse[matrice[1]]]

MatrixForm [N[%]]

res =  N [Inverse[matrice[1]]];

res

{{-140.8028787298747931, -0.02269990013728100089, 
        71.55208138040796616, -355.7246563584963991, 
        618.4246036107219866, -79.33778770660678362}, {
        -0.4283124521313105098, -0.00006904573616833410412, 
        0.2176600061671704331, -1.082081433411509426, 
        1.881173147051584489, -0.2413260855043309903}, {
        0.5079121980816604164, 0.0000903513371465061003, 
        -0.2581134892131766613, 1.283147911202287023, 
        -2.230741587634640458, 0.2861732738842248725}, {
        2403.306791338446736, 0.3874057870935083603, 
        -1221.297994774171944, 6071.440577769360632, 
        -10555.20141681345309, 1354.128359186754826}, {
        -4083.353081922235891, -0.6582352916491863411, 
        2075.055301708594764, -10315.64193448601003, 
        17933.76008426512413, -2300.724743889406649}, {
        1820.726374368323791, 0.2935011336329242096, 
        -925.2469745346828693, 4599.615775742199933, 
        -7996.44393304523937, 1025.864979653325175}}

resApproché = {{-140.803, -0.0226999, 71.5521, 
          -355.725, 618.425, -79.3378}, {-0.428312, 
          -0.0000690457, 0.21766, -1.08208, 1.88117, -0.241326}, {
          0.507912, 0.0000903513, -0.258113, 1.28315, -2.23074, 
          0.286173}, {2403.31, 0.387406, -1221.3, 6071.44, -10555.2, 
          1354.13}, {-4083.35, -0.658235, 2075.06, -10315.6, 
          17933.8, -2300.72}, {1820.73, 0.293501, -925.247, 4599.62, 
          -7996.44, 1025.86}};

Max[res - resApproché]

Min[Abs[matrice[1]]]

Min[Abs[matrice[2]]]

MatrixForm [matrice[1].Inverse[matrice[1]]]

MatrixForm [matrice[1].res]

MatrixForm[matrice[1].resApproché]

MatrixForm[
      matrice[1].Inverse[matrice[1]] - matrice[1].resApproché]

Max[%]

Min[%%]

MatrixForm [matrice[2].Inverse[matrice[1]]]

MatrixForm [matrice[2].Inverse[matrice[1]] - matrice[2].res]

{Min[%], Max[%]}

MatrixForm[
      matrice[2].Inverse[matrice[1]] - matrice[2].resApproché]

{Min[%], Max[%]}

MatrixForm [Inverse[matrice[1]].matrice[2]

MatrixForm [Inverse[matrice[1]].matrice[2] - res.matrice[2]]

{Min[%], Max[%]}

MatrixForm[
      Inverse[matrice[1]].matrice[2] - resApproché.matrice[2]]

{Min[%], Max[%]}

Exemple 6

Det[{{7, 8, 9}, {1, 2, 3}, {4, 5, 6}}]

MatrixForm [Inverse[{{7, 8, 9}, {1, 2 a, 3}, {4, 5, 6}}]]

MatrixForm[Simplify/@%]

MatrixForm[% /. a -> (1/10)]

MatrixForm[%% /. a -> 1]

Clear[matrice]

Exemple 7

?Eigensystem

MatrixForm[
      Eigensystem[{{2, -1, 0}, {-1, 2, -1}, {0, -1, 2}}]]

CharacteristicPolynomial[{{2, -1, 0}, {-1, 2, -1}, {0, 
          -1, 2}}, x]

Simplify[Solve[% == 0]]

Max[N[x /. %]]

Eigenvalues [{{2, -1, 0}, {-1, 2, -1}, {0, -1, 2}}]

Select[%, N[#1] == Max[N[%]]&]

With[{
        vP = Simplify[
            Eigenvalues[{{2, -1, 0}, {-1, 2, -1}, {0, -1, 
                  2}}]]}, Select[vP, N[#1] == Min[Abs[N[vP]]]&]]

Exemple 8

MatrixForm [
      Eigenvalues[{{8, -5 I, 3 - 2 I}, {5 I, 3, 0}, {3 + 2 I, 0, 2}}]]

Exemple 9

MatrixForm[
      Eigensystem[{{2, 1, 0}, {-2, 2, -1}, {0, -1, 2}}]]