Generating chaotic sequence with possitive numbers
조회 수: 4 (최근 30일)
이전 댓글 표시
i want to generate chaotic sequence
without negative numbers
댓글 수: 0
답변 (1개)
Dev
2025년 3월 26일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Dynamics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!