Hi @Noura,
To address your query, “I'm working on discrete dynamical system in 2 dimesntion t'm trying to plot a digram a paramete versus the maximum lyapunov exponent, i searched more about it but didn't reach to anything. any one have idea or could help me and thank you.”
The code snippet below simulates a dynamical system using the logistic map equation to calculate Lyapunov exponents. It computes the Lyapunov exponent for different parameter values, indicating the system's sensitivity to initial conditions. If you look at the resulting plot, it will show how the Lyapunov exponent changes concerning the system's parameters, providing insights into the system's chaotic behavior. This analysis can help you understand the system's stability and predictability based on Lyapunov exponents.
% Define your discrete dynamical system function
function x_next = dynamical_system(x, parameter)
% Define your system here, for example:
x_next = parameter * x * (1 - x);
end
% Function to calculate the Lyapunov exponent
function lyapunov = calculate_lyapunov(x, parameter, iterations)
lyapunov = 0;
for i = 1:iterations
x = dynamical_system(x, parameter);
lyapunov = lyapunov + log(abs(parameter * (1 - 2 * x)));
end
lyapunov = lyapunov / iterations;
end
% Define the range of parameter values
parameters = linspace(2.8, 4, 1000); % Adjust the range as needed
% Initialize arrays to store parameter values and corresponding Lyapunov
exponents
lyapunov_exponents = zeros(size(parameters));
% Iterate over each parameter value and calculate the Lyapunov exponent
for i = 1:length(parameters)
lyapunov_exponents(i) = calculate_lyapunov(0.5, parameters(i), 1000); %
Adjust the initial condition and iterations as needed
end
% Plot the parameter values against the maximum Lyapunov exponents
figure;
plot(parameters, lyapunov_exponents, 'b');
xlabel('Parameter Value');
ylabel('Maximum Lyapunov Exponent');
title('Parameter vs. Maximum Lyapunov Exponent Plot');
Please see attached plot.
Hope this helps answers your question.