Professional Documents
Culture Documents
Separable equations
f ( x, y ) = h( y)
g ( x) h( y)
dy = g ( x) dx
h ( y ) dy = g ( x ) dx
H(y) = G(x) + const dy sin x =y 1 + y2 dx
Rearrange: Integrate 1
dy 1 + y 2 dy 1 = + y = sin x y dx y dx
h = dH/dy; g = dG/dx
y + y dy = ln y + 2 y = sin x dx = cos x + 2 A
2
0 + = 1 + A A = 3 ln y + 1 2 3 y = cos x 2 2 (*)
ln y = ln y2
ln y 2 + y 2 = 3 2cos x
End of Lecture 7
Cannot give explicit solution for y, but clearly periodic with period 2. For some quantity u, the value of u + ln u is a monotonically increasing function of u. The minimum value of the right-hand-side of (*) is 32 = 1, at x = 2n, and the maximum value is 3+2 = 5 at x = 2(n+1).
56
Separable equations
4 3 2 1
Increasing A
2.5
7.5
10
12.5
15
17.5
ln y 2 + y 2 = A 2cos x ; red A=3; green A=4, blue A=5, black A=6; magenta A=0.5, cyan A=0.1, dark grey A=0.01. [See S3_1_FamilyOfSolutionsForSeparableEquation.nb] As A , y and dominated by y2 ~ A amplitude of oscillation becomes small. As A , y 0 and dominated by ln y2 ~ A amplitude of oscillation becomes small. Isoclines: contours of constant dy/dx.
Here vertical lines at x = n (where dy/dx vanishes) are isoclines Can be helpful for sketching solution.
yt2 + 2ln yt = A + 2
2 yb + 2ln yb = A 2
57
First order nonlinear equations Look for extremum dB/dA = 0 1 1 + B 1 B BY + B + =0 2Y + B Y B Substitute back
B+ 1 Y B (Y + B ) B 1 =B 2 = B 1 2 =0 2 2 2 2 2 Y B Y B Y B
Separable equations
Y2 = B2 + 1 Y = (B2 + 1)
1 B2 + 1 + B B B + 1 + ln 1 = 0 2 B2 + 1 B
2
Here we wish to map out the solution, without directly solving the ode. Construct the flow, i.e. arrows showing the slope. dy/dt = t at y = 0. For |y| large, then dy/dt large and negative. For |y| < 1, then dy/dt > 0.
58
Separable equations
1.5
1.0
0.5
dy/dt
0.0
-0.5
-1.0
-1.5
-2.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
t
[Fields produced by Flow.dfc]
Arrows are vectors showing direction of solution; the flow. Arrows often referred to as flow vectors. Note that since f(t,y) is single valued then solutions cannot cross.
59
Separable equations
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-2.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
Can draw on solution easily using arrows. There is an analogy between the flow vectors and velocity vectors in a fluid flow, and between the solutions and streamlines. Note: solutions drawn with uniform spacing for y(0), but only up to y(0) = 4.
2.0
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-2.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
The green lines are orthogonal to the red ones. These might represent, for example, height contours above a plane, or contours of constant potential (see IB Fluids next year). Note potential contours drawn with uniform spacing for t at y = 2.
60
Separable equations
To construct this map of the solution we did not require the equation to be separable. However, since it is, we can determine the analytical solution. 1 dy 1 1 1 dy dy = + = t (1 y 2 ) =t 2 dt 1 y dt 2 1 y 1 + y dt Integrating
y=
1 1 1+ y 1 2 ln 1 + y ln 1 y = ln 2 1 y = 2 t + c 2
1+ y = Aet = et 1 y
2
+c
Aet 1 Ae + 1
t
2
Aet 1 Ae 1
t
2
et e
+c
t +c
Note: We could have approximated the behaviour for large |y| without solving the exact equation by dy 1 dy 1 1 2 noting that 1 y2 y2 so t t 2 + const y 2 2 for ty 2 2 dt y dt y 2 t t0 some arbitrary t0. Exploring the behaviour c > 0 y(0) > 0 c < 0 y(0) < 0 y = tanh (t2+c) has 0 < y < 1; y 1 as t y = coth (t2+c) has y > 1; y 1 as t y = tanh (t2+c) has 1 < y < 1; y 1 as t y = coth (t2+c) has y < 1; y as t
3.1.4 ISOCLINES
These are contours of constant slope, i.e. f(t,y) = const. For the previous example, f(t,y) = t(1y2),
61
Separable equations
1.5
c<0
1.0
0.5
0.0
c>0
-0.5
-1.0
-1.5
c<0
-2.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
t
Note: All curves asymptote to t = 0 and y = 1. This emphasises that approach to stable equilibrium (and departure from unstable equilibrium) is faster at high t. In the earlier example given by y2 (2/) y sin x + 1 = 0 y= sin x y sin x dy sin x =y , we can set f = = , say. The isoclines are therefore 2 dx 1+ y 1+ y2 2
sin 2 x
for || 1
For solution to exist, require sin2x 2 > 0. When sin x = , then y = 1 and location of isoclines is single-valued so they must be vertical at y = 0. As dy/dx = 0 when sin x = 0, then x = n must have vertical isoclines with = 0. Upper branch of isocline has y = sin x
sin 2 x
1 2
sin x
as || becomes small.
62
Stability
4.0
3.5
3.0
2.5
2.0
1.5
1.0
0.5
0.0 0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
>0
Yellow line: sin x Red line: cosec2x.
t
<0
>0
End of Lecture 8
3.2 Stability
The technique we shall explore here is not really necessary for first order odes, but is much more useful for higher order odes.
63
Stability
3.2.1 PERTURBATION
Suppose that y = y0 is the equilibrium solution, i.e. f(t,y0) = 0. Consider the behaviour of y = y0 + u where 0 < $ 1 and u = u(t) = O(1) For the example used in 3.1.2 Substitute into the ode: dy = t (1 y 2 ) , y0 = 1 and consider y = 1 + u. dt d 2 ( y0 + u ) = t 1 ( y0 + u ) dt
du = t 1 ( y0 2 + 2 y0u + 2u 2 ) = t u ( 2 y0 + u ) dt du 2ty0u dt
u u0e y0 t u u0 e t
2
y0 = 1
u u0 e t
As we shall see, a solution is stable if f/y < 0 and unstable if f/y > 0, but what if f/y = 0?
3.2.2 SEMI-STABLE
Consider dy 2 = (1 y ) f ( y ) 0 dt
Equilibrium solution requires f(y) = 0 y = 1. Since f is independent of t, all solutions have the same shape.
64
Stability
3.0
2.5
2.0
1.5
1.0
0.5
0.0
-0.5
-1.0 0.0
0.5
t0
1.0
1.5
2.0
2.5
3.0
3.5
4.0
t
Solutions for y < 1 converge on equilibrium y = 1, but for y > 1 solutions diverge. The equation is separable:
(1 y )
dy =
1 1 = t t0 y = 1 t t0 1 y
Stability
For t > t0, y ~ 1 1/t 1 from below as t . For t < t0, y ~ 1/(t0 t) + as t t0 from below, so y rises from - as t increases from t0. Stability analysis: let y = 1 + u d du 2 (1 + u ) = = (1 1 u ) = 2u 2 dt dt du = u2 0 dt
65
Stability
1. Find fixed points (equilibrium solutions) by solving f(y,t) = 0 to find solutions with y = const t. [It is not sufficient for dy/dt to vanish for only some period of time.] 2. Expand f about an equilibrium solution y = y0, say. Note: Each equilibrium solution must be investigated separately. a. y = y0 + u, say, and expand f in Taylor series about y = y0: b. f ( y, t ) = f ( y0 , t ) + u f y 1 2 f + u2 2 2 y +!
y = y0
y = y0
y = y0
Solutions:
If f y = ( t ) 0 , then
y = y0
if > 0 unstable 0 if < 0 stable. If (t) changes sign as t varies, then must study with greater care; may be stable or unstable. Fortunately, there are a large number of problems in which f is independent of t, so is constant. If = 0 t, then du 1 2 f u 2 with ( t ) = dt 2 y 2 1
y = y0
u 2 du = u = dt
u=
1
dt
66
Stability
2 f dy f 2 = (1 y ) = 2 ( y 1) , = 2 , so at y = 1 equilibrium, dt y y 2
1 and semi-stable. 2 ( t t0 )
Recall that f/y indicates the stability of the fixed points. When f/y < 0 the solution is stable as dy/dt will become negative if a perturbation moves y above the fixed point, thus causing it to move back towards the fixed point. Conversely, f/y > 0 leads to dy/dt increasing as we move away from the fixed point, giving an unstable solution. A stable fixed point is an attractor, while an unstable fixed point is a repellor. The semi-stable equation dy 2 = (1 y ) explored in 3.2.2 has the attractor and repellor merging: dt
67
Exact equations
dy/dt
End of Lecture 9
Consider 3xy 2
This equation is neither linear nor separable. Can we solve it? By inspection we can see 3xy 2
d dy = f ( x, y ) and = g ( x, y ) . = + , so we need y x dx y dx x
68
First order nonlinear equations = 3xy 2 = xy3 + A(x), y = y 3 + 2 x = xy3 + x2 + B(y), x where A(x) and B(y) are the constants of integration. Now the two expressions for must be identical, so A(x) = x2 + c and B(y) = c, thus
Exact equations
= xy3 + x2 + c.
However, not all equations are exact, so this procedure is not always possible.
2 2 f g Since , then we must have = ; can therefore test to see if an exact differential = x y xy yx is possible before trying to find it!
3xy 2
3x 2 y 2
Integrating f = /y = x2y3 + A(x) Integrating g = /x = x2y3 + B(x). Equating = x2y3 + const, hence y = cx2/3. Here we have converted the equation into an exact equation by multiplying it by an integrating factor (here x).
dy + g = 0. dx
69
Examples ( x, y ) = f dy + A ( x ) ( x, y ) = g dx + B ( y )
Unfortunately, determining by solving (*) may be as difficult (or impossible) as solving the original differential equation. [Of course, equations on the Examples Sheet may be possible] [Finding appropriate A(x) and B(y) is typically more straight forward.] Sometimes the solution of (*) may be simplified by proceeding on the assumption that is a function of x or y alone. 3xy 2 dy + 2 y3 = 0 dx [Our previous example] [We already know = x works!]
as before!
Note that the integrating factor is therefore not unique. Since the solution has y ~ x2/3, then ~ y3/2 ~ x, the previous integrating factor. Moreover, one would expect any combination of x and y that is equal to the integrating factor x would also be an integrating factor, e.g. = x1y3.
3.4 Examples
3.4.1 CHEMICAL KINETICS
Consider the chemical reaction X + Y U + V e.g. NaOH + HCl H2O + NaCl Suppose the concentration of X is x(t), of Y is y(t) and U is u(t) (the reaction gives equal quantities of U and V, so v(t) = u(t)). If x(0) = x0, y(0) = y0 and u(0) = 0, then the conservation relations give x + u = x0 and y + u = y0. Suppose the reaction rate r is xy, where = (T) Then [Note that if 2X + Y, then x2y, etc.] du = r = xy = ( x0 u )( y0 u ) f ( u ) . dt
Fixed points (equilibria) are where f(u) = 0 u = x0 and u = y0 (i.e. all of one of the species is converted). 70
Examples
Need to keep in mind the physical meaning of x and y: clearly cannot have a negative concentration! We shall assume x0 < y0 (the converse may be treated similarly). The phase portrait may then be drawn: f
x0
y0
As u(0) = 0, we have the reaction rate f(u) decreases monotonically towards the equilibrium u = x0. u
y0 x0
1 ln ( x0 u ) ln ( y0 u ) = ( t t0 ) y0 x0 y0 u t t =e ( x0 u
u 1 Ae
0
)( y0 x0 )
= Ae
t ( y0 x0 )
t ( y0 x0 )
)= y
x0 Ae
t ( y0 x0 )
71
First order nonlinear equations Noting that u(0) = 0 gives A = y0/x0 so u = x0 y0 e y t e x t y0e y t x0e x t
0 0 0 0
Examples u= x0 Ae y t y0e x t . Ae y t e x t
0 0 0 0
Note: Problems such as this including the derivation of the ode(s) are fair game for examiners. Maths is not only about solving the equations, but also about deriving them and drawing conclusions from the solutions. In Part IA the examiners would help you with any derivation required in an exam.
First order nonlinear equations The phase portrait shows critical points (fixed points or equilibria) at y = 0, Y. f
Examples
Y Y/2 y
The y = 0 fixed point has f/dy > 0 so is unstable, whereas at y = Y f/dy < 0 so the fixed point is stable.
73
Examples
3.0
2.5
2.0
1.5
y
positive curvature negative curvature
1.0
0.5
0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
t
Clearly, y = Y is a stable equilibrium, whereas y = 0 is unstable. Logistics equation is separable and can be solved explicitly: 1 dy 1 1 dy = + =r y dt y Y y dt 1 y Y ln y = rt + c Yy y = Ae rt Yy
74
Examples
which gives y Y as t . But can population really rise from just above zero? With careful management it is possible (e.g. Old Blue see later), but in general
Mating opportunities
Individuals need to find mates to procreate. This can become difficult when population densities are very low. The probability of finding a mate is similar to the probability of fighting over food and is again proportional to y2. Of course, fighting or procreating depends on who meets! For low population densities (where fighting is not an issue) the birth rate is y2, while the death rate remains y, so dy y = y + y 2 = 1 y f ( y ) dt X This equation has the same structure as previously, with critical points at y = 0 and y = X.
3.0
2.5
2.0
1.5
1.0
0.5
0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
t
Now, y = X is unstable, so if population falls below y = X, then it will fall to zero and extinction!
75
Examples
Passenger pigeon
The North American passenger pigeon is one of the most famous recent examples of extinction. In mid 19th century, y ~ 109, the most numerous bird on earth. Widely hunted for sport and food in late 19th century; as many as 30,000 shot at a time! By 1896 only 250,000 remaining Extinct by 1900. Extinction was ultimately caused not by hunters killing the remaining birds, but by their inability to find mates. Their extinction was one of the early triggers for conservation. [Lots of information on the web.]
76
Examples
http://www.kcc.org.nz/birds/blackrobin/oldblue.asp
The New Zealand black robin is an extreme example: in 1980 there was only a single breading female and four males. Now there are around 250 and the population is growing.
Clearly equilibria are y = 0, Y, Z, with two stable and one unstable fixed points.
77
2.5
2.0
1.5
1.0
0.5
0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
t
Stable equilibria at y = 0, Z, and unstable at y = Y.
78
3.5.2 STABILITY
Similar to what we did for the differential equations. Near un = 0, have un2 $ |un| un+1 un un n u0 Hence unstable if || > 1. Now since = 1 + , and = r dt > 0, then un = 0 unstable equilibrium. Near un = U = ( 1)/, suppose un = ( 1)/ + vn |vn| $ U
1 1 1 1 1 + vn +1 = 1 vn + vn = vn + vn 1 2 = + (1 ( 1) ) vn vn 1 2 = + ( 2 ) vn vn
vn +1 ( 2 ) vn
Stable if |2 | < 1
vn ( 2 ) v0
n
=r dt will be small, so < 3 as required for stability. However, for real populations, the
If we are using the difference equation as an approximation to the logistic differential equation, then
population may be better approximated by the difference equation than the differential equation. For example, most births occur at almost the same time in the breeding season, so may represent a whole year, or even a whole generation, thus the meaning of may be different and may not be close to 1. Following the same arguments as for the stability of differential equations (3.2.3), we can relate the stability to the gradient in the difference formula. Let Then u=U+v u = U is equilibrium solution
un +1 = U + vn +1 = f ( un ) = f (U + vn ) f (U ) + vn f (U )
79
First order nonlinear equations so we require for stability (vn 0 as n ). For the current equation, we therefore require
vn +1 f (U ) < 1 vn
d f = ( (1 u ) u ) = (1 2u ) u du is less than unity when u =U = ( 1)/ (the equilibrium solution). Substituting 2 = 2 < 1,
1 2 +
which gives the same result as before.
80
0.8
0.8
0.6
0.6
0.4
u
0.4 0.2 0.2 0.0 0.0 2.0 4.0 6.0 8.0 10.0 0.0 0.0
2.0
4.0
6.0
8.0
10.0
1.0 Key
lambda = 2.80 U = 0.64 y0 = 0.20 y0 = 0.40 y0 = 0.60 y0 = 0.80 y0 = 1.00
1.0 Key
lambda = 3.20 U = 0.69 y0 = 0.20 y0 = 0.40 y0 = 0.60 y0 = 0.80 y0 = 1.00
0.8
0.8
0.6
0.6
0.4
u
0.4 0.2 0.2 0.0 0.0 2.0 4.0 6.0 8.0 10.0 0.0 0.0
2.0
4.0
6.0
8.0
10.0
The = 1.5 and = 2.8 solutions are stable and approach the equilibrium solution u = U. The convergence can be monotonic, or oscillatory. Why?
81
un+1
82
un+1
un Initial convergence changes to a steady oscillation with period two. The appearance of this new oscillatory solution is called a bifurcation. In this case the period two oscillation is stable; the original solution still exists but it is now unstable. The phenomenon is called period-doubling. At = 3.449 there is a second period-doubling bifurcation in which the period two solution becomes unstable and a stable period four oscillation appears.
83
un+1
0.8
0.6
u
0.4 0.2 0.0 0.0
2.0
4.0
6.0
8.0
10.0
un
For slightly larger get another period doubling to an oscillation with period eight, then to sixteen, etc., with values of converging to c = 3.5699
84
1.2
1.0
0.8
0.6
0.4
0.2
0.0 1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
lambda
When < 1, the difference equation converges on u = 0. In the range 0 < < 3 a steady solution is obtained with u = ( 1)/. As noted before, we have a bifurcation at = 3 to a period two oscillatory solution (hence two values of u are observed). From 0.3499, four solutions are observed following a period-doubling bifurcation. Increasing further results in additional perioddoubling bifurcations until = c = 3.5699. Beyond this point all periodic solutions are unstable and we have deterministic chaos (the nearly solid black bands in the figure). Typically two solutions that may be close together at one n diverge rapidly as n increases.
85
3.5.6 BANDS
0.9
0.8
0.7
0.6
P8 P4 P16
0.5
0.4
0.3 3.5
3.52
3.54
3.56
3.58
3.6
lambda
For > c there are intervals of values of in which stable periodic orbits exist. These attract almost all initial conditions and so show up as clear bands in the diagram. If we look hard enough it turns out that there is an interval containing a stable periodic orbit of every integer period.
86
0.54
0.53
0.52
0.51
0.5
0.49
0.48
0.47
0.46 3.568
3.57
3.572
3.574
3.576
3.578
lambda
For > c there are intervals of values of in which stable periodic orbits exist. These attract almost all initial conditions and so show up as clear bands in the diagram. If we look hard enough it turns out that there is an interval containing a stable periodic orbit of every integer period. For > 4, typical initial conditions are mapped out of the interval [0,1] and of to .
First order nonlinear equations The term in square brackets provides additional roots un = 1 + 2 2 3 2
(**)
provided 2 2 3 > 0 < 1 or > 3. The new roots exist when 3 and correspond to the new period two orbit. From a perturbation analysis we can show that they are stable for close to 3; in this case the period-doubling bifurcation is termed supercritical. Note that at = 3, the new root is a double root with un = 2/3, whereas the equilibrium root also has un = 2/3. In 3.5.2 we saw that |f/u| < 1 for stability of the equilibrium solution. We can use the same ideas here for the oscillatory solution, where we have un = f(f(un)). The stability boundary therefore requires
f ( f ( u ) ) u = 2 (1 2u ) (1 2u + 2u 2 ) = 1
Substituting in either of the oscillatory solutions (**) and simplifying gives 4 + 2 2 = 1, with roots = 1 6, = 1, = 3 and = 1+ 6. Only the last two of these are relevant, and show that the period two solution is stable for 3 < < 3.449. We may repeat this analysis to find where the period four values of un become possible by setting un+4 = un. This leads to a sixteenth order polynomial for un, sharing the four roots of the period two orbits. Plotting the difference equation, looking for potential orbits up to period eight, shows how the structure becomes more complex as increases, with each successive bifurcation adding a new periodic solution branch on top of a previously stable branch of periodic points that is now unstable.
88
0.8
0.8
0.6
0.6
u(n+?)
u(n+?)
0.4
0.4
0.0 0.0
0.2
0.4
0.6
0.8
1.0
0.0 0.0
0.2
0.4
0.6
0.8
1.0
u(n)
u(n)
1.0
1.0
0.8
0.8
0.6
0.6
u(n+?)
0.4
u(n+?)
0.4 lambda= 3.50 0.2
u(n+1) u(n+2) u(n+3) u(n+4) u(n+5) u(n+6) u(n+7) u(n+8)
0.0 0.0
0.2
0.4
0.6
0.8
1.0
0.0 0.0
0.2
0.4
0.6
0.8
1.0
u(n)
u(n)
89