Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: MMC_CRAR
Views: 119
"Caso de Matriz con eigenvalores Reales" "Resolviendo el sistema de ecuaciones de forma computacional" x,y=var('x,y') A=matrix(2, 2, [1,2, 2,1]) v=vector([x,y]) d=A*v show(d) show(A) t=[0,0.1..1] matrix(2, 2, [1,2, 2,1]).charpoly() matrix(2, [1,2, 2,1]).right_eigenvectors() r=desolve_odeint( d, [90,50], t, [x,y]) p1=line(zip(t, r[:,0]), color='blue') v1=line(zip(t, r[:,1]), color='red') show(p1+v1)
(x+2y,2x+y)\displaystyle \left(x + 2 \, y,\,2 \, x + y\right)
(1221)\displaystyle \left(\begin{array}{rr} 1 & 2 \\ 2 & 1 \end{array}\right)
x^2 - 2*x - 3 [(3, [ (1, 1) ], 1), (-1, [ (1, -1) ], 1)]
"Resolviendo el sistema de ecuaciones de forma analitica" x,y,t=var('x,y,t') A=matrix(2, 2, [1,2, 2,1]) P=matrix(2,2, [1,1, 1,-1]) G=matrix(2,2, [exp(3),0, 0,exp(-1)]) Q=matrix(2,2, [1/2,1/2, 1/2,-1/2]) A.right_eigenvectors() c=vector([90,50]) P*G*Q*c P*G h=plot(70*e^(3*t) + 20*e^(-1*t), (t, 0, 1)) g=plot(70*e^(3*t) - 20*e^(-1*t), (t, 0, 1), color='red') show(h+g)
[(3, [ (1, 1) ], 1), (-1, [ (1, -1) ], 1)] (70*e^3 + 20*e^(-1), 70*e^3 - 20*e^(-1)) [ e^3 e^(-1)] [ e^3 -e^(-1)]
"Graficando trayectorias del sistema" b=[] c=[] d=[] for k in range (-4,4): b.append(parametric_plot([k*e^(3*x) + 1*e^(-1*x), k*1*e^(3*x) -1*e^(-1*x)], (x,-2,0.5), color='green', thickness=1.5, fill = False, aspect_ratio=1/2)) c.append(parametric_plot([k*e^(3*x) -1*e^(-1*x), k*1*e^(3*x) +1*1*e^(-1*x)], (x,-2,0.5), color='red', thickness=1.5, fill = False, aspect_ratio=1/2)) d.append(parametric_plot([k*e^(3*x) -0*e^(-1*x), k*1*e^(3*x) +0*1*e^(-1*x)], (x,-2,0.5), color='blue', thickness=1.5, fill = False, aspect_ratio=1/2)) sum (b+c+d)
"Caso de Matriz con eigenvalores Reales" "Resolviendo el sistema de ecuaciones de forma computacional" x,y=var('x,y') A=matrix(2, 2, [1,3, 3,2]) v=vector([x,y]) d=A*v show(d) show(A) t=[0,0.1..1] r=desolve_odeint( d, [9,50], t, [x,y]) p1=line(zip(t, r[:,0]), color='blue') v1=line(zip(t, r[:,1]), color='red') show(p1+v1)
(x+3y,3x+2y)\displaystyle \left(x + 3 \, y,\,3 \, x + 2 \, y\right)
(1332)\displaystyle \left(\begin{array}{rr} 1 & 3 \\ 3 & 2 \end{array}\right)
"Resolviendo el sistema de ecuaciones de forma analitica" t,x=var('t,x') matrix(2, 2, [1,3, 3,2]).right_eigenvectors() B=matrix(2,2, [1, 1, -0.8471270883830366, 1.180460421716370]) C=B.inverse() G=matrix(2,2, [exp(-1.541381265149110*x),0, 0,exp(4.541381265149110*x)]) c=vector([90,50]) B*G*C*c show(B) a=plot(62.2618936670625*e^(4.54138126514911*x) + 27.7381063329375*e^(-1.54138126514911*x), (x, 0, 1)) b=plot(73.4977012550804*e^(4.54138126514911*x) - 23.4977012550804*e^(-1.54138126514911*x), (x, 0, 1), color='red') show(a+b)
[(-1.541381265149110?, [(1, -0.8471270883830366?)], 1), (4.541381265149110?, [(1, 1.180460421716370?)], 1)] (62.2618936670625*e^(4.54138126514911*x) + 27.7381063329375*e^(-1.54138126514911*x), 73.4977012550804*e^(4.54138126514911*x) - 23.4977012550804*e^(-1.54138126514911*x))
(1.000000000000001.000000000000000.8471270883830371.18046042171637)\displaystyle \left(\begin{array}{rr} 1.00000000000000 & 1.00000000000000 \\ -0.847127088383037 & 1.18046042171637 \end{array}\right)
"Graficando trayectorias del sistema" b=[] c=[] d=[] for k in range (-4,4): b.append(parametric_plot([k*e^(4.54138126514911*x) + 1*e^(-1.54138126514911*x), k*1.180460421716370*e^(4.54138126514911*x) -1*23.4977012550804*e^(-1.54138126514911*x)], (x,-2,0.5), color='green', thickness=1.5, fill = False, aspect_ratio=1/20)) c.append(parametric_plot([k*e^(4.54138126514911*x) -1*e^(-1.54138126514911*x), k*1.180460421716370*e^(4.54138126514911*x) +1*23.4977012550804*e^(-1.54138126514911*x)], (x,-2,0.5), color='red', thickness=1.5, fill = False, aspect_ratio=1/20)) d.append(parametric_plot([k*e^(4.54138126514911*x) -0*e^(-1.54138126514911*x), k*1.180460421716370*e^(4.54138126514911*x) +0*23.4977012550804*e^(-1.54138126514911*x)], (x,-2,0.5), color='blue', thickness=1.5, fill = False, aspect_ratio=1/20)) sum (b+c+d)
"Caso de Matriz con eigenvalores Reales" x,y,t=var('x,y,t') A=matrix(2, 2, [1,3, 4,1]) A.right_eigenvectors() P=matrix(2,2, [1,1, -1.154700538379252,1.154700538379252]) G=matrix(2,2, [exp(-2.464101615137755*t),0, 0,exp(4.464101615137755*t)]) P*G show(A) v=vector([x,y]) d=A*v show(d)
'Caso de Matriz con eigenvalores Reales' [(-2.464101615137755?, [(1, -1.154700538379252?)], 1), (4.464101615137755?, [(1, 1.154700538379252?)], 1)] [ 1.00000000000000*e^(-2.46410161513776*t) 1.00000000000000*e^(4.46410161513775*t)] [-1.15470053837925*e^(-2.46410161513776*t) 1.15470053837925*e^(4.46410161513775*t)]
(1341)\displaystyle \left(\begin{array}{rr} 1 & 3 \\ 4 & 1 \end{array}\right)
(x+3y,4x+y)\displaystyle \left(x + 3 \, y,\,4 \, x + y\right)
"Graficando trayectorias del sistema" b=[] c=[] d=[] for k in range (-4,4): b.append(parametric_plot([k*e^(-2.46410161513776*x) + 1*e^(4.46410161513775*x), k*(-1.15470053837925)*e^(-2.46410161513776*x) +1*1.15470053837925*e^(4.46410161513775*x)], (x,-.8,0.7), color='green', thickness=1.5, fill = False, aspect_ratio=1/2)) c.append(parametric_plot([k*e^(-2.46410161513776*x) -1*e^(4.46410161513775*x), k*(-1.15470053837925)*e^(-2.46410161513776*x) -1.15470053837925*e^(4.46410161513775*x)], (x,-.8,0.7), color='red', thickness=1.5, fill = False, aspect_ratio=1/2)) d.append(parametric_plot([k*e^(-2.46410161513776*x) -0*e^(4.46410161513775*x), k*(-1.15470053837925)*e^(-2.46410161513776*x) -0*1.15470053837925*e^(4.46410161513775*x)], (x,-.8,0.7), color='blue', thickness=1.5, fill = False, aspect_ratio=1/2)) sum (b+c+d)
'Graficando trayectorias del sistema'
"Caso de Matriz con eigenvalores Reales" x,y,t=var('x,y,t') A=matrix(2, 2, [1,5, 4,1]) A.right_eigenvectors() P=matrix(2,2, [1,1, 2,-3]) G=matrix(2,2, [exp(3*t),0, 0,exp(-1*t)]) P*G show(A) v=vector([x,y]) d=A*v show(d)
[(-3.472135954999580?, [(1, -0.8944271909999159?)], 1), (5.472135954999579?, [(1, 0.8944271909999159?)], 1)] [ e^(3*t) e^(-t)] [2*e^(3*t) -3*e^(-t)]
(1541)\displaystyle \left(\begin{array}{rr} 1 & 5 \\ 4 & 1 \end{array}\right)
(x+5y,4x+y)\displaystyle \left(x + 5 \, y,\,4 \, x + y\right)
"Graficando trayectorias del sistema" b=[] c=[] d=[] for k in range (-4,4): b.append(parametric_plot([k*e^(3*x) + 1*e^(-1*x), k*2*e^(3*x) +1*(-3)*e^(-1*x)], (x,-2,0.5), color='green', thickness=1.5, fill = False, aspect_ratio=1/2)) c.append(parametric_plot([k*e^(3*x) - 1*e^(-1*x), k*2*e^(3*x) -1*(-3)*e^(-1*x)], (x,-2,0.5), color='red', thickness=1.5, fill = False, aspect_ratio=1/2)) d.append(parametric_plot([k*e^(3*x) -0*e^(-1*x), k*2*e^(3*x) -0*(-3)*e^(-1*x)], (x,-2,0.5), color='blue', thickness=1.5, fill = False, aspect_ratio=1/2)) sum (b+c+d)
"Caso de Matriz con eigenvalores Reales" x,y,t=var('x,y,t') A=matrix(2, 2, [3,5, 4,2]) A.right_eigenvectors() P=matrix(2,2, [1,1, 4/5,-1]) G=matrix(2,2, [exp(7*t),0, 0,exp(-2*t)]) P*G show(A) v=vector([x,y]) d=A*v show(d)
[(7, [ (1, 4/5) ], 1), (-2, [ (1, -1) ], 1)] [ e^(7*t) e^(-2*t)] [4/5*e^(7*t) -e^(-2*t)]
(3542)\displaystyle \left(\begin{array}{rr} 3 & 5 \\ 4 & 2 \end{array}\right)
(3x+5y,4x+2y)\displaystyle \left(3 \, x + 5 \, y,\,4 \, x + 2 \, y\right)
"Graficando trayectorias del sistema" b=[] c=[] d=[] for k in range (-4,4): b.append(parametric_plot([k*exp(7*x) + 1*exp(-2*x), k*4/5*exp(7*x) -1*exp(-2*x)], (x,-.9,0.2), color='green', thickness=1.5, fill = False, aspect_ratio=1)) c.append(parametric_plot([k*exp(7*x) - 1*exp(-2*x), k*4/5*exp(7*x) +1*exp(-2*x)], (x,-.9,0.2), color='red', thickness=1.5, fill = False, aspect_ratio=1)) d.append(parametric_plot([k*exp(7*x) -0*exp(-2*x), k*4/5*exp(7*x) -0*(-3)*exp(-2*x)], (x,-.5,0.2), color='blue', thickness=1.5, fill = False, aspect_ratio=1)) sum (b+c+d)
'Graficando trayectorias del sistema'
"Caso de Matriz no diagonalizable" x,y,t=var('x,y,t') A=matrix(2, 2, [3,1, 0,3]) A.right_eigenvectors() show(A) v=vector([x,y]) d=A*v show(d) "Graficando trayectorias del sistema" b=[] c=[] g=[] f=[] for k in range (-4,4): b.append(parametric_plot([k*exp(3*x) + 1*x*exp(3*x), 1*exp(3*x)], (x,-.9,0.2), color='green', thickness=1.5, fill = False, aspect_ratio=1)) c.append(parametric_plot([k*exp(3*x) - 1*x*exp(3*x), -1*exp(3*x)], (x,-.9,0.2), color='red', thickness=1.5, fill = False, aspect_ratio=1)) g.append(parametric_plot([k*exp(3*x) + 0*x*exp(3*x), 0*exp(3*x)], (x,-.9,0.2), color='blue', thickness=1.5, fill = False, aspect_ratio=1)) f.append(parametric_plot([1*exp(3*x) + k*x*exp(3*x), k*exp(3*x)], (x,-.9,0.2), color='black', thickness=1.5, fill = False, aspect_ratio=1)) sum (b+c+g+f)
'Graficando trayectorias del sistema'
"Caso de matriz de entradas reales con eigenvalores complejos" x,y,t=var('x,y,t') A=matrix(2, 2, [1,1, -1,1]) matrix(2, 2, [1,1, -1,1]).right_eigenvectors() P=matrix(2,2, [1,-1*I, 1,+1*I]) Q=P.inverse() G=matrix(2,2, [exp(1*x)*(sin(x)+cos(x)),0, 0,exp(1*x)*(sin(x)+cos(x))]) G1=matrix(2,2, [exp(1-I),0, 0,exp(1+I)]) c=vector([90,50]) P*G1*Q*c V=matrix(2, 2, [1,0, 0,1]) V1=V.inverse() F=V1*A*V show(F) v=vector([x,y]) d=F*v show(d) h=plot(exp(1*x)*(50*sin(x)+90*cos(x)) , (x, 0, 5)) g=plot(exp(1*x)*(-90*sin(x)+50*cos(x)), (x, 0, 5), color='red') "Graficando las soluciones del sistema" show(h+g)
'Caso de matriz de entradas reales con eigenvalores complejos' [(1 - 1*I, [(1, -1*I)], 1), (1 + 1*I, [(1, 1*I)], 1)] (20*e^(I + 1) + 70*e^(-I + 1), -20*e^(I + 1) + 70*e^(-I + 1))
(1111)\displaystyle \left(\begin{array}{rr} 1 & 1 \\ -1 & 1 \end{array}\right)
(x+y,x+y)\displaystyle \left(x + y,\,-x + y\right)
'Graficando las soluciones del sistema'
"Graficando las trayectorias del sistema" b=[] c=[] g=[] f=[] var('x') for k in range (-4,4): b.append(parametric_plot([ exp(1*x)*(1*sin(x)+k*cos(x)), exp(1*x)*(-k*sin(x)+1*cos(x)) ], (x,-.9,0.2), color='green', thickness=1.5, fill = False, aspect_ratio=1)) c.append(parametric_plot([ exp(1*x)*(-1*sin(x)+k*cos(x)), exp(1*x)*(-k*sin(x)-1*cos(x)) ], (x,-.9,0.2), color='red', thickness=1.5, fill = False, aspect_ratio=1)) g.append(parametric_plot([ exp(1*x)*(0*sin(x)+k*cos(x)), exp(1*x)*(-k*sin(x)-0*cos(x)) ], (x,-.9,0.2), color='blue', thickness=1.5, fill = False, aspect_ratio=1)) f.append(parametric_plot([ exp(1*x)*(k*sin(x)+0*cos(x)), exp(1*x)*(0*sin(x)+k*cos(x)) ], (x,-.9,0.2), color='black', thickness=1.5, fill = False, aspect_ratio=1)) sum (b+c+g+f)
'Graficando las trayectorias del sistema' x
"Graficando la soluciones para el caso de eigenvalores complejos" "a+-ib" "g y c son condiciones iniciales" var('a') var('b') A=matrix(2, 2, [a,-b, b,a]) show(A) @interact def interactive_function(a = slider(-10, 10, .5, default=4),b = (-10, 10, .5), c=(-10, 10, 0.5), g=(-10,10,0.5)): f(x) = exp(b*x)*(c*cos(a*x)+g*sin(a*x)) d(x) = exp(b*x)*(-c*sin(a*x)+g*cos(a*x)) plot(f, (x, -5, 5)).show() plot(d, (x, -5, 5), color='red').show()
'Graficando la soluciones para el caso de eigenvalores complejos' 'a+-ib' 'g y c son condiciones iniciales' a b
(abba)\displaystyle \left(\begin{array}{rr} a & -b \\ b & a \end{array}\right)
Interact: please open in CoCalc
"Graficando la trayectorias para el caso de eigenvalores complejos" "a+-ib" "g y c son condiciones iniciales" var('a') var('b') A=matrix(2, 2, [a,-b, b,a]) show(A) @interact def interactive_function(a = slider(-10, 10, .1, default=4),b = (-10, 10, .1), c=(-10, 10, 0.2), g=(-10,10,0.2)): f(x) = exp(b*x)*(c*cos(a*x)+g*sin(a*x)) d(x) = exp(b*x)*(-c*sin(a*x)+g*cos(a*x)) parametric_plot([f, d], (x,0,1/2*pi)).show()
'Graficando la trayectorias para el caso de eigenvalores complejos' 'a+-ib' 'g y c son condiciones iniciales' a b
(abba)\displaystyle \left(\begin{array}{rr} a & -b \\ b & a \end{array}\right)
Interact: please open in CoCalc
"Graficando la trayectorias para el caso de matrices de rotacion" "g y c son condiciones iniciales" "o es el angulo de rotacion y r el radio" @interact def interactive_function(o = slider(-pi, pi, 1/10*pi, default=0),r = (0, 10, .1),c=(-10, 10, 0.1), g=(-10,10,0.1)): a=r*cos(o) b=r*sin(o) f(x) = exp(b*x)*(c*cos(a*x)+g*sin(a*x)) d(x) = exp(b*x)*(-c*sin(a*x)+g*cos(a*x)) parametric_plot([f, d], (x,0,3*pi)).show()
'Graficando la trayectorias para el caso de matrices de rotacion' 'g y c son condiciones iniciales' 'o es el angulo de rotacion y r el radio'
Interact: please open in CoCalc
A=matrix(2, 2, [1,2, 1,0]) show(A) matrix(2, 2, [1,2, 1,0]).charpoly() matrix(2, [1,2, 1,0]).right_eigenvectors()
(1210)\displaystyle \left(\begin{array}{rr} 1 & 2 \\ 1 & 0 \end{array}\right)
x^2 - x - 2 [(2, [ (1, 1/2) ], 1), (-1, [ (1, -1) ], 1)]
b=[] c=[] d=[] a=[] for k in range (-4,4): b.append(parametric_plot([k*2*e^(2*x)+ 1*e^(-x), k*e^(2*x) -1*e^(-x)], (x,-.5,0.5), color='green', thickness=1.5, fill = False, aspect_ratio=1)) c.append(parametric_plot([k*2*e^(2*x) + 1*e^(-x), -k*e^(2*x) +1*e^(-x)], (x,-.5,0.5), color='red', thickness=1.5, fill = False, aspect_ratio=1)) a.append(parametric_plot([-k*2*e^(2*x) -1*e^(-x), -k*e^(2*x) +1*e^(-x)], (x,-.5,0.5), color='black', thickness=1.5, fill = False, aspect_ratio=1)) d.append(parametric_plot([k*2*e^(2*x) + 0*e^(-x), k*e^(2*x) -0*e^(-x)], (x,-.5,0.5), color='blue', thickness=1.5, fill = False, aspect_ratio=1)) sum (b+c+d+a)
A=matrix(2, 2, [1,2, 3,-3]) show(A) matrix(2, 2, [1,2, 3,-3]).charpoly() matrix(2, [1,2, 3,-3]).right_eigenvectors()
(1233)\displaystyle \left(\begin{array}{rr} 1 & 2 \\ 3 & -3 \end{array}\right)
x^2 + 2*x - 9 [(-4.162277660168380?, [(1, -2.581138830084190?)], 1), (2.162277660168380?, [(1, 0.5811388300841897?)], 1)]