Introduction to dynamical systems: A hands-on approach with Maxima
Full text
Introduction to Introduction to Dynamical Systems Dynamical Systems A HANDS-ON APPROACH WITH MAXIMA Jaime E. Villate 9 789729 939600 ISBN 972-99396-0-8
Introduction to Dynamical Systems A Hands-on Approach with Maxima Jaime E. Villate University of Porto College of Engineering Porto, Portugal
Introduction to dynamical systems: a hands-on approach with Maxima Copyright c 2006 Jaime E. Villate E-mail: [email protected] This work is licensed under the Creative Commons Attribution-Share Alike 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. ISBN: 972-99396-0-8 This is a partial translation of the Portuguese version 1.2 of February 27, 2007. The cover figure is the Julia set for the complex number −0.75+i0.1, with 48 iterations, as explained in chapter 12.
Contents Preface ix 1 Introduction 1 1.1 Differential equations ............................ 1 1.2 Solving physics problems with Maxima .................. 1 1.3 References .................................. 7 1.4 Multiple-choice questions .......................... 7 1.5 Problems .................................. 8 2 Discrete dynamical systems 9 2.1 Discrete systems evolution ......................... 12 2.2 Graphical analysis .............................. 12 2.3 Fixed points ................................. 15 2.4 Periodic points ............................... 17 2.5 Solving equations numerically ....................... 19 2.5.1 Iteration method .......................... 20 2.5.2 Newton’s method .......................... 22 2.6 References .................................. 23 2.7 Multiple-choice questions .......................... 23 2.8 Problems .................................. 24 3 Continuous dynamical systems 27 3.1 First-order differential equations ...................... 27 3.2 Direction fields ............................... 29 Bibliography 31 Index 33
List of Figures 1.1 Power dissipated in a resistor ........................ 4 1.2 Trajectory of a particle ........................... 7 2.1 Evolution of yn+1=cos(yn)with y0=2. .................. 13 2.2 Staircase diagram for xn+1=cos(xn)with x0=2. ............. 13 2.3 Solutions of the system yn+1=y2 n−0.2. .................. 14 2.4 Solutions of the discrete logistic model ................... 15 2.5 Newton’s method for finding roots of an equation. ............. 22 3.1 Direction field of the equation y0=y+x.................. 29
Preface This book is updated very often. The number of the current version can be found on the second page and the most recent version can always be found on the Web at http:// fisica.fe.up.pt/maxima/dynamicalsystems . This version has been written to be used with Maxima’s version 5.11. (http://maxima.sourceforge.net). This book started as the lecture notes for a one-semester course on the physics of dynamical systems, taught at the College of Engineering of the University of Porto, since 2003. The subject of this course on dynamical systems is at the borderline of physics, mathematics and computing, and it substituted a course on classical mechanics that we used to teach to students majoring in computing engineering. Since dynamical systems is usually not taught with the traditional axiomatic method used in other physics and mathematics courses, but rather with an empiric approach, it is more appropriate to use a practical teaching method based on projects done with a computer. The study of dynamical systems advanced very quickly in the decades of 1960 and 1970, giving rise to a whole new area of research with an innovative methodology that gave rise to heated debates within the scientific community. The innovative boost was fueled by the rapid development of computers. A new generation of researchers rose, who used their computers as laboratories for experimenting with equations discovering new phenomena. The traditional mathematicians criticized that approach for the lack of a rigorous mathematical foundations for those new results. Many of those results were found within the framework of physical problems: non-linear dynamics, condensed-matter physics and electromagnetism. However, many physicists regarded that new research field simply as a computer simulation of old physical concepts long established, without any new physics in it. A usual comment would be: “this is all very nice, but where is the physics in it?”. Thus, the pioneers in this new field of dynamical systems would be often confronted with rejected publications in scientific journals and negative assessments of their work. On the other hand, their activities awakened a strong interest that increased very quickly and were viewed by some as a refreshing new trend; the methods used in the study of dynamical systems match well with the working environment of modern scientists. The new paradigm spread to teaching and the traditional courses on physics and mathematics have been gradually “infected” with this new experimental/ computational methodology, contrasting with the traditional axiomatic method. As it happened in the scientific community, the new methodology has also led to some debate among teachers; at the same time, it has awakened big interest as a better way to motivate today’s students. Subjects such as
6Introduction the constant %e in Maxima represents the Euler number, e . To find the position, velocity and acceleration at t=0, we use the following commands (%i11) r, t=0, numer; (%o11) [5, 2] (%i12) v, t=0, numer; (%o12) [0, .08333333333333333] (%i13) a, t=0, numer; (%o13) [- 2, - .006944444444444444] The argument numer , was used to get the result in floating-point form. In vector notation, the results we obtained are: ~r(0) = 5~ex +2~ey ~v(0) = 0.08333~ey ~a(0) = −2~ex −0.006944~ey For t=15 s the results are obtained in a similar way (%i14) r, t=15, numer; (%o14) [- 6.202090382769388, 2.71349520313981] (%i15) v, t=15, numer; (%o15) [.7468060255179592, .02387539973834917] (%i16) a, t=15, numer; (%o16) [0.0497870683678639, - .001989616644862431] The limiting values when times goes to infinity can be calculated with Maxima’s command limit; the symbol used in Maxima to represent infinity is inf (%i17) limit(r,t,inf); (%o17) [5, 3] (%i18) limit(v,t,inf); (%o18) [0, 0] (%i19) limit(a,t,inf); (%o19) [0, 0] Thus, a particle will approach the point 5~ex+3~ey, where it will remain at rest. To plot the graph of the trajectory we will use the option parametric of the command plot2d . the x and y components of the position vector will be given separately; the command plot2d will not accept them inside a list as we have been using them. To get the first element of the list r ( x component) is labelled as r[1] and the second element r[2]. (%i20) plot2d([parametric,r[1],r[2],[t,0,60],[nticks,100]]); The time domain, from 0 to 60, is defined with the notation [t,0,60] . The option nticks was used to increase the number of intervals of t , because the default value of 10 intervals would render a broken curve instead of a continuous trajectory. The graph obtained is shown in figure 1.2.
1.4 Multiple-choice questions 7 Figure 1.2: Trajectory of the particle during the first 60 seconds, from the initial instant when twas equal to 5.2 . 1.3 References For more information about Maxima, see appendix A and the Maxima Book (de Souza et al.,2003). 1.4 Multiple-choice questions 1. Only one of the following Maxima commands is correct. Which one? A. solve(t-6=0,u-2=0,[t,u]); B. solve(t+4=0,u-4=0,t,u); C. solve([x^3+4=2,y-4],x,y); D. solve(x-6=0,y-2=0,[x,y]); E. solve([t+3,u-4],[t,u]); 2. Newton’s second law was defined in Maxima with: (%i6) F = ma; which Maxima command should be used to compute the value of the force corresponding to a mass of 7 with an acceleration of 5 (SI units). A. solve(F, m=7, a=5); B. solve(F, [m=7, a=5]); C. solve(%o6, m=7, a=5); D. %o6, m=7, a=5; E. solve(F: m=7, a=5) 3. If we input the following commands in Maxima:
8Introduction (%i1) x:3$ (%i2) x=5$ (%i3) x; which will be the output (%o3)? A. 5 B. x C. 3 D. true E. 0 1.5 Problems 1. An ammeter was used to measure the current at points D and F in the circuit which diagram is shown in the figure. At point D the value obtained for the current was 0.944 mA, in the direction ADC, and at point F it was 0.438 mA, in the direction CFE. (a) Store the equation for Ohm’s law, V=IR , in a Maxima’s variable “ohm”. (b) Give a value to variable I equal to the current at point D, and substitute the resistance in Ohm’s law with each of the values 2.2 k Ω and 6.8 k Ω , to compute the potential difference in each of the resistors; repeat the same procedure to calculate the potential difference in each resistor. A6.8 kΩB3.3 kΩE 9 V F 4.7 kΩ C 6 V 1.0 kΩ 2.2 kΩ D 3 V 2. The position of a particle moving along the x axis is given by the equation x=2.5t3− 62t2+10.3t , where x is measured in meters and t in seconds. (a) Find the expressions for the velocity and the acceleration as a function of time. (b) Find the values of the time, position and acceleration in all the instants when the particle is at rest ( v=0 ). (c) Draw the plots for the position, velocity and acceleration as a function of time, for t in the interval between 0 and 20 seconds. 3. The position vector of a particle, as a function of time, is given by the equation: ~r=5.76−e−t/2.51~ex+e−t/2.51 cos(3.4t)~ey in SI units. (a) Compute the position, velocity and acceleration in the instants t=0, t=8 s, and when time goes to infinity. (b) Plot the graphs of the x and y components of the position, as a function of time, for t in the interval between 0 and 15 seconds. (c) Plot the graph of the trajectory, on the plane xy, in the interval of tbetween 0 and 15 s.
2 Discrete dynamical systems A discrete dynamical system is a system with a state that only changes at a discrete sequence of instants {t0 , t1 , t2 , ...} . In the interval between two of those instants the state remains constant. In this chapter we will only consider first-order discrete systems. In the following chapters the methods used in this chapter will be extended to the case of continuous dynamical systems. In the last two chapters of the book we will resume the study of discrete systems and we will introduce second-order systems and systems on the complex plane. A first-order system is a system in which only one variable y is needed to describe its state. The value of that variable at the instants {t0 , t1 , t2 , ...} will be a sequence {y0 , y1 , y2 , ...} . The interval of time between a consecutive pair of instants tn and tn+1 does not have to be constant, for different values of n. The evolution equation allows us to compute the state yn+1 , at an instant tn+1 , from the value of the state ynat the previous instant tn: yn+1=F(yn)(2.1) where F(y)is a known function. The equation above is a first-order difference equation. Given an initial state y0 , successive applications of the function F will generate the sequence of states yn which determine the evolution of the system. In some cases it might be possible to find a general expression for ynas a function of n. Example 2.1 Find the first four terms in the evolution of the system xn+1=cosxn , with initial state x0=2 Solution : Applying the difference equation three times, we obtain the first four terms in the sequence: {2,cos(2),cos(cos(2)),cos(cos(cos(2)))}(2.2)
10 Discrete dynamical systems Example 2.2 A loan of $ 500 is obtained from a bank, which charges a 5% yearly interest rate. The loan is to be paid in 20 months, with monthly payments of $ 26.11. What will be the amount in debt after 10 months? Solution : During the month n the amount in debt, yn , will be equal to the amount in debt in the previous month, yn−1 , plus the interests due for that month, minus the monthly payment p: yn=yn−1+j yn−1−p(2.3) where j is the monthly interest rate (in this case, 0.05/12). Using Maxima, the sequence of amounts in debt yn can be obtained by applying the above recurrence relation several times: (%i1) j: 0.05/12$ (%i2) y: 500$ (%i3) y: y + j*y - 26.11; (%o3) 475.9733333333333 (%i4) y: y + j*y - 26.11; (%o4) 451.8465555555555 (%i5) y: y + j*y - 26.11; (%o5) 427.619249537037 it would be necessary to repeat the command (%i3) ten times. The answer can be obtained in an easier way if we define a Maxima function depending on an integer variable, using the recurrence relation, and we use that function to calculate y10 directly: (%i6) y[0]: 500$ (%i7) y[n] := y[n-1] + j*y[n-1] - 26.11; (%o7) y := y + j y - 26.11 n n-1 n-1 (%i8) y[10]; (%o8) 255.1779109580579 Some care should be taken in Maxima when using functions of an integer argument. In the previous example, when we calculated y[10] , the values of y[9] , y[8] , ... , y[1] , were also implicitly calculated and stored in memory. If we changed the recurrence relation, those values that were already calculated and stored would not be updated. Thus, before
11 we change the recurrence relation, or the initial value y[0] , it is necessary to erase the previously calculated sequence, by using the command kill. For example, if the value of the loan was duplicated to $ 1000, and the monthly payment was also duplicated, will the amount in debt after the tenth payment would also duplicate? let us see: (%i9) kill(y)$ (%i10) y[0]: 1000$ (%i11) y[n] := y[n-1] + j*y[n-1] - 52.22; (%o11) y := y + j y - 52.22 n n-1 n-1 (%i12) y[10]; (%o12) 510.3558219161157 thus, the amount in debt also doubles. Another question that we might ask in the original example is: what will the monthly payment should be if instead of 20 months we would want to pay the loan in 40 months? To answer that question, we use a variable p to represent the monthly payment, we calculate the amount in debt after 40 months, as a function of p , and we equal that expression to zero to calculate the value of p. (%i13) kill(y)$ (%i14) y[0]: 500$ (%i15) y[n] := expand(y[n-1] + j*y[n-1] - p)$ (%i16) solve(y[40] = 0, p); 72970398 (%o16) [p = --------] 5366831 (%i17) %, numer; (%o17) [p = 13.59655222979818] The monthly payment should be $ 13.60. The function expand was used to force Maxima to calculate the products in every step, avoiding large expressions with several parenthesis in the calculation of yn . Some additional messages written by Maxima were omitted, which explain that some floating point numbers were represented as fractions, to prevent numerical errors.
12 Discrete dynamical systems 2.1 Discrete systems evolution The evolution of a first-order discrete system: yn+1=F(yn)(2.4) is obtained by applying successively a function Fto the initial state y0=c: {c,F(c),F(F(c)),F(F(F(c))),...}(2.5) or in a more compact form: {c,F(c),F2(c),F3(c),... yn=Fn(c)}(2.6) 2.2 Graphical analysis A graphical method to represent the evolution of a system consists on plotting a point for each step in the sequence, with x-coordinate equal to the index n and y-coordinate equal to yn . In Maxima, the function evolution in the additional package dynamics will plot that kind of graph1. Three arguments should be given to the program. The first argument must be an expression that depends only on the variable y; that expression will specify F(y)from the right hand side of the difference equation 2.1. The second argument should be the initial value y0 , and the third argument is the number of sequence elements that should be plotted. For instance, using y to identify the state variable in example 2.1, we have F(y) = cosy with initial value y0=2. To plot a graph with the first 20 terms, we use the commands: (%i18) load("dynamics")$ (%i19) evolution(cos(y), 2, 20)$ The graph obtained in (%i19) is shown in figure 2.1. Another type of diagram which will be very useful to analyze first-order discrete dynamical systems is the so-called staircase diagram , 2 which consists in plotting the functions y=F(x) and y=x , as well as an alternating sequence of horizontal and vertical segments joining the points ( y0 , y0 ), ( y0 , y1 ), ( y1 , y1 ), ( y1 , y2 ), and so on. For example, figure 2.2 shows the staircase diagram for the sequence represented in figure 2.1 The function staircase , included in the additional package dynamics , plots staircase diagrams. That function needs the same three arguments as the function evolution ; 1 Maxima’s package dynamics was added in version 5.10; if you have an older version, you must upgrade it in order to use that package. 2Also know as cobweb diagram.
2.2 Graphical analysis 13 n yn 5 10 15 1 2 −0.5 Figure 2.1: Evolution of yn+1=cos(yn)with y0=2. yn yn+1 1−1 1 2 −1 Figure 2.2: Staircase diagram for xn+1=cos(xn)with x0=2.
14 Discrete dynamical systems namely, function F(y) from the right-hand side of the difference equation 2.1, the initial value y0 and the number of steps in the sequence. The independent variable in the expression for F should always be y . You might need to make the appropriate change if the state variable is something different from yin your problem. The graph 2.2 was obtained with the command (%i20) staircase(cos(y),2,8)$ Notice that we did not have to load the package dynamics again, because it was already loaded in (%i18) . the staircase diagram allows us to understand when a sequence will converge or diverge. For instance, consider the system yn+1=y2 n−0.2 . If the initial value is y0=1.1 , we obtain the graph on the left side of figure 2.3; we see that the sequence will converge to a negative value y , which is at the intersection of the functions F(y) = y2−0.2 and G(y) = y, namely, y= (5−3√5)/10. The two functions intersect in another point, positive, equal to y= (5−3√5)/10 . In the graph we can see that even though the initial value was close to the second intersection point, the sequence moved away from it and towards the second intersection point, due to the fact that between the two intersection points the function y2−0.2 is under G(y) = y . if we used an initial value to the right of the second intersection point, for instance, y0=1.5 , the sequence grows quickly towards infinity (right-hand side in figure 2.3). To make the sequences converge to the second intersection point, it would have been necessary that between the two intersection points F(x)>G(y) ; that is to say, the slope of F(y) should be less than 1, rather that greater than 1, at the second intersection point. yn yn+1 1 1 yn yn+1 2 4 2 4 Figure 2.3: Solution to the system yn+1=y2 n−0.2 with initial values 1.1 (left) and 1.5 (right). Example 2.3 Analyze the solutions to the logistic model, which consists in considering a population P with constant natality rate, a , and a mortality rate bP , directly proportional to the population, where aand bare constants. Solution : The population under study could be a group of specimens from some animal
2.3 Fixed points 15 species, where the sequence {P0 , P1 , P2 , ...} represents the number of specimens in several consecutive years. Let Pn represent the number of specimens at the beginning of period n . during that period of time, an average aPn new specimens are born, and bP2 n specimens die. Thus, in the beginning of the next period, n+1, the population would be Pn+1= (a+1)Pn1−b a+1Pn(2.7) It is convenient to define a new variable yn=bPn/(a+1) . Thus, we obtain an equation with a single parameter c=a+1 yn+1=cyn(1−yn)(2.8) Figure 2.4 shows the solutions obtained with an initial value y0=0.1 , in the cases c=2 and c=4. With c=2, the solution converges quickly to the fixed point y=0.5. With c=4 , the state of the system goes through many different values between 0 and 1, and it does not seem to follow any regular pattern. That type of behavior is called chaotic . The state in any given period is perfectly determined from the state in the previous period, but a very small modification of the state in an initial period will lead to a completely different state in the next period. The state of the system takes different values within a small interval, without ever repeating a previous value. yn yn+1 1 1 0.5 0.5 yn yn+1 1 1 0.5 0.5 Figure 2.4: Solutions of the logistic model with an initial value 0.1. With c=2 (left) the sequence converges, while with c=4 (right) it becomes chaotic. 2.3 Fixed points A fixed point of the system 2.1 is a value y0 which, if used as initial value of the state it would lead to a constant state in later periods. That will only be possible if F(y0) = y0(2.9)
22 Discrete dynamical systems 2.5.2 Newton’s method Newton’s method can be used to find the roots of the equation 2.14. We start by assuming that there is a root of the equation at approximately value x0 and we improve that approximation by finding the point x1 where the tangent to the function at f(x0) intersects the x axis (see figure 2.5) x1=x0−f(x0) f0(x0)(2.17) We can use the same equation to further improve our guess x1 to a new guess x2 . In general xn+1=xn−f(xn) f0(xn)(2.18) x f x0 x1 f(x0) Figure 2.5: Newton’s method for finding roots of an equation. It must be noticed that the roots of a continuous function f , points where f is zero, are fixed points of the dynamical system defined by equation 2.18 3. The advantage of this method, over the iteration method, can be seen by using our analysis of the fixed points of a dynamical system. The function that generates the system 2.18 is g(x) = 1−f(x) f0(x)(2.19) the derivative of that function is g0=1−(f0)2−f00f (f0)2=f00f (f0)2(2.20) at the fixed points, f vanishes. Thus, g0 will also vanish at the fixed points. Therefore, the fixed points of 2.18 will always be attractive. It means that if the initial point x0 is chosen 3 If there are any regions where f and f0 are both equal to zero, the roots will not be isolated points, but there will be a whole interval with an infinite number of roots. In this section we will not study those kind of roots.
2.6 References 23 close enough to one of the roots of f , the sequence xn will approach it. The problem consists on finding what close enough means in each case. To illustrate the method, we will solve example 2.6 once again, using Newton’s method. The square root of 5 is one of the solutions of the equation x2=5 . Hence, to find the square root of 5 we can search for the positive root of the function f(x) = x2−5 The derivative of that function is f0(x) = 2x substituting it into the recurrence relation 2.18, we obtain xn+1=xn−x2 n−5 2xn =1 2xn+5 xn which is exactly the same sequence that we have already obtained and solved in the previous section. However, in this case we did not need to introduce any clever tricks; we just applied the standard method. 2.6 References Some useful references, with a level similar to the one used here, are Chaos (Alligood et al.,1996), A First Course in Chaotic Dynamical Systems (Devaney,1992) and Chaos and Fractals (Peitgen et al.,1992). 2.7 Multiple-choice questions 1. The state variable of a first-order, discrete dynamical system takes on the values from the following sequence: {3.4,6.8,7.2,5.1,6.8,...} what can be concluded about that system: A. it does not have any cycles with period less than 5. B. it has a fixed point. C. it is a chaotic system. D. it has a cycle of period 3. E. it has a cycle of period 2. 2. The figure shows the staircase diagram of the discrete dynamical system yn+1= y2 n−0.2 , which has two fixed points y= −0.17 and y=1.17. yn yn+1 1 1 what type of fixed point is y=1.17?
24 Discrete dynamical systems A. repulsive focus. B. attractive focus. C. attractive node. D. part of a cycle with period 2. E. repulsive node. 3. A first-order discrete dynamical system has a single fixed point at 0.739, and no cycles. Starting with an initial value 2, the evolution of the system is the sequence: {2,0.915,0.610,0.820,0.683,...} what can be said about that system? A. it is chaotic. B. the fixed point is attractive. C. it has a cycle with period 2. D. it has a cycle with period 3. E. the fixed point is repulsive. 4. A function F(x) has the following properties: F2(2) = 5F(5) = 2 thus, we can conclude that the discrete dynamical system xn+1=F(xn) has a cycle with period equal to: A. 2 B. 3 C. 4 D. 5 E. 1 5. The figure shows the staircase diagram for the first 40 iterations of a discrete dynamical system. thus, we can conclude that the system has: A. an attractive focus. B. a repulsive focus. C. a cycle with period 2. D. a cycle with period 3. E. a cycle with period 40. 2.8 Problems 1. The sequence obtained in this chapter to calculate square roots, xn+1=1 2xn+a xn was already known by the Sumerians, 4000 years ago. Using that method, calculate √3 , √15 and √234 . Use any positive initial value and represent the number a as a floating-point number (for instance, 3.0), to force Maxima to give its results also as a floating-point number. In each case, compare the result with the value obtain using function sqrt() in Maxima. 2. Assume that the current whale population in the world is 1000 and that every year the normal increase of the population (births minus deaths by natural causes) is 25%. Assuming that the number of whales killed by fishermen every year remained constant at 300 during the next years, how will the whale population evolve during the next 10 years?
2.8 Problems 25 3. Compute the first 10 terms of the sequence defined by the equation: xn+1=x2 n−2 using the following initial values: a) x0=1 b) x0=0.5 c) x0=2 d) x0=1.999 Discuss the behavior of the sequence in each case. 4. For each function in the following list, the point y=0 makes part of a cycle for the system yn+1=F(yn) . Determine the period of the cycle for each case and calculate the derivative of the function in order to determine whether the cycle is attractive or repulsive. Draw the staircase diagram of the sequence with initial value 0. a) F(y) = 1−y2 b) F(y) = π 2cosy c) F(y) = −1 2y3−3 2y2+1 d) F(y) = |y−2|−1 e) F(y) = −4 πarctg(y+1) 5. Find the fixed points and the cycles with period 2 of the dynamical system: yn+1=F(yn) and classify each point and cycle as attractive or repulsive, for each of the following cases: a) F(y) = y2−y 2 b) F(y) = 2−y 10 c) F(y) = y4−4y2+2 d) F(y) = π 2siny e) F(y) = y3−3y f) F(y) = arctg(y) In each case, start by drawing a staircase diagram using the function staircase and use it to find out the position of the fixed points and cycles; use the option domain to get a better overview of the position of the fixed points. Then try to find the points analytically. In some cases that will not be possible and the result will have to be obtained approximately from the plots. 6. Considering the sequence xn+1=|xn−2| a) Find all the fixed points. Show those points in a plot of the functions F(x) = |x−2| and G(x) = x. b) Explain the kind of sequence that will be obtained if x0 were a integer, either even or odd.
26 Discrete dynamical systems c) Find the solution for the initial value 8.2. d) Find all the cycles with period two. Show all the points in those cycles in a plot of the functions F2(x)and G(x) = x. 7. Consider the function F(x) = 2x,if x≤1 4−2x,if x≥1 a) Show that F(x)is equivalent to 2−2|x−1|. b) Plot, in the same graph, the functions F(x) , F2(x) , F3(x) and G(x) = x . What can you conclude about the fixed points and cycles of the system xn+1=F(xn)? c) Make a table or plot a graph of n against xn , between n=0 and n=100 , for each of the initial values 0.5, 0.6, 0.89, 0.893 and 0.1111111111. Discuss the results obtained. d) In the previous item, the sequence remains constant, starting at n=55 , for each of the initial values. Compute again the sequences obtained in the last item, using the following program, which uses higher numerical precision than the function evolution from the dynamics module. evolution60(f, x0, n) := block([x: bfloat(x0), xlist:[0, x0], fpprec: 60], for i thru n do (x: ev(f), xlist: append(xlist, [i, float(x)])), openplot_curves([["plotpoints 1 nolines"], xlist]) ) what can you conclude?
3 Continuous dynamical systems In this chapter we will use the abbreviated notation ˙x , ¨x , . . . to represent the time derivatives of a time-dependent function x(t) . The derivatives of a function y(x) , with respect to x , will be represented as y0,y00, . . . . Consider for example: ˙x=dx dt¨x=d2x dt2y0=dy dxy00 =d2y dx2(3.1) In Maxima those four derivatives are represented in this form: diff(x,t) diff(x,t,2) diff(y,x) diff(y,x,2) 3.1 First-order differential equations An ordinary differential equation (ODE) is an equation involving a function of only one variable, for instance y(x) , and its derivatives; the variable x may also appear in the equation. If the only derivative appearing in the equation is the first-order derivative, the equation is called a first-order ordinary differential equation. Hence, first-order ODE’s have the general form F(x,y,y0) = 0 , but we will consider only the equations that can be rewritten as one or several equations with the form y0=f(x,y)(3.2) Two examples of first-order ODE’s are the following: y0ycos(x) = 3xy2sin(y) ˙y=3−5y−y the function in question, in both cases y , is dubbed dependent variable . The variable on which the function depends is dubbed independent variable . In the first case above, the independent variable is x . In the second case, the independent variable does not appear in the equation, but from the derivative ˙yit becomes clear that the independent variable is t. A solution of a ODE, in a given interval, is any function f of one variable which satisfies that equation, when substituted for the dependent variable. A solution of the differential equation might also be given in implicit form , namely as an implicit function, as we will see in the example that follows.
28 Continuous dynamical systems Example 3.1 Show that the implicit function assim, vemos que a equação obtida é a mesma equação diferencial dada. x+y+exy =0 (3.3) is a solution of the first-order differential equation dy dx =−1+yexy 1+xexy (3.4) Solution : from the differential equation, we see that the independent variable is x . In order to prove that the given implicit function is a solution we will differentiate it in terms of x , keeping in mind that y is a function that depends on x , and we will show that the equation obtained is equivalent to the differential equation. (%i2) eq1: x + y + exp(x*y) = 0$ (%i3) depends(y,x); (%o3) [y(x)] (%i4) diff(eq1,x); x y dy dy (%o4) %e (x -- + y) + -- + 1 = 0 dx dx (%i5) solve(%,diff(y,x)); x y dy y %e + 1 (%o5) [-- = - -----------] dx x y x %e + 1 thus, we obtain the same differential equation given in the problem, which proves that the implicit function is a solution of it. In the previous example it was necessary to use the command depends to declare that y is a function that depends on x . If we did not use that command, x and y would be regarded as independent variables and the derivative of y in terms of x would be replaced by zero, rather than dy/dx. In some cases it is possible to find functions which are solutions of a differential equation. For instance, if the equation had the simple form y0=f(x)(3.5) its solutions would follow from the fundamental theorem of integral calculus y(x) = Zf(x)dx+c(3.6) where cis any arbitrary constant.
3.2 Direction fields 29 There is no general method to find the solutions of any first-order ODE. In some cases the solutions are known but they are special functions which will have to be evaluated with approximate numerical methods. Later in this chapter we will study a simple numerical method to solve differential equations, the Euler method, and at the end of the chapter we will discuss some particular kinds of differential equations which can be solved analytically. 3.2 Direction fields It is possible to obtain very important information about the solutions of an equation such as 3.2 from a simple geometrical analysis of function f(x,y) . Function f(x,y) defines, at each point in the (x,y) plane, the slope that a function y(x) should have in order to be a solution of the ODE. -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 (x0, y0) y x Figure 3.1: Direction field of the equation y0=y+x , and the solution that goes though the point (x0,y0). A direction field is a plot of the plane (x,y) , where at some points it is shown a vector with slope equal to the value of f(x,y) at that point. Hence, the solutions of the differential equation must be the curves which are tangent to those vectors. For exmaple, figure 3.1 shows the direction field of the equation y0=y+x , and one of the solutions of the equation. The direction field (figure 3.1) makes it clear that there is an infinite number of solutions to the differential equation. Every curve that can be traced following the direction of the vectors will be a solution. However, if we fix an initial point (x0),y0) on the plane, and if the function f(x,y) has a unique value at every point on the (x,y) plane, there will be only one solution that goes throught that point, because at every point the direction in which the curve must follow is uniquely defined by the function f(x,y).
30 Continuous dynamical systems The solution that goes through a given point (x0,y0) is called a particular solution . The specification of an given point is amounts to imposing a condition for the value y0 that the solution must have at an initial value of the independent variable, x0 . Thus, an initial value problem consists in finding the particular solution to a differential equation with an initial condition given: y0=f(x,y)y(x0) = y0(3.7) To plot the direction field corresponding to equation 3.2 we can use Maxima’s additional package plotdf . For instance, to plot the direction field for the differential equation y0=y+xwe use the following command: (%i6) plotdf(y + x)$ A new window will be open with a grid of vectors showing the direction field. If you move the cursor over the field, the ( x , y ) coordinates of the point where the cursor is will be shown in the lower right corner of the window. If you click on a point in the field, the solution that goes through that point will be plotted.
Bibliography Kathleen T. Alligood, Tim D. Sauer, and James A. Yorke. Chaos - an introduction to dynamical systems. Springer-Verlag, 1996. P. N. de Souza, R. Fateman, J. Moses, and C. Yapp. The Maxima book. http://maxima.sourceforge.net, 2003. Robert L. Devaney. A first course in chaotic dynamical systems: theory and experiments. Westview Press, 1992. Heinz-Otto. Peitgen, Hartmut Jürgens, and Dietmar Saupe. Chaos and fractals: new frontiers of science. Springer-Verlag, 1992.