Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USING MATLAB: Use the logistic equation, given by: OR to demonstrate the followi

ID: 2077562 • Letter: U

Question

USING MATLAB:

Use the logistic equation, given by:

OR

to demonstrate the following properties (using Matlab).

a. Sensitivity to a (very) small change in initial condition (in the Chaotic Regime)

b. Quantify how the average of 10 randomly selected paths of close neighboring initial points diverges in different regimes (i.e. check this for values of parameter a < 3, between 3 and 3.4495, and above this value). Plot the average divergence against the value of parameter a.

c. Failure of autocorrelation in detecting a relationship

d. Success of the return plot in detecting a relationship

e. Interpret your findings

Ti ari-1 ari 1)

Explanation / Answer

Solution :-

This MATLAB program will serve all purposes:-

function y=logistic(a,x); % this takes as input the parameter a and the value of x and % returns y = ax(1-x).

The value of x can be a vector, in which % case, the corresponding y vector is returned

% Usage: >> x = 0:.01:1; (100 equidistant points in [0, 1]) % >> y = logistic(3.2, x); y=a*x.*(1-x);

function [u, v, z] = iterate(a, y0, n) % Outputs everything needed for graphical analysis of the logistic map;

the % inputs are the parameter a for the logistic map, the starting value y0, % and the number of iterations for the function to do


% Usage:: to interate 500 times with IC y0 = .32, and parameter .5, we type % >> [u,v,z] = iterate(0.5, 0.32, 500);

to plot the 400th to 450th % points of the orbit, you’d do % >> plot(z(400:450)).

To do the "web plot", with the last 50 points, type % >> plot(u(900:1000),v(900:1000))
z = zeros(n+1,1); z(1) = y0; for i = 2:n z(i) = logistic(a,z(i-1)); end

u = zeros(2*n,1);u(1) = y0; v = zeros(2*n,1);v(1) = 0; for i=2:2*n u(i) = z(ceil(i/2)); end v = [0;u(3:2*n)]; u = u(1:2*n-1);
9
function [z] = iterate2(a, y0, n) % this one just computes the orbit, so we don’t need u and v of iterate.m z = zeros(n+1,1); z(1) = y0; for i = 2:n z(i) = logistic(a,z(i-1)); end
(bifurcate.m) % this is a procedure and not a function. It is invoked by simply typing % the word ‘bifurcate’ at the MatLab prompt.

It calls the function % iterate2, which, in turn, calls the function logistic.

The way it’s set % up, it computes the stable orbits (of period <= 50), for 1000 values of % the parameter a in the interval [0,4].

If you’re going to experiment, % it’s easier if you just use 100 values of a to make sure you’re doing % things correctly.

clf hold for m=1:1000 a = 0.004*m; z = iterate2(a,0.35,1000); plot(a, z(950:1000),’.’,’MarkerSize’,3) end