Question: Modify the Matlab code below but of the same meaning. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Generate some output from the logistic map %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Time series %%%%%%% Output from the

Modify the Matlab code below but of the same meaning.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Generate some output from the logistic map

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Time series

%%%%%%% Output from the logistic map

%%%%%u_n+1 = r * u_n (1 - u_n)

%%%%%%

% r=0.8; % steady state

% r=1.2; % steady state

% r=2.2; % steady state

% r=3.2; % 2-cycle

% r=3.5; % 4-cycle

% r=3.55; % 8-cycle (may need to increase niters)

% r=3.6; % chaos

% r=4.0; % chaos

% r=3.83; % 3-cycle

% r=3.845; % 6-cycle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp(' ')

disp('This matlab code shows figures to the solutions to the logistic recurrence relation')

disp(' ')

disp(' u_{n+1} = u_n + r*u_n*(1-u_n)')

disp(' ')

disp(' ')

disp('Enter varying parameter "r"')

r=input ('r = ');

%

disp(' ')

disp('Enter the starting population point "u_0"')

u_0=input ('u_0 = ');

%

disp(' ')

disp('Enter the number of iterations:');

niters=input('(200) ');

if isempty(niters) niters=200;

end;

%

u_omega=u_0;

n=u_omega;

for i=1:niters; u_omega = u_omega + r*u_omega*(1 - u_omega);

n=[n u_omega];

end

%

% Plotting routine

plot([0:niters], n, 'k-*')

y_max = max([u_0 n]) + 0.1;

axis([0 niters 0 y_max]); grid on;

title(['logistic map with varying parametr r = ', num2str(r), 'K=1, ', 'and ' ,

'u\_0 = ', num2str(u_0)])

xlabel('Time n');

ylabel('Population u');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!