Norm of transition matrix
Afficher commentaires plus anciens
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')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!