Effacer les filtres
Effacer les filtres

some one help my in Computation of the Feigenbaum delta

23 vues (au cours des 30 derniers jours)
ibrahim
ibrahim le 13 Nov 2023
can you solve that
% Compute the Feigenbaum delta
% Store approximate values in the row vector delta for assessment, where length(delta)= num_doublings and
% delta(2:num_doublings) are computed from the algorithm described in Lectures 21-23.
num_doublings=11; delta=zeros(1,num_doublings); delta(1)=5;
% Write your code here
% Initialize arrays to store results
num_doublings=11; delta=zeros(1,num_doublings);
m0=2;
m1=1+sqrt(5);
x=0.5;
dx=0;
delta(1) = 5;
% Set initial value of delta_values to 5
r_increment = 0.01;
% Loop 1: Iterate over different periods
for doubling = 1:num_doublings-1
doubling=doubling+1;
period = 2^doubling;
m=m1+(m1-m0)/delta(doubling-1);
m0=m1;
m1=m;
r = 0.5; % Initial value of r
rn_prev = r;
% Loop 2: Newton's method
for iteration_loop2 = 1:50
x = 0.5; % Initial guess for Newton's method
dx = 0;
% Loop 3: Iterate the logistic map
for iteration_logistic = 1:period
x = m * x * (1 - x); % Logistic map iteration
dx = m *(1-x)+m*dx* (1 - 2 * x); % Derivative of logistic map
end
end
m=m-(x-0.5)/dx;
delta(doubling) =m;
end
% Output your results
fprintf('n delta(n)\n');
for n=1:num_doublings
fprintf('%2g %18.15f\n',n,delta(n));
end
this is my code

Réponses (1)

Akshat Dalal
Akshat Dalal le 22 Nov 2023
Hi Ibrahim,
I understand that you have written a script for computing the Feigenbaum Delta from Logistic map and are facing some issues. I went through your code and had some observations:
  • You are changing the value of the first for-loop iterator ‘doubling’ at line 17. Although this does not affect the number of times the loop executes, this is not recommended as it may cause confusion in the code. You could redesign you script in a way to avoid this.
doubling=doubling+1;
  • In Newton’s method, you are updating the value of ‘m’ outside for-loop 2 at line 36. It should be done inside for-loop 2 after you iterate through the logistic map in for-loop 3.
% Loop 2: Newton's method
for iteration_loop2 = 1:50
x = 0.5; % Initial guess for Newton's method
dx = 0;
% Loop 3: Iterate the logistic map
for iteration_logistic = 1:period
x = m * x * (1 - x); % Logistic map iteration
dx = m *(1-x)+m*dx* (1 - 2 * x); % Derivative of logistic map
end
m=m-(x-0.5)/dx;
end
  • The reassigning of ‘m0’ and ‘m1’ is done before for-loop 2. It should be done after that, so that their new values could be used in calculation of ‘m’ during the next iteration.
  • Apart from that, you could also try different values of ‘x’ in Newton’s method for better results.
I hope this helps.

Community Treasure Hunt

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

Start Hunting!

Translated by