{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![En tête general](img/En_tete_general.png)\n",
"\n",
"\n",
"*(C) Copyright Franck CHEVRIER 2019-2021 http://www.python-lycee.com/*\n",
"\n",
" Pour exécuter une saisie Python, sélectionner la cellule et valider avec SHIFT+Entrée.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Résolution matricielle de systèmes (corrigé)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Sommaire\n",
"\n",
"I. Football
\n",
"II. Volleyball
\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## I. Football"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"Un joueur de foot, situé à $18 m$ du but, effectue un tir en cloche.
\n",
"On modélise la situation dans un repère orthonormé (l'unité choisie est le mètre).
\n",
"On suppose que :\n",
"
\n", " Le module sympy permet :\n", "\n", " " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from sympy import Matrix # import des fonctionnalités pour le calcul matriciel\n", "\n", "# Compléter les saisies de A et B\n", "\n", "A = Matrix([[ 324 , -18 , 1 ],\n", " [ 196 , -14 , 1 ],\n", " [ -36 , 1 , 0 ]])\n", "\n", "B = Matrix([[ 0 ],\n", " [ 3.2],\n", " [ 1 ]]) \n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}- \\frac{1}{16} & \\frac{1}{16} & - \\frac{1}{4}\\\\- \\frac{9}{4} & \\frac{9}{4} & -8\\\\- \\frac{77}{4} & \\frac{81}{4} & -63\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[-1/16, 1/16, -1/4],\n", "[ -9/4, 9/4, -8],\n", "[-77/4, 81/4, -63]])" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Calcul de la matrice U, inverse de A\n", "U = A**-1\n", "U" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-0.05\\\\-0.8\\\\1.8\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[-0.05],\n", "[ -0.8],\n", "[ 1.8]])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Calcul du produit de U par B\n", "U*B" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "3. a. À quelle hauteur maximale le ballon va-t-il s'élever ?\n", "
\n", "- de créer des matrices avec la syntaxe Matrix ;
\n", "- de multiplier des matrices avec la syntaxe * ;
\n", "- de calculer l'inverse d'une matrice avec la syntaxe **-1.
\n", "