Calforna State Scence Far Mathematcal Modelng of Real World Systems Part 1 -- Explorng on Chaos on Your Computer Edward Ruth drruth@x.netcom.com 1) Introducton Mathematcs s the language that scentsts use to descrbe the unverse n whch we lve. If we can wrte down the set of equatons that govern any system then we can use those equatons to study the system. We call that set of equatons a mathematcal model of the system. (When I speak of a system I am talkng about lookng at a collecton of thngs and how they nteract. For example all of the mechancal and electrcal parts of a space vehcle are a system. The planets, moons, and stuff orbtng the sun are a system. A bunch of frogs n a pond are a system.) We use mathematcal models to study complex systems and how they wll respond to dfferent condtons. These models allow us to do "experments" on large systems that would be totally mpractcal n the real world. We use math models to study every knd of complex system from fnancal markets, to explodng supernovas, to the combuston process n an automoble engne. That s the power of numbers and why we use them. Wth the advent of modern computers mathematcal models have become powerful tools n both pure and appled scence and every day newer and better models for studyng ever more complex systems are developed. Not that many years ago many scentsts beleved that f we had the correct math model for any complex system t would be possble to use that math model to predct the state of that system n the future. For example we all know that t s possble to predct the moton of a the planets and moons over a perod of many years. We know just when to expect Halley's comet to reappear n our skes. To these scentsts the unverse followed a completely determnstc, predctable path. Isaac Newton's legacy was that f we had the perfect math model (and were smart enough to solve t) we could predct the future state of any system n the unverse. We now know ths s not completely true. The problem s chaos, the underlyng randomness and unpredctablty n many systems, and what t does to our math models. A good example of ths s predctng the weather. We all know that predctng the weather s mportant and that the forecasters are gettng pretty good at t. But have you every notced that the forecasts are never for more than a few days nto the future? Is that because our math models of the weather are ncomplete? The weather s certanly a complex system. Perhaps wth more powerful supercomputers and even more complcated math models we could do long term weather forecasts. Alas n the 196's Edward Lorenz showed that ths was not the case. The weather s chaotc. Even wth a perfect math model of the weather t s not possble to predct t very far nto the future. The reason s called the butterfly effect. Suppose you dd have a complete math model of the weather. To use t to predct the future weather condtons you would have to know today's weather condtons to use as a startng pont for you model. We call these startng ponts the ntal condtons. What Lorenz showed was that for a math model of the weather two sets of ntal condtons wth only very tny dfferences led to two completely dfferent predctons of the weather. You were screwed because some slly butterfly beatng ts wngs n South Amerca would not be accounted for n your ntal condtons and would relatvely quckly cause the output of you math model to start to devate from the observed weather condtons! The work of Lorenz and others has gven us a new way to look at the unverse. We know understand that t s not as predctable as we had hoped. Chaos rules. But out of ths chaos s comng some new understandng as to how to model systems and how to use these models to understand our unverse. In ths lesson we are gong to look at modelng a smple system on our PCs. Ths smple model wll reveal much about chaos and how t works.
I want you to experment wth the numbers as we work our way through the lesson and watch how the results change. Try to thnk about what you see gong on and how t mght relate to a real world system. Just watch out for those kller butterfles! 2) Populaton Modelng -- the Logstcs Equaton The math model we wll be usng s one that has been used a long tme by bologst to study the dynamcs of populatons of lvng thngs. It s called the logstcs equaton. Although t s too smple to be a model of a real system t s wonderfully complex and smulates the more nterestng aspects of real populatons. And as t turns out t smulates chaos too! Here s our math model: x+ 1 = l x( 1-x) The logstcs equaton s a recursve relatonshp. That s each value of x depends on the values of x that came before t. The subscrpts on x are ndces. The frst value or x s the ntal condton. x 1 s calculated from x by: and for x 2 : x = l x ( 1-x ) 1 x = l x ( 1-x ) 2 1 1 You can see how each new value of x depends on the prevous one. In fact t depends on all of the prevous ones! Let's substtute x for x 1 n the formula for x 2: x = ll ( x ( 1-x ))( 1-lx ( 1- x )) = lx ( x -1) 1- lx + lx o 2 2 2 The hdden complexty n our smple equaton s now very evdent. Each new value has an even more complcated relatonshp wth the ntal condton. Why don't you try wrtng down the value for x 3 n teams of x to what that would look lke. We are now ready to buld our math model of a populaton. Now we thnk of populatons as beng whole numbers of crtters. Snce x can be a fracton how does t represent the number of crtters n a populaton? The term x represents a normalzed number of crtters n a populaton. When a term s normalzed we have dvded t by some reference qualty. x Number of crtters Reference number of crtters
Our model wll track 5 cycles wth an ntal condton of.3. The parameter λ s very mportant for our model. Observe the result when we graph the equaton. Try λ =.25, 1.25, 2.25, 3.3, 3.5, & 4. The number of cycles => N 5.. N The ntal condton => x 1.3 x 2.3 x 3.3 x 4.3 x 5.3 x 6.3 The logstcs equaton => x.. 1 λ x 1 x x 1 ( 5). x. 1 1 x 1 x 2 ( 1.25). x. 2 1 x 2 1 1 x 3 ( 2.25). x. 3 1 x 3 x 4 ( 3.3). x. 4 1 x 4 1 1 x 5 ( 3.5). x. 5 1 x 5 x 6 ( 4). x. 6 1 x 6 1 1
1 Logstcs Equaton.8 x 1 Lambda = 5
1 Logstcs Equaton.8 x 2 Lambda = 1.25
1 Logstcs Equaton.8 x 3 Lambda = 2.25
1 Logstcs Equaton.8 x 4 Lambda = 3.3
1 Logstcs Equaton.8 x 5 Lambda = 3.5
1 Logstcs Equaton.8 x 6 Lambda = 4
Okay. What do you see? For λ less that 1 our crtters quckly become extnct. That s after enough tme cycles the value of x goes to zero ndcatng that the crtters are all gone. (An nterestng result for us, but not too good for them.) For λ =1.25 the number of crtters falls from the ntal value untl a stable, constant populaton s reached. When we say the populaton s stable and constant that means that the number of anmals s not changng wth tme. For ths case the ntal number of crtters s too hgh for that avalable resources. That s why the populaton falls untl t reaches a sustanable level. For λ =2.25 the number of crtters ncreases from the ntal value, overshoots and then reaches a stable populaton. For ths case the ntal number of anmals was less than the sustanable level. For λ = 3.3 the number of crtters ncreases from the ntal value and then oscllates between two dfferent values forever. Now ths s a stable stuaton (through t mght be a lttle hectc for the crtters). Wth λ =3.5 somethng nterestng happens agan. Now we have a stable populatons that oscllates between four dfferent values! And λ =4 thngs are really nterestng! The populaton s chaotc! After many cycles the populaton never reaches a stable value. The populaton trace s totally random and never repeats. Can real populatons be chaotc? Well, what do you thnk?
3) The Butterfly Effect Can we use the logstc equaton to demonstrate the butterfly effect? You bet. We can do ths by plottng the logstc equaton twce. The only dfference between the two models wll be the ntal condton. We wll start wth the case where the populaton s stable ( λ =2.25). We wll then go back and redo the experment wth a value for λ where the system s chaotc and observe the dfference. Set lambda for a stable populaton => λ 2.25 The number of cycles => N 5.. N The frst model => x.3 x.. 1 λ x 1 x The second model => y.31 y.. 1 λ y 1 y Demonstraton of Butterfly Effect.5 x y.3 As we expected the two curves just lay on top of each other for λ =2.25. The small dfference n the ntal condton s not notceable. No go back and reset to λ =4. What do you see now? The butterfly effect shows how after a whle the two curves go ther own dfferent way. Can you thnk of other experments to try wth the logstcs equaton?
Set lambda for a chaotc populaton => λ 4 The number of cycles => N 5.. N The frst model => x.3 x.. 1 λ x 1 x The second model => y.31 y.. 1 λ y 1 y 1 Demonstraton of Butterfly Effect x y.5
Suggested Further Readng 1) Gleck, J, Chaos: Makng a New Scence, Vkng, 1987. (Ths s an ntroductory book for hgh school students at all levels. It s too lght on math for advanced students and t has some warts.) 2) Hall, N., ed., Explorng Chaos: A Gude to the New Scence of Dsorder, W. W. Norton & Company, 1991. (A much deeper and better wrtten ntroductory book.) 3) Morrson, F., The Art of Modelng Dynamc Systems: Forecastng for Chaos, Randomness, & Determnsm, John Wley & Sons, 1991. (Ths s a good book for the more advanced hgh school student. I really lke t.) 4) Thompson, J.M.T. and Stewart, H. B., Nonlnear Dynamcs and Chaos: Geometrcal Methods for Engneers and Scentsts, John Wley & Sons, 1986. (Hard gong. Only for the most advanced students.)