Computer Simulation and Applications September 16 Computer - - PowerPoint PPT Presentation

computer simulation and applications
SMART_READER_LITE
LIVE PREVIEW

Computer Simulation and Applications September 16 Computer - - PowerPoint PPT Presentation

Computer Simulation and Applications September 16 Computer Simulation and Applications September 19 Simple Systems, Complex Behavior Fireflies: mysterious mass synchrony Actually beetles , also called lightning bugs (for their


slide-1
SLIDE 1

Computer Simulation and Applications

September 16

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4

Computer Simulation and Applications

Simple Systems, Complex Behavior September 19

slide-5
SLIDE 5

Fireflies: mysterious mass synchrony

  • Actually beetles , also called lightning bugs (for their conspicuous use of bioluminescence to attract mates or prey)
  • Thailand, with fantastic, out of this world firefly shows; enormous congregations of fireflies blinking on and off in unison, in

displays that supposedly stretched for miles along the riverbanks. (Also occuring in Africa, and some more places )

  • Accounts on this phenomenon by Western travelers to South East Asia go back as far as 300 years.
  • Mysterious form of mass synchrony.
  • In 1917 Philip Laurent wrote up an explanation in Science: “the apparent phenomenono was caused by the twisting or

sudden lowering and raising of my eylids the insects had nothing to do with it”

  • In the years between 1915 and 1935, Science published 20 other articles on this phenomenon (some said it was just

coincidence, others ascribed it to peculiar atmospheric conditions such as exceptional humidity, calm or darkness. Some (eg George Hudson) believed there must be a maestro that cues all the rest of the fireflies

  • George Hudson in 1918 in Science: “if it is desired to get a body of men to sing or play together in perfect rhythm they not
  • nly must have a leader but must be trained to follow the leader ... Do these insects inherit a sense of rhythm more perfect

than our own?” He concluded there must a leader among the fireflies.

  • Hugh Smith lived in Thailand from 1923 to 1934 witnessed the phenemon countless times wrote in exasperation: “some of

the published explanations are more remarkable than the phenomenon itself” – he confessed though that he could not offer an explanation.

  • Late 1960s people started to gain understanding
  • One clue was so obvious that nearly everyone missed it: synchronous fireflies not only flash unison – they flash in rhythm, at

constant tempo (even when isolated from one another, they still keep a constant beat

  • That means each insect must have its own means of keeping time, some sort of internal clock. Hypothetical oscilator (still

unidentified) anatomically but is presumed to a cluster of neurons somewhere in the firefly’s brain much like a natural pacemaker in our hearts.

  • The oscillator fires repetively, generating an electrical rhythm that travels to the firefly’s lantern and ultimately triggers its

periodic flash http://www.youtube.com/watch?v=IBgq-_NJCl0&feature=related movie of synchronizing fireflies (courtesy of Johannes)

slide-6
SLIDE 6

Fireflies conceived as mindless oscillators

  • Second clue came from the work of the biologist John Buck

Informal experiment: he captured a lot of fireflies near Bangkok and released them in his darkened hotel room. The insects flitted about nervously, then settled down all over the walls and ceiling, always spacing themselves 10 centimeters apart. At first the fireflies twinkled incoherently. Then pairs, then trios began to pulse in unison. Pockets of synchrony continued to emerge and grow, until as many as a dozen were blinking on and off in perfect concert This suggested that fireflies must be somehow adjusting their rhythms in response to the flashes of others. John Buck and his colleagues later in the lab started to test this hypothesis directly: they flashed an artificial light at the firefly (to mimick the flash of another) and measured its response. The firefly will shift the timing of its subsequent flashes in a consistent and predictable manner, the size and direction of the shift depend on when in the cycle the stimulus was received. For Some species the stimulus always advanced the firefly’’s rhythm, as if setting the clock ahead Other species delayed or advanced the clock depending on where they were in the cycle of the other

  • Two clues  the flash rhythm was regulated by an internal, resettable oscillator.
  • These two clues suggested a sync mechanism for a congregation of fireflies: each is continually sending and receiving

signals, shifting the rhythm of others and being shifted by them in turn. Out of cacaphony sync emerges spontaneously, fireflies organize themselves, no maestro. Synchronization occurs through mutual cuing in the same way an orchestra can keep perfect timing without a conductor Counterintuitive: insects don’t need to be intelligent The insects have all the ingredients: each firefly contains an oscillator, a little metronome, whose timing adjusts automatically in response to the flashes of others. That is all there is to it! Except for one thing: is such a scenario possible?

  • Can perfect synchrony emerge from a cacaphony of thousands of mindless metronomes?
  • S. Strogatz and R. Mirollo proved that this is possible. Moreover they proved that not only is it possible but under certain

conditions it will always occur.

  • The tendency to synchrony is one of the most pervasive drives in the universe, for reason not understood yet, extending

from atoms to animals, from people to planets.

slide-7
SLIDE 7

Fireflies = simple model of self-organizing system

  • Examples:

sperm swimming side by side en route to the egg beat their tails in unison, in a premordial display of synchronized swimming Eplipsy (in this case synchrony is most undesirable) caused by millions of brain cells discharging in pathological lockstep, causing rhythmic convulsions associated with seizures. Also lifeless can synchronize: amazing coherence of a laser beam comes from trillions of atoms pulsing in concert, all emitting photons f the same phase and frequency. Over the course of millenia, the incessant effects of the tides have locked the moon’s spin to its orbit; it now turns on its axis at precisely the same rate as it circles the earth (that is why we never see its dark side)

  • On the surface these phenomena seem unrelated (brain and lasers) but at a deeper level there is a connection , transcends

the details of particular mechanism: mathematics

  • All examples are variations of the same math theme: self organization, the spontaneous emergence of order out of chaos.
  • We are beginning to unlock , by the study of simple MODELS of fireflies and other self-organizing systems, the secrets of

this dazzling kind of order in the universe.

  • Ch. Peskin is the first person to pose the question about self-organization : Can perfect synchrony emerge from a

cacaphony of thousands of mindless metronomes?

Fireflies they gave us insight into the inevitability of sync

slide-8
SLIDE 8

Pacemaker of the Heart

  • Ch. Peskin also proposed a schematic (according to the dictum of Einstein: everything should be made as simply as possible, but not simpler)
  • model for how the pacemaker cells of the heart synchronize themselves
  • Pacemaker of the heart
  • marvel of evolutioin
  • most impressive oscillator ever created
  • a cluster of 10,000 cells called sinoatrial node
  • generates electrical rhythm that commands the rest of the heart to beat
  • has to be done reliably, minute after minute
  • three billion beats in a lifetime
  • unlike most cells in heart, the pacemaker cells oscillate automatically: isolated in petri dish, their voltage rises and falls in a regular

rhythm

  • All of which raises the question: Why do we need so many cells, if one can do the job?
  • probably because a single leader is not robust design: a leader can malfunction or die
  • instead evolution ahs produced a more reliable, democratic system in which thousands of celss

collectively set the pace

  • democracy has it own problems: somehow the cells have to coordinate their firings – conflicting signals

and the heart becomes deranged

Charles S. Peskin http://www.math.nyu.edu/faculty/peskin/ also site for the book: modeling and simulation in the life sciences

slide-9
SLIDE 9

Cardiac pacemaker simulated as a net of simple

  • scillating circuits
  • This became Peskin’s question: How do these cells with no leader or outside instructions , manage to get in sync?
  • Notice the how similar this question is to the earlier one about fireflies both involve large populations of rhythmic individuals that fire off sudden

pulses that jolt the rhythms ot others in their group, speeding them up or slowing them down according to specific rules. In both cases, synchronization seems to be inevitable. Challenge question: explain why is it inevitable

  • Peskin examined this question within a framework of a simplified model each pacemaker cell as an oscillating electrical circuit is equivalent to a

capacitor in parallel with resistor

  • The whole pacemaker he idealized as enormous collection of these simple mathematical oscillators; for simplicity he
  • Assumed
  • all oscillators are identical – follow the same charging curve
  • each oscillator is strongly equally strongly to all others
  • scillators effect one another when they fire
  • He worked on showing that synchrony emerges out of the cacaphony, but was only able to show this for a system with two oscillators.
  • This problem lay dormant for 15 years, eventually the mathematicians Strogatz and Mirello showed that synchrony will always emerge under certain

conditions

slide-10
SLIDE 10
  • “En forgerant on devient forgeron”
  • “door te smeden wordt men smid”
  • ”by forgeing one becomes ´forgerer´=

blacksmith ”

  • So lets continue!
  • In what way? Geometrically, numerically, and

algebraically ...

slide-11
SLIDE 11

Logistic Family of Maps f(x) = a x (1-x), continued

  • Proposed by Verhulst: try to derive this model
  • r otherwise ask me
slide-12
SLIDE 12

Logistic Family of Maps f(x) = a x (1-x), continued

  • RECALL: Our goal is to understand this

family of maps: what happens to the iterates fk(x0) for any possible initial value x0 and fixed parameter a when k grows large. Then, of course, vary the parameter as well.

  • Sofar we only understood f(x) = a x (1-x) for a

satisfying 0 < a ≤ 2. We need to tackle the remaining parameter values.

slide-13
SLIDE 13

Stability of Fixed Points

The concept of “near” to a point p : all real numbers x which lie within a distance ε to p (notation Nε(p) ). Or more precise: let R denote the real numbers and p some real number, then

Nε(p) = { x in R : |x-p| < ε } Sometimes also calle the ε-neighborhood (epsilong- neighborhood) of p. We usually think of ε as a small, positive number.

slide-14
SLIDE 14

Stability of Fixed Points: Definitions

  • Let f be a map on R and let p be a real number such that

f(p)=p. If all points sufficiently close are attracted to p, then p is called a sink or an attracting fixed point.

  • More precisely, if there is a ε > 0 such that for all x in the

epsilon-neigborhood Nε(p) : Limk  ∞ fk(x) = p, then p is a sink.

  • If all points sufficiently close to p are repelled from p, then p is

called a source or a repelling fixed point.

  • More precisely: if there is an epsilon-neighborhood Nε(p) such

that for each x in Nε(p) except p itself eventually maps

  • utside of Nε(p), then p is a source.
slide-15
SLIDE 15

Stability of Fixed Points: A Theorem

  • Let f be a differentiable map on R and assum p is a fixed point
  • f f. Then:

a) If |f’(p)| < 1, then p is a sink b) If |f’ (p)| > 1, then p is a source c) If |f’ (p)| = 1, then undecided can be very complex behavior, or p can be a source or p can be a sink.

  • Can readily proof this. The proof is instructive because we

learn from the proof what the rate of convergence is of fk(x) to p.

slide-16
SLIDE 16
  • Our definition of a fixed-point sink requires that the sink

attract some epsilon-neighborhood (p-ε, p+ε) of nearby points.

  • According to the definition: ε could extremely small (although

nonzero).

  • The set of points (=real numbers) x whose orbit converges to

the sink is called the basin of the sink).

  • Sinks often attract orbits from a large set of initial points:
  • For instance, f(x) = 2x (1-x):

a) Fixed points 0 and ½ b) f’(0) = 2 and f’(1/2)=0 c) Thus (see theorem of previous slide): 0 is a repellor and ½ is an attractor d) Basin of attraction of ½ is (0,1) (do this with a) cobweb and b) algebraically) e) (-∞,0) U (1,∞): each initial value in this set has an orbit that tends toward -∞

Stability of Fixed Points: BASINS

slide-17
SLIDE 17

f(x) = 3.3x(1-x)

  • Situation will be quite different from

g(x)=2x(1-x)

  • Fixed points: x=0 and x=23/33=0.696969, ...

Both are repellers.

  • No fixed points that can attract orbits. Where

do points go?

slide-18
SLIDE 18

f(x) = 3.3x(1-x)

N g^n(x) g^n(x) g^n(x) 0,2000 0,5000 0,9500 1 0,5280 0,8250 0,1568 2 0,8224 0,4764 0,4362 3 0,4820 0,8232 0,8116 4 0,8239 0,4804 0,5047 5 0,4787 0,8237 0,8249 6 0,8235 0,4792 0,4766 7 0,4796 0,8236 0,8232 8 0,8236 0,4795 0,4803 9 0,4794 0,8236 0,8237 10 0,8236 0,4794 0,4792 11 0,4794 0,8236 0,8236 12 0,8236 0,4794 0,4795 13 0,4794 0,8236 0,8236 14 0,8236 0,4794 0,4794 15 0,4794 0,8236 0,8236 16 0,8236 0,4794 0,4794 17 0,4794 0,8236 0,8236 18 0,8236 0,4794 0,4794 19 0,4794 0,8236 0,8236 20 0,8236 0,4794 0,4794

slide-19
SLIDE 19

f(x) = 3.3x(1-x)

p1=0.4794 p2=0.8236 Initial value Period-2 orbit

slide-20
SLIDE 20

Periodic Points, Orbits: definition

  • Let f be a map on R (=real numbers). We call p a periodic

point of period k, if fk(p) = p and k is the smallest such positive integer.

  • The orbit with initial value p (which consists of k points) is

called a periodic orbit of period k.

  • Abbreviations: period-k point , period-k orbit
slide-21
SLIDE 21

Periodic Points, Orbits: elucidation

  • Notice that we have defined the period of an orbit to be the

mininum number of iterations required for the orbit to repeat the point.

  • If p is a periodic point of period 2 for the map f, than p is a

fixed point of the map h = f2. (Converse is not true. A fixed point of h = f2 may also be a fixed point of a lower iterate of f, specifically f, and so may not be a periodic point of period two: if p is fixed point of f, it is also a fixed point of f2, but not a period-2 point according to our definition.

  • Example for the map f(x) = 2x2 – 5x on R. Fixed points: 0, 3.

Period-2 points? Get them via the fixed points of f2. Fixed points of f2 are: 0, 3, 1-sqrt(2), 1+sqrt(2). Ans: 1-sqrt(2), 1+sqrt(2)

  • Example for the map f(x) = -x on R. One fixed point: 0. Any

non-zero number is a period-2 point.

slide-22
SLIDE 22

Stability of Periodic Orbits: definition

  • Let f be a map and assume that p is a period-k point.

– The period-k orbit of p is a periodic sink, if p is a sink for the map fk. – The period-k orbit of p is a periodic source, if p is a source for the map fk.

slide-23
SLIDE 23

Recall the Chain Rule

  • Chain rule shows how to expand the derivative of the composition of two functions:

– (f o g)’ (x) = ? Answer: f’(g(x)) * g’(x). – We make an intuitive guess for (f o g)’ (x) at x = a, ( let b:=g(a) ).

(6,37)

g(x) = x2 and its tangent at a=(√2)/2, g(x) ≈ g(a)+g’(a) (x- a)) around a f(x) = 6/x and its tangent at b=1/2: f(x) ≈ f(b)+f’(b) (x-b) around around b.

(1/2, 12) (√2/2, ½)

a =b

slide-24
SLIDE 24

Recall the Chain Rule

  • Intuitive guess for (f o g)’ (a) = ? for the answer f’(g(a)) * g’(a):

Let the geometry with some algebra suggest the derivative of the composition of g(x) and f(x) at a ( b=g(a) ) Intuitively we can replace the graph of g around a by the tangent line g(a)+g’(a) (x- a) and the graph of f around b by its tangent line at b: f(b)+f’(b) (x-b) (suggested in previous slide for some particular functions, but it is true for any functions) From this we get an approximation for the composition (f o g) around a: (fog) (x) ≈ f(b)+f’(b) (g(x)-b) this is in turn roughly: f(b)+f’(b)( g(a)+g’( a) (x- a) - b) = f(b)+f’(b)( g’( a) (x- a) ) , since g(a) = b Or (f o g) (x) ≈ f(b)+f’(g(a)) ( g’( a) (x- a) ), since b = g(a) Thus f(b)+f’(g(a)) * g’( a) *(x- a) is a reasonable guess for the best linear approximation of (f o g) (x) around x = a . Thus f’(g(a)) * g’( a) is a reasonable guess for (f o g)’ (a). Mind you we did not give a proof of the chain rule, we just made it plausible. And of course there are other ways to convince yourself intuitively of the rule.

slide-25
SLIDE 25

Recall Chain Rule

  • Unrelated to the previous, we can verify the chain rule for the following particular situation

(k o h), where k(x) = x2 and h(x)=6/x, algebraically :

  • Since (k o h) (x) = 6/h(x) = 6/x2 , we know that (without using the chain rule) (koh)´(x) = (6/x2)´

= -12/x3

  • Since k´(x) = -6/x2; h´(x) = 2x; we get (k o h)´x) = k´( h(x)) * h´(x) = - 6/x4 * 2x = -12/x3 by the

derivative rule for composition (=chain rule).

  • Convincingly in both ways we get the same answer.
slide-26
SLIDE 26

Let us consider period-2 points first. So we are interested in f2(x), since period-2 points are fixed points of f2(x). For all x, we have(f2)’(x) = f’(f(x))*f’(x) --- by the chain rule. Consider also a period-2 orbit {p1,p2}. We get: (f2)’(p1) = f’(f(p1))*f’(p1) & f(p1)=p2, thus (f2)’(p1) = f’(p2)*f’(p1). And symmetrically: (f2)’(p2) = f’(p1)*f’(p2). Upshot: the derivative of f2 is the same when evaluated at either point of the orbit, so it makes sense to talk about the stability of a period-2 orbit

Periodic Points, periodic orbits, and Stability

slide-27
SLIDE 27

Periodic points, periodic orbits, stability

Now the period-2 behavior of (wrt f(x) = 3.3x(1- x) we saw earlier can be completely explained: the periodic orbit {0.4794, 0.8236} will be a sink as long as the derivative of (f2)’(p1) = f’(p2)*f’(p1) = (f2)’(p2) is smaller than 1 in absolute value. f’(p2)*f’(p1) = f’(0.4794)*f’(0.8236) = -0.2904

slide-28
SLIDE 28

Periodic points, periodic orbits, stability

So let us consider one more member of the family f(x) = a*x*(1-x), this time we take a to be 3.5. Fixed points: x=0 and x=5.7. Derivatives at these points: f’(0) = 3.5 and f’(5/7) = -1.5, so they are repellers (sources). The orbit {3/7, 6/7} is a period-2 orbit. (f2)’(3/7) = -5/4 (and therefore also (f2)’(6/7) = -5/4), so this period- 2 repels nearby points. Where do points go?

slide-29
SLIDE 29

n f^n(x) f^n(x) f^n(x) 0,2000 0,5000 0,9500 1 0,5600 0,8750 0,1663 2 0,8624 0,3828 0,4851 3 0,4153 0,8269 0,8742 4 0,8499 0,5009 0,3848 5 0,4465 0,8750 0,8286 6 0,8650 0,3828 0,4971 7 0,4088 0,8269 0,8750 8 0,8459 0,5009 0,3829 9 0,4563 0,8750 0,8270 10 0,8683 0,3828 0,5008 11 0,4002 0,8269 0,8750 12 0,8401 0,5009 0,3828 13 0,4700 0,8750 0,8269 14 0,8719 0,3828 0,5009 15 0,3910 0,8269 0,8750 16 0,8334 0,5009 0,3828 17 0,4859 0,8750 0,8269 18 0,8743 0,3828 0,5009 19 0,3846 0,8269 0,8750 20 0,8284 0,5009 0,3828 21 0,4975 0,8750 0,8269 22 0,8750 0,3828 0,5009 23 0,3829 0,8269 0,8750 24 0,8270 0,5009 0,3828 25 0,5008 0,8750 0,8269 26 0,8750 0,3828 0,5009 27 0,3828 0,8269 0,8750 28 0,8269 0,5009 0,3828 29 0,5009 0,8750 0,8269 30 0,8750 0,3828 0,5009

29 0,5009 0,8750 0,8269 30 0,8750 0,3828 0,5009 31 0,3828 0,8269 0,8750 32 0,8269 0,5009 0,3828 33 0,5009 0,8750 0,8269 34 0,8750 0,3828 0,5009 35 0,3828 0,8269 0,8750 36 0,8269 0,5009 0,3828 37 0,5009 0,8750 0,8269 38 0,8750 0,3828 0,5009 39 0,3828 0,8269 0,8750 40 0,8269 0,5009 0,3828

f(x) = 3.5x(1-x)

n fn(x) fn(x) fn(x)

slide-30
SLIDE 30

Write a computer program with the goal of redoing the table we did for 3.3x(1-x) and for 3.5x(1-x). What periodic behavior emerges? Try several initial conditions to the explore the basin of the attracting periodic behavior. Then try different values for a < 3.57. Report your results.

slide-31
SLIDE 31

Period-k Points Let {p1,..., pk-1,pk} be period-k

  • rbit of f

(fk)’(p1) = (f (fk-1))’(p1)= f ‘(fk-1 (p1)) *(fk-1)’(p1)= f ‘(fk-1 (p1)) *(fk-1)’(p1) = done handle as before = f ‘(fk-1 (p1)) *f ‘(fk-2 (p1)) *(fk-2)’(p1) = ....... = done doen=to do

f ‘(fk-1 (p1)) *f ‘(fk-2 (p1)) * f ‘(fk-3 (p1)) *(fk-4)’(p1)... * f’(p1) = f ‘(pk) *f ‘(pk-1) * ... * f’(p1)

slide-32
SLIDE 32

Period-k Points Let {p1,..., pk-1,pk} be period-k

  • rbit of f

(fk)’(p1) = (f (fk-1))’(p1)= f ‘(fk-1 (p1)) *(fk-1)’(p1)= f ‘(fk-1 (p1)) *(fk-1)’(p1) = done handle as before = f ‘(fk-1 (p1)) *f ‘(fk-2 (p1)) *(fk-2)’(p1) = .......... = done doen=to do

f ‘(fk-1 (p1)) *f ‘(fk-2 (p1)) * f ‘(fk-3 (p1)) *(fk-4)’(p1)... * f’(p1) = f ‘(pk) *f ‘(pk-1) * ... * f’(p1)

slide-33
SLIDE 33

Let f be differentiable on R. And let P= {p1,..., pk-1,pk} be a periodic orbit. Then: 1) If |f ‘(pk) *f ‘(pk-1) * ... * f’(p1) |< 1, then P is a sink 2) If |f ‘(pk) *f ‘(pk-1) * ... * f’(p1) | > 1, then P is a source. The derivative of the k-th iterate of f at a point

  • f a period-k orbit is the product of the

derivatives of f at the k points of the orbit. Stability is a collective property of the periodic

  • rbit, in that, (fk)’(pi)=(fk)’(pj), for all i and j.

A Theorem on Stability for periodic Orbits

slide-34
SLIDE 34

Chaotic behavior for most values of a > 3.57

f(x) = a x(1-x)

Family of Logistic Maps: a = 4

a > 3.57

a = 4

slide-35
SLIDE 35

a

f(x) = a x(1-x)

Family of Logistic Maps:

Bifurcation Diagram

slide-36
SLIDE 36