It's a 2by2 transition matrix, and i'm writing the entries of the transition matrix as x_i here. A is the transition matrix with the four entries. Also, FYI, the norm of a transition matrix is the square root of the maximum eigenvalue of A(transpose)*A.
Below is my code, and somehow the graph is not showing anything. Could someone explain to me what i did wrong here?
odesys = @(t,x) [(0.1*cos(2*t)-0.1)*x(1) + x(3)*(-0.1*sin(2*t)+1); (0.1*cos(2*t)-0.1)*x(2)+x(4)*(-0.1*sin(2*t)+1);(-0.1*sin(2*t)-1)*x(1) + x(3)*(-0.1*cos(2*t)-0.1); (-0.1*sin(2*t)-1)*x(2)+x(4)*(-0.1*cos(2*t)-0.1)];
x0 = [1; 0; 0;1];
tspan = [0 50];
[t, x] = ode45(odesys, tspan, x0);
A = [x(1) x(2);x(3) x(4)];
B = transpose(A);
C = mtimes(B,A);
b = max(eig(C));
plot(t, sqrt(b));
legend('norm', 'Location', 'NE')

 Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Nov. de 2018

0 votos

for K = 1 : size(x,1);
A = [x(K,1), x(K,2);x(K,3), x(K,4)];
B = transpose(A);
C = mtimes(B,A);
b(K) = max(eig(C));
end

Más respuestas (0)

Categorías

Preguntada:

el 29 de Nov. de 2018

Comentada:

el 29 de Nov. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by