Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 32
m= Matrix([[1/3,1/2],[2/3,1/2]]) i= Matrix([[1,0],[0,1]]) #Comme l'espace propre est 1, je créé la matrice identité de diagonal 1. show("M =",m," , I =",i)
M = (13122312)\displaystyle \left(\begin{array}{rr} \frac{1}{3} & \frac{1}{2} \\ \frac{2}{3} & \frac{1}{2} \end{array}\right) , I = (1001)\displaystyle \left(\begin{array}{rr} 1 & 0 \\ 0 & 1 \end{array}\right)
show("valeurs propres de M =",m.eigenvalues()) #Valeur Propre show(m-i)
valeurs propres de M = [1\displaystyle 1, 16\displaystyle -\frac{1}{6}]
(23122312)\displaystyle \left(\begin{array}{rr} -\frac{2}{3} & \frac{1}{2} \\ \frac{2}{3} & -\frac{1}{2} \end{array}\right)
show("noyau = ",(m-i).right_kernel()) #Noyau
noyau = RowSpanQ(143)\displaystyle \mathrm{RowSpan}_{\Bold{Q}}\left(\begin{array}{rr} 1 & \frac{4}{3} \end{array}\right)
var('x,y') show(1/3*x+1/2*y==x);show(2/3*x+1/2*y==y) #Système linéaire associé à m S=solve([1/3*x+1/2*y==x,2/3*x+1/2*y==y],[x,y]);show(S) #solution du système linéaire associé à m
(x, y)
13x+12y=x\displaystyle \frac{1}{3} \, x + \frac{1}{2} \, y = x
23x+12y=y\displaystyle \frac{2}{3} \, x + \frac{1}{2} \, y = y
[[x=34r2\displaystyle x = \frac{3}{4} \, r_{2}, y=r2\displaystyle y = r_{2}]]
k=2 ; show("M^2 =",(m^k).n(digits=3)) k=16 ; show("M^16 =",(m^k).n(digits=3)) k=128 ; show("M^128 =",(m^k).n(digits=3)) #la matrice m
M^2 = (0.4440.4170.5560.583)\displaystyle \left(\begin{array}{rr} 0.444 & 0.417 \\ 0.556 & 0.583 \end{array}\right)
M^16 = (0.4290.4290.5710.571)\displaystyle \left(\begin{array}{rr} 0.429 & 0.429 \\ 0.571 & 0.571 \end{array}\right)
M^128 = (0.4290.4290.5710.571)\displaystyle \left(\begin{array}{rr} 0.429 & 0.429 \\ 0.571 & 0.571 \end{array}\right)
I? #un imaginaire
File: /ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx Signature : I(SR, x=0) Docstring : Nearly all expressions are created by calling new_Expression_from_*, but we need to make sure this at least does not leave self._gobj uninitialized and segfault.
#Avec N : N=matrix([[1/2,0,0],[1/4,0,1],[1/4,1,0]]);show("N =",N)
N = (120014011410)\displaystyle \left(\begin{array}{rrr} \frac{1}{2} & 0 & 0 \\ \frac{1}{4} & 0 & 1 \\ \frac{1}{4} & 1 & 0 \end{array}\right)
#espace propre pour la valeur propre 1 #valeurs propres -> eigenvalue I=matrix.identity(3) show((N-I).right_kernel().basis())
[(0,1,1)\displaystyle \left(0,\,1,\,1\right)]
var('x y z') c=['gray','darkkhaki','aquamarine'] show(sum(implicit_plot3d((N-I)[k]*vector([x,y,z])==0,(x,-1,1),(y,-1,1),(z,-1,1),color=c[k]) for k in range(3)))
(x, y, z)
3D rendering not yet implemented
show((N^16).n(digits=3)) show((N^17).n(digits=3))
(0.00001530.0000.0000.5001.000.0000.5000.0001.00)\displaystyle \left(\begin{array}{rrr} 0.0000153 & 0.000 & 0.000 \\ 0.500 & 1.00 & 0.000 \\ 0.500 & 0.000 & 1.00 \end{array}\right)
(7.63×1060.0000.0000.5000.0001.000.5001.000.000)\displaystyle \left(\begin{array}{rrr} 7.63 \times 10^{-6} & 0.000 & 0.000 \\ 0.500 & 0.000 & 1.00 \\ 0.500 & 1.00 & 0.000 \end{array}\right)
show("valeurs propres de N =",N.eigenvalues()) #Valeur Propre show((N-I).right_kernel())
valeurs propres de N = [1\displaystyle 1, 12\displaystyle \frac{1}{2}, 1\displaystyle -1]
RowSpanQ(011)\displaystyle \mathrm{RowSpan}_{\Bold{Q}}\left(\begin{array}{rrr} 0 & 1 & 1 \end{array}\right)
var('x,y') show(1/2*x+0*y+0*z==x);show(1/4*x+0*y+1*z==y);show(1/4*x+1*y+0*z==x) #Système linéaire associé à N T=solve([1/2*x+0*y+0*z==x,1/4*x+0*y+1*z==y,1/4*x+1*y+0*z==z],[x,y,z]);show(T) #solution du système linéaire associé à N
(x, y)
12x=x\displaystyle \frac{1}{2} \, x = x
14x+z=y\displaystyle \frac{1}{4} \, x + z = y
14x+y=x\displaystyle \frac{1}{4} \, x + y = x
[[x=0\displaystyle x = 0, y=r5\displaystyle y = r_{5}, z=r5\displaystyle z = r_{5}]]
#r5 étant le paramètre r* qui est créé par Sage et change à chaque exécution #partie sur feuille : M= Matrix([[1/2,0,0],[-1/4,-1/2,-9/4],[1/6,2/3,2]]); show("M =",M) i=Matrix.identity(3) show("determinant M =",(M-1/2*i).determinant());show("Identitée =",i) show(M.rank())
M = (120014129416232)\displaystyle \left(\begin{array}{rrr} \frac{1}{2} & 0 & 0 \\ -\frac{1}{4} & -\frac{1}{2} & -\frac{9}{4} \\ \frac{1}{6} & \frac{2}{3} & 2 \end{array}\right)
determinant M = 0\displaystyle 0
Identitée = (100010001)\displaystyle \left(\begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right)
3\displaystyle 3
show("valeurs propres =",M.eigenvalues()) #multiplicité =2
valeurs propres = [1\displaystyle 1, 12\displaystyle \frac{1}{2}, 12\displaystyle \frac{1}{2}]
show((M-1/2*i).rank()) #d'après le thml des rangs c'est juste car 3-2 = 1
1\displaystyle 1
var('x y z') c=['gray','darkkhaki','aquamarine'] show(sum(implicit_plot3d((M-I)[k]*vector([x,y,z])==0,(x,-2,2),(y,-2,2),(z,-2,2),color=c[k]) for k in range(3)))
(x, y, z)
3D rendering not yet implemented
k=2 ; show("M^2 =",(M^k).n(digits=3)) k=16 ; show("M^16 =",(M^k).n(digits=3)) k=128 ; show("M^128 =",(M^k).n(digits=3)) #la matrice M tend vers M=([0,0,0],[-1/2,-2,-9/2],[1/6,2/3,3])
M^2 = (0.2500.0000.0000.3751.253.380.2501.002.50)\displaystyle \left(\begin{array}{rrr} 0.250 & 0.000 & 0.000 \\ -0.375 & -1.25 & -3.38 \\ 0.250 & 1.00 & 2.50 \end{array}\right)
M^16 = (0.00001530.0000.0000.5002.004.500.3331.333.00)\displaystyle \left(\begin{array}{rrr} 0.0000153 & 0.000 & 0.000 \\ -0.500 & -2.00 & -4.50 \\ 0.333 & 1.33 & 3.00 \end{array}\right)
M^128 = (2.94×10390.0000.0000.5002.004.500.3331.333.00)\displaystyle \left(\begin{array}{rrr} 2.94 \times 10^{-39} & 0.000 & 0.000 \\ -0.500 & -2.00 & -4.50 \\ 0.333 & 1.33 & 3.00 \end{array}\right)
f=Matrix([[2,2,-1],[0,4,0],[-4,4,2]]);show("f =",f)
f = (221040442)\displaystyle \left(\begin{array}{rrr} 2 & 2 & -1 \\ 0 & 4 & 0 \\ -4 & 4 & 2 \end{array}\right)
f.right_kernel()
Free module of degree 3 and rank 1 over Integer Ring Echelon basis matrix: [1 0 2]