Generating chaotic sequence with possitive numbers
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i want to generate chaotic sequence
without negative numbers
0 commentaires
Réponses (1)
Dev
le 26 Mar 2025
To generate a chaotic sequence, we can use a logistic map which is a simple mathematical model that exhibits chaotic behaviour. This logistic map can be defined by the equation:
x_n = r * x_n-1 * (1 - x_n-1), where,
‘r’ is a parameter that should be in the range (3.57 to 4) for chaotic behaviour, and
‘x_n’ is the sequence value at step ‘n’.
To ensure the sequence remains non-negative, we can declare ‘x_0’ and define its initial value between 0 and 1. We can then start the sequence (x_1) with this initial value.
Next, we can use the logistic map equation in a ‘for’ loop to generate the entire sequence. For more information regarding the usage of ‘for’ loop, please refer to the documentation below-
I have also attached a reference code snippet below to generate the same-
% Generate the chaotic sequence
n = 100; % configure accordingly
for i = 2:n % starting with 2 since x_1 is already initialized previously
x(i) = r * x(i-1) * (1 - x(i-1));
end
I hope this resolves the issue.
0 commentaires
Voir également
Catégories
En savoir plus sur Nonlinear Dynamics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!