how to find lyapunov exponent for sine function sin(x) and how to plot it? if i have a code for logistic map? instead of logistic map lyapunov i want just sine lyapunov?

15 次查看(过去 30 天)
clc
clear all
close all
r = 1:0.01:4;
for j=1:length(r)
x(1)=0.1;
lyap = 0;
for i = 1:length(r)
x(i+1) = r(j)*x(i)*(1-x(i)); %logistic map equation
lyap=lyap+log(abs(r(j)*(1-2*x(i)))); % after abs there is dericative of the logistic map
end
lamda(j) = lyap/1000;
end
figure(1)
plot(r,lamda)
grid on
xlabel('control parameter')
ylabel('lyapunov exponent')

回答(1 个)

Paras Gupta
Paras Gupta 2023-9-22
Hi Zubair,
I understand that you want to plot the Lyapunov exponent for the sine function.
The following changes can be made in the provided code to achieve the same:
  • Instead of using the logistic map equation, the sine function equation x(i+1) = r(j)*sin(x(i)) is used
  • The Lyapunov calculation has been updated to lyap = lyap + log(abs(r(j)*cos(x(i)))) based on the derivative of the sine function.
The modified code is given below:
clc;
clear all;
close all;
r = 1:0.01:4;
for j=1:length(r)
x(1)=0.1;
lyap = 0;
for i = 1:length(r)
x(i+1) = r(j)*sin(x(i)); % Sine function equation
lyap = lyap + log(abs(r(j)*cos(x(i)))); % Lyapunov calculation for sine function
end
lamda(j) = lyap/1000;
end
figure(1)
plot(r,lamda)
grid on
xlabel('control parameter')
ylabel('lyapunov exponent')
You can refer to the following documentations for more information on the function used in the code above:
I hope the above modifications will help to get the required results.

类别

Help CenterFile Exchange 中查找有关 Matrix Computations 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by