From 43da0d4a8e4a23c83aee8e24c2cde1d9bcfd8dc3 Mon Sep 17 00:00:00 2001 From: s487174 Date: Wed, 14 Jun 2023 19:37:51 +0200 Subject: [PATCH] Zadanie 7 + 9 --- Wrzodak_Koszarek_Zadania.ipynb | 48 ++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/Wrzodak_Koszarek_Zadania.ipynb b/Wrzodak_Koszarek_Zadania.ipynb index 8e38856..97919eb 100644 --- a/Wrzodak_Koszarek_Zadania.ipynb +++ b/Wrzodak_Koszarek_Zadania.ipynb @@ -51,7 +51,39 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "zb1=[(1,1),(2,3),(4,5)]\n", + "zb2=[(1,1),(2,3),(3,4),(4,5),(5,7),(6,9)]\n", + "\n", + "m1=matrix(3,2,[1,exp(1.0),1,exp(2.0),1,exp(4.0)])\n", + "m2=matrix(6,2,[1,exp(1.0),1,exp(2.0),1,exp(3.0),1,exp(4.0),1,exp(5.0),1,exp(6.0)])\n", + "\n", + "a,b,t=var('a,b,t')\n", + "\n", + "m1*vector([a,b])-vector([1,3,5])\n", + "m2*vector([a,b])-vector([1,3,4,5,7,9])\n", + "\n", + "\n", + "\n", + "M1=m1.transpose()*m1\n", + "M1.det()\n", + "\n", + "\n", + "\n", + "M2=m2.transpose()*m2\n", + "M2.det()\n", + "\n", + "\n", + "\n", + "M1^(-1)*m1.transpose()*vector([1,3,5])\n", + "\n", + "M2^(-1)*m2.transpose()*vector([1,3,4,5,7,9])\n", + "\n", + "\n", + "plot(1.64148598265947+ 0.0629860338045423*exp(t),(t,0,4))+sum([point(x) for x in zb1])\n", + "\n", + "plot(3.10041190358990+ 0.0163320609303546*exp(t),(t,0,6))+sum([point(x) for x in zb2])" + ] }, { "attachments": {}, @@ -66,7 +98,19 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "m=matrix(3,3,[1,1,0,1,2,2,0,2,3])\n", + "\n", + "eigenvalues = np.m.eigvals(matrix)\n", + "\n", + "eigen=m.right_eigenvectors()\n", + "e1=eigen[0][1][0]\n", + "e2=eigen[1][1][0]\n", + "print(e1.dot_product(e2))\n", + "e3=eigen[2][1][0]\n", + "print(e3.dot_product(e1))\n", + "print(e2.dot_product(e3))" + ] } ], "metadata": {