2/1 Problem Set 2 Solution

E209A: Analysis and Control of Nonlinear Systems
Problem Set 2 Solutions
Gabe Hoffmann
Stanford University
Winter 2005
Problem 1: The method of isoclines.
We consider the system
ẋ1 = x21 − x1 x2
ẋ2 = −x2 +
(1)
x21
(2)
The equilibria are found by setting the state derivatives to zero.
ẋ1 = 0 ⇒ x21 − x1 x2 = 0 ⇒ x1 (x1 − x2 ) = 0
ẋ2 = 0 ⇒ −x2 +
x21
= 0 ⇒ x2 =
x21
(3)
(4)
Combining these results, we find that
x21 (1 − x1 )2 = 0 ⇒ x1 = 0 or x1 = 1
(5)
So, we have equilibria at (0,0) and (1,1) .
Now, on the x2 axis, x1 = 0. So, on the x2 axis, ẋ1 = x21 − x1 x2 = 0. Therefore, the x2 axis is
invariant.
The slope
dx2
dx1
is found as follows.
dx2
dt
−x2 + x21
dx2
= = 2
dx1
dx1
x1 − x1 x2
(6)
dt
2
So, dx
dx1 → ∞ when the denominator goes to zero while the numerator remains finite. Factoring the
dx2
denominator, we see that it is (x1 )(x1 − x2 ). So, when x1 = 0 or x1 = x2 , dx
→ ∞.
1
Now, to find the isoclines on which
dx2
dx1
= c for finite c.
For c = 0, from (6), we find that the isocline is −x2 + x21 = 0. So,
c = 0 on x2 = x21
1
(7)
For c = 0.5, from (6), we find that the isocline is
−x2 +x21
x21 −x1 x2
c = 0.5 on x2 =
= 0.5. So,
x21
2 − x1
(8)
For c = 1, from (6), we find that the isocline is −x2 + x21 = x21 − x1 x2 . So,
c = 1 on x2 = 0 and x1 = 1
(9)
For c = 2, from (6), we find that the isocline is −x2 + x21 = 2(x21 − x1 x2 ). So,
c = 2 on x2 =
x21
2x1 − 1
(10)
The next part of the problem requires the curves to be sketched with the associated slopes on top
of the isoclines. These drawings should be done by hand. The exact curves are plotted in Figure 1.
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x1
0.5
1
1.5
2
Figure 1: Isoclines for Problem 1
Finally, we need to conjecture the phase portrait from this information. The trajectories are found
by tracing curves through the slopes that we plotted on top of the isoclines. In order to establish
the direction of these trajectories, we need to look at the differential equations at some of the
isoclines to determine the direction of the derivative field. This plot should be made by hand in
your solutions. It is plotted by computer in Figure 2
2
x ’ = x2 − x x
1
1
1 2
x ’ = − x + x2
2
2
1
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1
Figure 2: Isoclines and phase portrait for Problem 1
3
1.5
2
Problem 2: The pumping heart.
The Van der Pol oscillator equations are
ẋ = v − µ(x3 /3 − x)
(11)
v̇ = −x
(12)
where x is the muscle fiber length, v is the stimulous, and µ > 0 is a parameter.
The equilibria are found by setting the state derivatives to zero.
ẋ = 0 ⇒ v − µ(x3 /3 − x) = 0
(13)
v̇ = 0 ⇒ −x = 0
(14)
Combining these two equations, we see that the only equilibrium is at (0,0) . Next, we need to
find the stability of this equilibrium. To do so, we linearize about it.
Df =
"
#
−µ(x2 − 1) 1 −1
0 =
(0,0)
"
µ 1
−1 0
#
(15)
Next, we determine the eigenvalues of the Jacobian.
det (Df − λI) = det
"
µ−λ 1
−1 −λ
Thus, the eigenvalues are at
λ=
µ±
#
= λ2 − µλ + 1 = 0
p
µ2 − 4
2
(16)
(17)
So, when µ > 2 , there are two positive real eigenvalues, and the equilibrium is an unstable node .
When µ = 2 , there are two identical eigenvalues greater than zero, so the equilibrium is an
improper unstable node .
When 0 < µ < 2 , there are two complex eigenvalues with positive real parts, so the equilibrium is
an unstable focus .
See the figures at the end of this problem for plots at small and large µ.
Finally, we need to show that in the transition from long fibers to short fibers, the contraction
happens slowly at first, but that at a high enough stimulus the fibers contract suddenly to push
the blood all throughout the body.
We cannot directly read from the phase portrait how sudden the contraction is, because it’s the plot
of v versus x, not x versus time. Although you can see some time information from the vector field
plot of f (x1 , x2 ) which we typically plot along with the phase portrait in pplane, we are supposd
to show that the contraction happens slowly at first, and then suddenly at a high stimulus.
From the phase plot, we can find out how v and x change - the system exhibits a limit cycle. Let’s
look at
ẋ = v − µ(x3 /3 − x)
(18)
4
In the upper right corner of the limit cycle, at the point where ẋ = 0, v = µ(x3 /3 − x), so the
muscle fiber length is constant. The extension is positive, so the equation v̇ = −x says that v will
continue decreasing.
As v decreases, ẋ will transition to a slightly negative value. Thus, with x decreasing slightly, the
equation µ(x3 /3 − x) decreases as well. This decrease balances out the decrease in v, moderating
the change in ẋ, until the cubic equation reaches a local minimum, found by
d 3
x /3 − x = 0
dx
⇒ x2 = 1 ⇒ x = ±1
(19)
(20)
The positive solution corresponds to the minimum. So when x = 1 is reached, the cubic equation
turns around, and x begins to decrease very increasingly rapidly. It is no longer dependent on the
magnitude of v increasing. Thus, the fiber contracts increasingly rapidly until the maximum of the
cubic equation is reached, and the rate decreases again, and eventually goes to zero. We begin the
same process all over again, symmetric about the origin.
3
mu = 1
x ’ = v − mu (x /3 − x)
v’=−x
4
3
2
v
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
Figure 3: Phase portrait with µ = 1. This is an unstable focus.
5
4
3
mu = 2
x ’ = v − mu (x /3 − x)
v’=−x
4
3
2
v
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
Figure 4: Phase portrait with µ = 2. This is an improper unstable node.
3
mu = 4
x ’ = v − mu (x /3 − x)
v’=−x
4
3
2
v
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
Figure 5: Phase portrait with µ = 4. This is an unstable node.
6
4
Problem 3: Modification of Duffing’s equation.
The modified Duffing equation is
ẋ1 = x2
(21)
ẋ2 = x1 −
x31
− δx2 +
x21 x2
(22)
First, we find its equilibria.
ẋ1 = 0 = x2
(23)
x21 )
(24)
⇒ ẋ2 = 0 = x1 (1 −
So, we have equilibria at (0, 0) , (1, 0) , and (−1, 0) . Next, we linearize about the equilibria.
Df =
"
0
1
1 − 3x21 + 2x1 x2 x21 − δ
Around (0,0),
Df =
"
0 1
1 −δ
#
#
(25)
xe
(26)
So the characteristic equation is
det
"
−λ
1
1 −δ − λ
Therefore, the eigenvalues at (0,0) are λ =
#
= λ2 + δλ − 1 = 0
√
−δ± δ2 +4
,
2
Around (1,0),
Df =
"
(27)
a saddle for any value of δ.
0
1
−2 1 − δ
#
(28)
So the characteristic equation is
det
"
−λ
1
−2 1 − δ − λ
#
= λ2 + (δ − 1)λ + 2 = 0
(29)
√
−(δ−1)± (δ−1)2 −8
Therefore, the eigenvalues at (1,0) are λ =
, which will have stability varying with
2
δ. The result for (-1,0) is the same. The stability regions are
√
(30)
δ < 1 − 2 2 ⇒ Unstable Node
√
δ = 1 − 2 2 ⇒ Unstable Improper Node
(31)
√
(32)
1 − 2 2 < δ < 1 ⇒ Unstable Focus
δ=1
√
1 <δ <1+2 2
√
δ =1+2 2
√
δ >1+2 2
⇒ Center in linearized system
(33)
⇒ Stable Improper Node
(35)
⇒ Stable Focus
(34)
⇒ Stable Node
(36)
7
Now, to apply Bendixson’s theorem, we evaluate the divergence of our vector field.
div(f ) =
∂f2
∂f1
+
= 0 + (−δ) + x21 = x21 − δ
∂x1 ∂x2
(37)
So, δ is never identically zero on any region in ℜ2 except on the lines where δ = x21 . The line cannot
contain an orbit, the first condition to say that orbits are possible is not met. What about the
second condition? From (37), we know that div(f ) changes sign on the lines where δ = x21 , except
when δ = 0. Thus, by Bendixson’s theorem, orbits could exist that cross these lines where a sign
change occurs. They could not occur in the region between the lines alone, our outside the lines
alone.
To conjecture plausible phase portraits, √
we return to the eigenvalue expressions. In the regions
defined by (30) and (31), the line x1 = ± δ doesn’t exist, so no closed orbits can exist. The phase
portrait can then be conjectured and sketched by hand in the neighborhood of the equilibrium
points. It shouldn’t have any closed orbits. The actual phase portrait is shown in Figure 6.
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 1 − 2 sqrt(2)
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
√
Figure 6: Phase portrait for δ = 1−2 2. By Bendixson’s theorem, there can’t be any closed orbits.
The region defined by (32) will be similar to the region defined by (30) and (31 when
√ δ ≤ 0, except
the equilibria at (±1, 0) change from nodes to foci. When δ > 0, a the lines x1 = ± δ exist between
each equilibrium in region (32). Thus, orbits could exist crossing any combination of these lines,
as long as they enclose an equilibrium point as well, and satisfy index theory. Again, sketches just
need to show guesses of where closed orbits could occur, and the behavior around the equilibrium.
Figures 7, 8 and 9 show interesting actual phase portraits in this domain.
√
In the region defined by (33), the lines x1 = ± δ lie on the equilibria at (±1, 0). So, the points
could be nonlinear centers. Again, a closed orbit could exist across the lines. Sketches need to
8
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 0.5
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
Figure 7: Phase portrait for δ = 0.5, with red lines indicating where the divergence
changes sign.
√
By Bendixson’s theorem, there can be closed orbits crossing the lines x1 = ± 0.5. It turns out
that there aren’t in this case.
show guesses of what the phase portrait could be. It turns out that the equilibria at (±1, 0) are
very strange, and not exactly nonlinear centers, as shown in Figure 10.
√
In the regions defined by (34), (35), and (36), the lines x1 = ± δ no longer separate the equilibria.
Again, a closed orbit could exist across the lines. Once again, sketches just need to show guesses
of what the phase portrait could be. One example of a real phase portrait is given in Figure 11.
9
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 0.8
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
Figure 8: Phase √
portrait for δ = 0.8. By Bendixson’s theorem, there can be closed orbits crossing
the lines x1 = ± 0.8. It turns out that there is one closed orbit encompassing all three equilibria.
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 0.9
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
Figure 9: Phase portrait
for δ = 0.9. By Bendixson’s theorem, there can be closed orbits crossing
√
the lines x1 = ± 0.9. Increasing δ by just 0.1, the system goes from having 1 orbit to having 3
orbits. Note that all orbits cross at least one of the sign change lines.
10
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 1
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
Figure 10: Phase√portrait for δ = 1. By Bendixson’s theorem, there can be closed orbits crossing
the lines x1 = ± 1. It turns out that there is one closed orbit again, encompassing all 3 equilibria.
x1 ’ = x2
x ’ = x − x3 − delta x + x2 x
2
1
1
2
1
delta = 1.1
2
2
1.5
1
x2
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
1
Figure 11: Phase√portrait for δ = 1.1. By Bendixson’s theorem, there can be closed orbits crossing
the lines x1 = ± 1.1. It turns out that there is a closed orbit, surrounding all 3 equilibria.
11
Problem 4: First integrals.
We consider the differential equation
θ̈ = 1 − 2 sin θ
(38)
First, we put it in state model form with x1 = θ and x2 = θ̇. Then,
ẋ1 = x2
(39)
ẋ2 = 1 − 2 sin x1
(40)
The equilibrium points are then found by setting the derivatives to zero.
ẋ1 = 0 = x2 ⇒ x2 = 0
(41)
ẋ2 = 0 = 1 − 2 sin x1 ⇒ x1 = sinx1 =
1
π
5π
⇒ x1 = + 2πn,
+ 2πn
2
6
6
(42)
Thus, the equilibria are at ( π6 + 2πn, 0) and ( 5π
6 + 2πn, 0) .
Next, we linearize the system.
Df =
"
0
1
−2 cos x1 0
At ( 5π
6 + 2πn, 0), the Jacobian is
Df =
"
√0 1
3 0
#
#
(43)
(44)
So the eigenvalues are λ = ±31/4 , thus this point is a saddle .
At ( π6 + 2πn, 0), the Jacobian is
Df =
"
0
√
1
− 3 0
#
(45)
So the eigenvalues are λ = ±31/4 j , thus this point is a center in the linearized system . Now we
ask if this is a nonlinear center. We use the first integral.
If we can find a scalar function V (x1 , x2 ) has a time derivative of zero along the system trajectories,
then that function is constant along the trajectories. Hence, its level curves would define the
trajectories. Let’s find such a scalar function for this system.
d
V (x1 , x2 ) = 0
dt
∂V ∂x1
∂V ∂x2
⇒
+
=0
∂x1 ∂t
∂x2 ∂t
∂V
∂V
ẋ1 +
ẋ2 = 0
⇒
∂x1
∂x2
So, one solution is finding V such that
(
∂V
∂x1
∂V
∂x2
= −ẋ2
= ẋ1
12
(46)
Then ẋ1 ẋ2 − ẋ2 ẋ1 = 0, and the function V would satisfy the differntial equation. As many in
the class correctly observed, this function V is called a Hamiltonian function. So, plugging in our
system dynamics, we see that
(
∂V
∂x1 = 2 sin x1 − 1
(47)
∂V
∂x2 = x2
Integrating the first equation,
V (x1 , x2 ) =
Z
2 sin x1 − 1dx1
(48)
= −2 cos x1 − x1 + g1 (x2 )
(49)
Integrating the second equation,
V (x1 , x2 ) =
Z
x2 dx2
(50)
1 2
x + g2 (x1 )
2 2
(51)
1 2
x − 2 cos x1 − x1 + C
2 2
(52)
=
Combining these results, we see that
V =
where C is a constant of integration. It can be anything without effecting our use of V , so let’s set
it to zero.
Now, looking at the region around ( π6 + 2πn, 0), define an arbitrary point very close to ( π6 , 0),
( π6 + ǫ1 , ǫ2 ), where ǫ1 , ǫ2 → 0. Set V (ǫ1 , ǫ2 ) = c, where c is some arbitrary constant that the
function V evaluates to at that point. Then,
V (ǫ1 , ǫ2 ) = c
π
π
1 2
⇒ ǫ2 − 2 cos ( + ǫ1 ) − ( + ǫ1 ) = c
6
6
2
1 2
π
π
⇒ ǫ2 − 2 cos cos ǫ1 − sin sin ǫ1 − ǫ1 = c
2
6
6
1 2 √
⇒ ǫ2 − 3 cos ǫ1 + sin ǫ1 − ǫ1 = c
2
ǫ1
1 2 √
⇒ ǫ2 − 3 1 − 2 sin2
+ sin ǫ1 − ǫ1 = c
2
2
Now, using the fact that ǫ1 → 0, we know that sin ǫ21 ≈
ǫ1
2
(53)
(54)
(55)
(56)
(57)
and sin ǫ1 ≈ ǫ1 . So,
√
√ ǫ1 2
1
+ ǫ1 − ǫ1 = c
⇒ ǫ22 − 3 + 2 3
2
2
√
3 2
1 2
ǫ =c
⇒ ǫ2 +
2
2 1
(58)
(59)
(60)
Thus, as we approach the equilibria, the level curves of V are a family of ellipses, which form closed
orbits around the equilibria. Thus, the equillibria do correspond to nonlinear centers.
At this point, the solution requires a hand drawn sketch of the phase portrait. The exact plot of
the phase portrait is shown in Figure 12.
13
x ’=x
1
2
x ’ = 1 − 2 sin(x )
2
1
6
4
x2
2
0
−2
−4
−6
−10
−5
0
x
5
1
Figure 12: Phase portrait for Problem 4.
14
10
Problem 5: Reaction-diffusion equations.
The governing equations are
ẋ1 = 2(x2 − x1 ) + x1 (1 − x21 )
(61)
ẋ1 = 0 = 2(x2 − x1 ) + x1 ∗ (1 − x21 )
(63)
ẋ2 = −2(x2 − x1 ) + x2 (1 −
x22 )
(62)
First, we find the equilibria.
x22 )
(64)
4(x2 − x1 ) + (x1 − x2 ) + x32 − x31 = 0
(65)
ẋ2 = 0 = −2(x2 − x1 ) + x2 ∗ (1 −
Subtracting (64) from (63), we obtain
⇒ (x2 − x1 ) 3 + x21 + x1 x2 + x22 = 0
(66)
always positive
⇒ x1 = x2
(67)
|
{z
}
Substituting this back into (63), we find that
x1 (1 − x21 ) = 0
(68)
So, the equilibria are at (0, 0) , (1, 1) and (−1, −1) .
Now, to find the stability, we linearize the system. First, we find the Jacobian.
Df =
"
2
−1 − 3x21
2
−1 − 3x22
So, at (0,0),
Df =
"
−1 2
2 −1
#
#
(69)
(70)
The characteristic equation is given by
det(Df − λI) = det
"
−1 − λ
2
2
−1 − λ
#
= (λ + 1)2 − 4 = 0
(71)
So the eigenvalues are λ = −3, 1. Thus, this equilibrium is a saddle .
At (1,1) and (-1,-1),
Df =
"
−4 2
2 −4
#
(72)
The characteristic equation is given by
det(Df − λI) = det
"
−4 − λ
2
2
−4 − λ
15
#
= (λ + 4)2 − 4 = 0
(73)
So the eigenvalues are λ = −2, −6. Thus, these equilibria are stable nodes .
To find out about limit cycles, we use Bendixson’s theorem to see if any closed orbits exist.
div(f ) =
∂f1
∂f2
+
= −2 + 1 − 3x21 − 2 + 1 − 3x22 = −2 − 3(x21 + x22 ) < 0
∂x1 ∂x2
(74)
So, because the divergence is always negative, it can never have a sign change, or be equivalently
zero. Therefore, no closed orbits can exist in this system, so neither can a limit cycle.
16
Problem 6: Hamiltonian systems.
The equation of motion is
ẍ − x + x3 = 0
(75)
First, we put it in state model form with x1 = x and x2 = ẋ. Then,
ẋ1 = x2
(76)
ẋ2 = x1 −
x31
(77)
We linearize the system about (±1, 0).
Df =
"
0
1
2
1 − 3x1 0
#
=
"
0 1
−2 0
#
(78)
√
So the eigenvalues are λ = ± 2j , thus this point is a center in the linearized system, but by
Hartman-Grobman, we don’t know about the stability of the nonlinear system.
Next, we look at (18) in the problem statement to determine the Hamiltonian function.
∂H
1
= x2 ⇒ H = x22 + g1 (x1 )
∂x2
2
1
1
∂H
= x1 − x31 ⇒ H = x41 − x21 + g2 (x2 )
= −
∂x1
4
2
ẋ1 =
(79)
ẋ2
(80)
Combining these two equations, we find that
1
1
1
H = x41 − x21 + x22 + C
4
2
2
(81)
As in Problem 4, we can set C to zero, because we don’t care about the constant offset of H here.
Now, we need to determine what Ḣ is along the trajectories of the system.
∂H ∂x2
∂H ∂H
∂H
∂H
∂H ∂x1
+
=
+
−
Ḣ =
∂x1 ∂t
∂x2 ∂t
∂x1 ∂x2 ∂x2
∂x1
=0
(82)
Therefore, H is constant along a trajectory of the system. In other words, a contour of constant
H corresponds to a trajectory on the phase portrait.
Now, looking at (±1, 0), let’s focus on (1,0). Because the system is symmetric about the origin,
what we derive for (1,0) applies to (-1,0) as well.
Take a point (1 + ǫ1 , ǫ2 ) which is very close to (1,0). That is, ǫ1 and ǫ2 are very small. Evaluating
H at that point, we find the function for a constant contour of H.
1
1
1
(1 + ǫ1 )4 + ǫ22 − (1 + ǫ1 )2
4
2
2
1
1
1
=
(1 + 4ǫ1 + 6ǫ21 + 4ǫ31 + ǫ41 ) − (1 + 2ǫ1 + ǫ21 ) + ǫ22
4
2
2
1 4 1 2 1
2
3
= ǫ1 + ǫ1 + ǫ1 + ǫ2 −
4
2
4
H =
17
(83)
(84)
(85)
Getting rid of higher order terms, and setting H to a constant c, we obtain
1
H = ǫ21 + ǫ22 = c
2
(86)
Which is the equation of an ellipse. Thus, as we approach the equilibrium point, the level curves of
H approach an ellipse centered on the equlibrium point. Therefore, there are closed orbits around
the equilibrium points (±1, 0).
18