diff --git a/QUESTION13.ipynb b/QUESTION13.ipynb index 31c0410..42b8def 100644 --- a/QUESTION13.ipynb +++ b/QUESTION13.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 9, "id": "349bd8d2-2bc8-45e3-9f8a-7d60f7dedd39", "metadata": { "tags": [] @@ -15,14 +15,164 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "885fccca-d36b-4d94-ba40-03eb06df2c57", "metadata": {}, "outputs": [], "source": [ - "def getA():\n", - " pass" + "def getA(n):\n", + " A = np.zeros((n, n))\n", + " for i in range(n):\n", + " if i-1>=0:\n", + " A[i,i-1] = 1\n", + " A[i,i] = 2\n", + " if i+1" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "A = getA(100)\n", + "\n", + "n = np.arange(0,100,1)\n", + "\n", + "D = algoQR(A)\n", + "D = np.diag(D)\n", + "sorted(D)\n", + "\n", + "plt.scatter(n, D, s=2)\n", + "\n", + "plt.title(\"Les 100 valeurs propres\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3acd9be1-2873-4969-aa8c-4fe6d021df4e", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {