之前分享过Matlab求解混沌系统最大李雅普诺夫指数
这次分享通过jac矩阵的方法来求解李雅普诺夫指数。
假定研究系统为:某二维非线性动力系统方程组合
这其jac矩阵的为2*2矩阵,
第一行为x(n+1)分别对xn和yn求导;
第二行为y(n+1)分别对xn和yn求导
则jac矩阵表达式为[-2*a*x,1; b 0];
完整代码实现:
clc
close all
clear
N = 1000;
a = (0:0.001:1.4)';
b = 0.3;
na = length(a);
LE1 = zeros(na,1);
LE2 = zeros(na,1);
x = 0.2; y = 0.3;
for i = 1:na
LCEvector = zeros(2,1);
Q = eye(2);
for j=1:N
xprev = x;
yprev = y;
x = 1-a(i)*xprev*xprev+yprev;
y = b*xprev;
Ji = [-2*a(i)*x,1;b 0];
B = Ji*Q;
[Q,R] = qr(B);
LCEvector = LCEvector+log(diag(abs(R)));
end
LE = LCEvector/N;
LE1(i) = LE(1);
LE2(i) = LE(2);
end
figure(1);
plot([0,1.4],[0,0],'--','LineWidth',1);
hold on
plot(a,LE1,'g',a,LE2,'b','linewidth',1) ;
set(gca,'XLim',[0 1.4]);
set(gca,'YLim',[-2 1]);
legend('line1=0','\lambda1','\lambda2');
xlabel('a');ylabel('LE');
set(gca,'fontsize',10)