0% found this document useful (0 votes)
156 views12 pages

Solutions To Homework Assignment 1: 36-462 January 2009

1. This document provides solutions to homework problems involving logistic maps and circle maps. 2. For logistic maps, it finds the fixed points and stability thresholds for the 2-cycle and 4-cycle. For circle maps, it shows all points are periodic if the rotation number is rational, and no points are periodic if it is irrational. 3. It generates time series for the circle map and shows histograms converge to the uniform distribution, demonstrating ergodicity. However, different initial distributions do not converge, showing the map is not mixing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views12 pages

Solutions To Homework Assignment 1: 36-462 January 2009

1. This document provides solutions to homework problems involving logistic maps and circle maps. 2. For logistic maps, it finds the fixed points and stability thresholds for the 2-cycle and 4-cycle. For circle maps, it shows all points are periodic if the rotation number is rational, and no points are periodic if it is irrational. 3. It generates time series for the circle map and shows histograms converge to the uniform distribution, demonstrating ergodicity. However, different initial distributions do not converge, showing the map is not mixing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Solutions to Homework Assignment 1

36-462
January 2009
1. First, note that the derivative of the logistic map is 4r(1 2x). Second,
the stability
criterion is that a cycle x1 , x2 , . . . xp of period p is stable
Qp
when i=1 |f 0 (xi )| < 1.
(a) The fixed points are the solutions to the equation
x = f (x)
For the logistic map,
x = 4rx(1 x)
or
0 = (4r 1)x 4rx2 = x((4r 1) 4rx)
Written in this form, it is easy to see that there are two solutions,
x=0
and

4r 1
1
=1
4r
4r
which of course is only valid when r 0.25.
xf =

> fixed.point = function(r) {(4*r-1)/(4*r)}


> curve(fixed.point,from=0.25,to=1,xlim=c(0,1))
A fixed point is stable when the magnitude of the derivative there is
< 1. We know that the x = 0 fixed point becomes unstable when
r > 0.25. We will find where the other, non-zero fixed point xf
becomes unstable, r2 , by plugging it into the derivative:




4r2 1
1 = 4r2 1 2

4r2
= |4r2 2(4r2 1)|
= |4r2 + 2|
or r2 = 3/4.

(b) To show that the fixed point is stable below r2 and unstable above
it, there are several possibilities. One is to numerically calculate and
plot the derivative at xf as r varies through r2 .
fixed.point = function(r) {(4*r-1)/(4*r)}
logistic.map.derivative = function(x,r) {4*r*(1-2*x)}
stability.logistic.map.fp = function(r) {
abs(logistic.map.derivative(fixed.point(r),r))
}
curve(stability.logistic.map.fp,from=0.25,to=1)
Another possibility is to use the expression for the stability criterion
at the fixed point found above, |2 4r|. (Notice that nothing in the
derivation of that assumed any special properties of r2 .) If 1/4 <
r < 3/4, then 1 < 4r < 3, and |2 4r| < 1. Similarly, if 3/4 < r < 1,
then 3 < r < 4 and 1 < |2 4r| < 2.
(c) We need to locate the 2-cycle. Recall from the slides that the points
on the this cycle need to be solutions of the equation
x = f (f (x))
Explicitly,
x = 4r(4rx(1 x))(1 4rx(1 x))
Writing this out
x =

16r2 x(1 x)(1 4rx + 4rx2 )

16r2 x(1 4rx + 4rx2 x + 4rx2 4rx3 )

16r2 x(1 (4r + 1)x + 8rx2 4rx3 )

Now, this is a fourth-order (quartic) equation, which has four solutions. Finding them is tedious but not impossible. However, as
remarked in the class and in the slides, we already know two of the
solutions: they are the fixed points. After all, if x = f (x), then
f (f (x)) = f (x) = x, so fixed points automatically solve the 2-cycle
equation. One of those fixed points is x = 0, and its plain from the
way I wrote the equation above that this is, in fact, a solution. Since
were not interested in that, we can divide both sides of the equation
by x, leaving us with a cubic equation.
1

16r2 (1 (4r + 1)x + 8rx2 4rx3 )

(16r2 1) 16r2 (4r + 1)x + 128r3 x2 64r3 x3


1
1 16r2
+ (4r + 1)x 2x2 + x3
=
64r3
4r
2

The other fixed point is x = (4r 1)/4r. This means that the cubic
equation can itself be factored into a linear and a quadratic term1 .

2
4r 1
4r 1 2
4r 1
4r + 1
4r 1
)
0 = (x
)(x +(2+
)x+
2
+
4r
4r
4r
4r
4r
The two remaining solutions, which make up the 2-cycle, are then
given by a quadratic:
!
r
1
(4r 1)2
4r 1
4r 1
4r + 1
x =
2
3
+4
+44
2
4r
16r2
4r
4r
To check that this monster is what we want, lets plot it:
x.cycle.p = function(r) {
0.5*(2 - fixed.point(r)
+ sqrt(-3*fixed.point(r)*fixed.point(r)
+4*fixed.point(r)+4 -4*(4*r+1)/(4*r)))
}
x.cycle.p = function(r) {
0.5*(2 - fixed.point(r)
+ sqrt(-3*fixed.point(r)*fixed.point(r)
+4*fixed.point(r)+4 -4*(4*r+1)/(4*r)))
}
curve(x.cycle.p,from=0.75,to=1,ylim=c(0,1))
curve(x.cycle.m,from=0.75,to=1,add=TRUE)
Rather than plug in to the algebra to determine stability directly
though thats possible! lets use the computer to do it.
stability.lm.2cycle = function(r) {
abs(logistic.map.derivative(x.cycle.p(r),r) *
logistic.map.derivative(x.cycle.m(r),r))
}
curve(stability.lm.2cycle,from=0.75,to=1)
abline(h=1,lty=2)
(The last command draws a horizontal line at 1, for clarity.) This
shows that the stability criterion for the 2-cycle starts at 1, at r =
r2 = 0.75, but then falls below 1 immediately, and stays below 1 until
about r 0.86. To give a more precise value of r4 , we can use the
uniroot function, which solves one-dimensional equations.
uniroot(function(r) {stability.lm.2cycle(r)-1},interval=c(0.85,0.89))
1 See,

for example, Wikipedia, s.v. cubic equation, section factorization.

This gives r4 = 0.8623726 0.0000610.


(d) In the previous part, we saw that the 2-cycle becomes unstable when
r > r4 0.8623726. Its enough to simulate here to see that its
attracted to a 4-cycle here.
Alternately, one could go through the route of heroic algebra. The
points on the 4-cycle consist of the solutions to the equation
x = f (f (f (f (x))))
which are not also fixed points or points on the 2-cycle. The equation
itself is an eighth order polynomial, with in general eight solutions,
which could be obtained numerically via (say) polyroot. However,
two of those solutions are the fixed points, and another two are the
2-cycle, which can be factored out by polynomial division, leaving
a fourth-order polynomial for the 4-cycle proper. This would be a
quartic, which can be solved by hand.
2. (a) A point is periodic if and only if
= + p mod 360

(1)

for some integer p. This is equivalent to


p mod 360 = 0

(2)

Suppose is rational, i.e., = m/n for integers m, n. Then the


previous equation becomes the assertion that
pm/n mod 360 = 0

(3)

for some p, but this is always true, e.g., for p = 360n. So, if is
rational, p is always a multiple of 360 for some p, and so every
point is periodic.
Suppose is irrational. A periodic point would require an integer
p such that p mod 360 = 0. But this would mean that p was a
multiple of 360, so that = 360/p. But then would be the ratio
of two integers, i.e., rational. Hence there can be no such p.
(b) A map is ergodic when time-averages converge on expectations under
the invariant distribution. Or, said differently, the histogram we get
from an individual time-series needs to converge on the histogram
of the invariant distribution. (Look back to lectures 2 and 3.) So
we want to modify the examples of histograms from the individual
logistic map trajectories to get histograms from an individual circlemap trajectory. (This code is also in the accompanying R file.)
# Do one iteration of the rotation map
# Notes:
4

# 1. Through the magic of R vectorization, if given a vector of initial


#
conditions, it will iterate them all in parallel
# 2. Added optional argument "circle" for the measure of a full circle, so
#
you can use radians (or whatever) rather than degrees if you want to
# Inputs: vector of angles (theta), angular increment (alpha), measure of
#
complete circle (circle, defaults 360)
# Output: vector of new angles
rotation.map <- function(theta,alpha, circle=360) {
new.theta = (theta + alpha) %% circle # "%%" is the modulus operator
return(new.theta)
}
# Produce a rotation map time series
# Inputs: number of steps (timelength), angular increment (alpha), initial
#
condition (initial.cond, default is uniform random), measure of
#
complete circle (circle, defaults 360)
# Calls: rotation.map()
# Output: vector of length timelength
rotation.map.ts <- function(timelength,alpha,initial.cond=NULL,circle=360) {
theta = vector(mode="numeric",length=timelength)
if (is.null(initial.cond)) {
theta[1] = runif(1,0,circle)
} else {
theta[1] = initial.cond
}
for (t in 2:timelength) {
theta[t] = rotation.map(theta[t-1],alpha,circle)
}
return(theta)
}
# Evolve an initial ensemble according to the rotation map
# Inputs: number of time steps (timelength), angular increment (alpha),
#
vector of initial conditions (theta), measure of a full circle
#
(circle, default 360)
rotation.map.evolution <- function(timelength,alpha,theta,circle=360) {
for (t in 1:timesteps) {
theta <- rotation.map(theta,alpha,circle)
}
return(theta)
}
Figures 1 and 2 show, respectively, a single time series of length 104
from a random initial condition with = 100, and the histogram
obtained from that series. It is extremely close to uniform; in fact, a
Kolmogorov-Smirnov test against the uniform distribution has a p-

value of 1 (to machine precision; the actual KS distance is 4 104 ).


(Exercise: what does the following code do?
hist(replicate(100,ks.test(rotation.map.ts(1e4,100*pi),punif,0,360)$statistic))
What should its results be if this map is ergodic with the uniform
density as its invariant distribution? [You may want to look at
help(ks.test).])
(c) A map is mixing when the correlations of all bounded, continuous
functions go to zero. Alternately, any initial ensemble needs to converge on to the invariant distribution. To show it is not mixing, one
can either show that correlations do not decay, or that different initial
ensembles do not converge on a common invariant ensemble.
Its easier to see the second way. The effect of the map is to rotate
every point by the same angle. If we start with a non-uniform distribution, all we will get is that same distribution shifted around the
circle, never coming any closer to uniform. For example, if we start
with points with a Gaussian distribution around 45 and a s.d. of 10
degrees (Figure 3), setting = 100 and evolving for one step gives
us Figure 4; evolving for a thousand steps gives Figure 5. The shape
of the distribution is clearly not changing or becoming more uniform.
Alternately, on can check the autocorrelation function (Figure 6, and
see that it is definitely not decaying to zero!
Finally, there is an easy way to see analytically that the circle map is
not mixing. Pick any ensemble of initial conditions you like, so long as
it is restricted to only a part of the circle say a 10deg arc. Clearly,
at the next time step the ensemble will still be confined to a 10deg
arc, though a different one. And this will remain true for an arbitrary
number of iterations. But the invariant distribution is uniform on the
whole circle, so its not confined to any 10deg arc. Since this initial
distribution does not converge on the invariant distribution, the map
is not mixing.
(Notice that this argument works because there is no stretching to
the dynamics every interval gets mapped to an interval of exactly
equal length. What happens with the map t = 2t1 + mod 360?)

350
300
250
200
0

50

100

150

2000

4000

6000

8000

10000

> rts = rotation.map.ts(1e4,100*pi)


> plot(rts,cex=0.1,xlab="t",ylab=expression(theta))
Figure 1: Typical time-series from the rotation map, with = 100.

0.0015
0.0000

0.0005

0.0010

Density

0.0020

0.0025

Histogram of rts

50

100

150

200

250

300

350

rts

> hist(rts,n=101,probability=TRUE)
> abline(h=1/360,lty=2)
Figure 2: Histogram from the time series in the previous figure. The dashed
horizontal line shows the uniform density over the circle.

0.04
0.03
0.02
0.00

0.01

Density

50

100

150

200

250

300

350

> theta.0 <- rnorm(1e4,45,10)


> hist(theta.0,xlab=expression(theta),prob=TRUE,main="",xlim=c(0,360))
Figure 3: Gaussian ensemble of initial conditions for the rotation amp

0.04
0.03
0.02
0.00

0.01

Density

50

100

150

200

250

300

350

> alpha = 100*pi


> theta.1 = rotation.map.evolution(1,theta.0,alpha)
> hist(theta.1,add=TRUE,col="blue",prob=TRUE,n=101)
Figure 4: As in the previous figure, but adding the first iterates of the initial
conditions in blue.

10

0.04
0.03
Density

0.02
0.01
0.00
0

50

100

150

200

250

300

Figure 5: The ensemble of Figure 3 after 1000 iterations.

11

350

1.0
0.5
0.5

0.0

ACF

200

400

600

800

1000

Lag
> theta.ts = rotation.map.ts(1e6,runif(1,0,360),alpha)
> acf(theta.ts,lag.max=1000,main="")
Figure 6: Autocorrelations out to lag 1000 from a rotation map time-series of
length 1 million. Since is bounded, if the map were mixing this should be
decaying to zero.

12

You might also like