-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathch_11_Systems_of_Nonlinear_Differential_Equations.qmd
More file actions
1317 lines (927 loc) · 46.1 KB
/
ch_11_Systems_of_Nonlinear_Differential_Equations.qmd
File metadata and controls
1317 lines (927 loc) · 46.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
jupyter: python3
---
# Systems of Nonlinear Differential Equations {#sec-11}
## Autonomous Systems {#sec-11-1}
A system of first-order differential equations is called **autonomous** when the system can be written in the form
$$
\begin{aligned}
\frac{dx_1}{dt} &=g_1(x_1,x_2,\cdots,x_n) \\
\frac{dx_2}{dt} &=g_2(x_1,x_2,\cdots,x_n) \\
& \;\vdots \\
\frac{dx_n}{dt} &=g_n(x_1,x_2,\cdots,x_n)
\end{aligned}
$$
Notice that the independent variable $t$ does not appear explicitly on the right-hand side of each differential equation
* **Second-Order DE as a System**
Any second-order differential equation $x''=g(x,x')$ can be written as an autonomous system.
If we let $y=x'$, the second-order differential equation becomes the system of two first-order equations
$$
\begin{aligned}
x' &= y\\
y' &= g(x,y)
\end{aligned}
$$
**Example** $~$ The displacement angle $\theta$ for a pendulum satisfies the nonlinear second-order
differential equation
$$\frac{d^2 \theta}{dt^2} +\frac{g}{l}\sin\theta=0$$
If we let $x=\theta$ and $y=\dot{\theta}$, $~$ this second-order differential equation can be written as the autonomous system
$$\dot{x} = y,\;\; \dot{y} = -\frac{g}{l}\sin x$$
* **Plane Autonomous System**
When $n=2$, the system is called a <font color="blue">**plane autonomous system**</font>, and we write the system as
$$
\begin{aligned}
\frac{dx}{dt} &= P(x,y)\\
\frac{dy}{dt} &= Q(x,y)
\end{aligned}
$$
If $P$, $Q$, and the first-order partial derivatives $\partial P/\partial x$,
$\partial P/\partial y$, $\partial Q/\partial x$, and $\partial Q/\partial y$ are continuous in a
region $R$ of the plane, then a solution to the plane autonomous system that satisfies
$\mathbf{x}(0)=\mathbf{x}_0$ is unique and one of three basic types:
* A **constant solution**, $\mathbf{x}(t)=\mathbf{x}_0$ for all $t$. A constant solution is called a **critical** or **stationary point**
$$\begin{aligned}
P(x,y) &= 0 \\
Q(x,y) &= 0
\end{aligned}$$
Note that since $\mathbf{x}'=\mathbf{0}$, a critical point is a solution of the system of algebraic equations
* An **arc**, $\mathbf{x}(t)$ - a plane curve that does not cross itself
{width="75%" fig-align="center"}
* A **periodic solution** or **cycle**, $\mathbf{x}(t +p)=\mathbf{x}(t)$
{width="25%" fig-align="center"}
**Example** $~$Find all critical points of the following plane autonomous system
$$
\begin{aligned}
x'&= x^2 +y^2 -6\\
y'&= x^2 -y
\end{aligned}$$
## Stability of Linear Systems {#sec-11-2}
If $\mathbf{x}_1$ is a critical point of a plane autonomous system and $\mathbf{x}=\mathbf{x}(t)$ is a solution
satisfying $\mathbf{x}(0)=\mathbf{x}_0$, when $\mathbf{x}_0$ is placed near $\mathbf{x}_1$
{width="85%" fig-align="center"}
(@) It may return to the critical point
(@) It may remain close to the critical point without returning
(@) It may move away from the critical point
* **Stability Analysis**
* A careful geometric analysis of the solutions to the *linear* plane autonomous system
$$
\begin{aligned}
x'&= ax +by\\
y'&= cx +dy
\end{aligned}
$$
in terms of the eigenvalues and eigenvectors of the coefficient matrix
$$\mathbf{A}=
\begin{pmatrix}
a & b\\
c & d
\end{pmatrix}
$$
drives the stabilty analysis
* To ensure that $\mathbf{x}_0=(0,\,0)$ is the only critical point, we will assume that the determinant $\Delta = ad -bc \neq 0$. If $\tau = a + d$ is the trace of matrix $\mathbf{A}$,
then the characteristic equation, $\mathrm{det}(\mathbf{A} -\lambda\mathbf{I})=0,$ can be rewritten as
$$\lambda^2 -\tau\lambda +\Delta =0$$
Therefore the eigenvalues of $\mathbf{A}$ are
$$\lambda =\frac{\tau \pm \sqrt{\tau^2 -4\Delta}}{2}$$
and the usual three cases for these roots occur according to whether $\tau^2 -4\Delta$ is positive, negative, or zero
**Example** $~$ Find the eigenvalues of the linear system
$$
\begin{aligned}
x'&= -x +y\\
y'&= cx -y
\end{aligned}
$$
in terms of $c$, and use a numerical solver to discover the shapes of solutions corresponding to the cases
$c=\frac{1}{4}$, $4$, $0$, and $-9$. $\mathbf{A}$ has trace $\tau=-2$ and determinant $\Delta=1 -c$,
and so the eigenvalues are
$$ \lambda =-1 \pm \sqrt{c} $$
The nature of the eigenvalues is therefore determined by the value of $c$
```{python}
import numpy as np
import sympy as sp
sp.init_printing(use_unicode=True)
c = sp.Symbol('c')
A = sp.Matrix([[-1, 1], [c, -1]])
A.eigenvects()
```
```{python}
import matplotlib.pyplot as plt
w = 1
xp = np.linspace(-w, w, 50)
yp = np.linspace(-w, w, 50)
x, y = np.meshgrid(xp, yp)
c_ = np.array([1/4, 4, 0, -9])
c_title = [r'$c=\frac{1}{4}$', r'$c=4$', r'$c=0$', r'$c=-9$']
fig = plt.figure(figsize=(6, 6))
for i in range(4):
ax = fig.add_subplot(2, 2, i +1)
xdot = -x +y
ydot = c_[i]*x -y
if c_[i] >= 0.0:
y_1 = -np.sqrt(c_[i]) *xp
y_2 = np.sqrt(c_[i]) *xp
ax.plot(xp, y_1, 'r:', xp, y_2, 'g:')
ax.streamplot(x, y, xdot, ydot, color='blue')
ax.set_title(f'{c_title[i]}')
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in',
labelsize=8)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
if i >= 2:
ax.set_xlabel(r'$x$')
if i == 0 or i == 2:
ax.set_ylabel(r'$y$')
```
* <font color="red">Trajectory behaviors in phase portraits can be explained with eigenvalue-eigenvector of $\mathbf{A}$</font>
* **Real Distinct Eigenvalues**, $\tau^2 -4\Delta > 0$
$$
\begin{aligned}
\mathbf{x}(t) &= c_1\mathbf{k}_1 e^{\lambda_1 t} +c_2\mathbf{k}_2 e^{\lambda_2 t}\\
&\;\big\Downarrow \;{\scriptstyle \lambda_1 >\lambda_2}\\
&= e^{\lambda_1 t} \left[c_1\mathbf{k}_1 +c_2\mathbf{k}_2 e^{(\lambda_2 -\lambda_1)t} \right ] \\
&\;\big\Downarrow \;\,{\scriptstyle t \to \infty}\\
&\simeq c_1\mathbf{k}_1 e^{\lambda_1 t}
\end{aligned}
$$
* **Both eigenvalues negative**, $\tau^2 -4\Delta > 0$, $\tau<0$, $\Delta>0$
**Stable Node:** Since both eigenvalues are negative, it follows that
$\lim_{t \to \infty} \mathbf{x}(t)=\mathbf{0}$ in the direction of $\mathbf{k}_1$ when $c_1 \neq 0$ or
in the direction of $\mathbf{k}_2$ when $c_1=0$
* **Both eigenvalues positive**, $\tau^2 -4\Delta > 0$, $\tau>0$, $\Delta>0$
**Unstable Node:** $\mathbf{x}(t)$ becomes unbounded in the direction of
$\mathbf{k}_1$ when $c_1 \neq 0$ or in the direction of $\mathbf{k}_2$ when $c_1=0$
* **Eigenvalues have opposite signs**, $\tau^2 -4\Delta > 0$, $\Delta<0$
**Saddle Point:** When $c_1=0$, $\mathbf{x}(t)$ will approach $\mathbf{0}$ along the line determined by
$\mathbf{k}_2$. If $\mathbf{x}(0)$ does not lie on the line determined by $\mathbf{k}_2$, the direction
determined by $\mathbf{k}_1$ serves as an asymtote for $\mathbf{x}(t)$
**Example** $~$ Classify the critical point $(0,0)$ of each of the following linear system
$\mathbf{x}'=\mathbf{A}\mathbf{x}$ as either a stable node, an unstable node, or a saddle point
<center>
$(\text{a})$ $\begin{pmatrix} -2 & -2\\ -2 & -5 \end{pmatrix}$, $\;$
$(\text{b})$ $\begin{pmatrix} -1 & -2\\ \;\;3 & \;\;4 \end{pmatrix}$, $\;$
$(\text{c})$ $\begin{pmatrix} 2 & -1\\ 3 & -2 \end{pmatrix}$
</center>
```{python}
import numpy as np
w = 1
xp = np.linspace(-w, w, 6)
yp = np.linspace(-w, w, 6)
x, y = np.meshgrid(xp, yp)
A = np.array([[[-2, -2], [-2, -5]],
[[-1, -2], [3, 4]],
[[2, -1], [3, -2]]])
A_title = ['Stable Node', 'Unstable Node', 'Saddle Point']
fig = plt.figure(figsize=(4, 12))
for i in range(3):
xdot = A[i,0,0]*x +A[i,0,1]*y
ydot = A[i,1,0]*x +A[i,1,1]*y
lamda, v = np.linalg.eig(A[i])
if lamda[0] >= lamda[1]:
y_1 = v[1,0]/v[0,0]*xp
y_2 = v[1,1]/v[0,1]*xp
else:
y_1 = v[1,1]/v[0,1]*xp
y_2 = v[1,0]/v[0,0]*xp
ax = fig.add_subplot(3, 1, i +1)
ax.plot(xp, y_1, 'r:', xp, y_2, 'g:')
ax.streamplot(x, y, xdot, ydot, color='blue')
ax.set_title(A_title[i])
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.set_ylabel(r'$y$')
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
if i == 2:
ax.set_xlabel(r'$x$')
```
* **A Repeated Real Eigenvalue**, $\tau^2 -4\Delta = 0$
The general solution takes on one of two different forms depending on whether **one** or **two** linearly independent eigenvectors can be found for the repeated eigenvalues $\lambda_1$
* **Two linearly independent eigenvectors**
If $\mathbf{k}_1$ and $\mathbf{k}_2$ are two linearly independent eigenvectors corresponding to $\lambda_1$,
then the general solution is given by
$$\mathbf{x}(t)=c_1\mathbf{k}_1 e^{\lambda_1 t} +c_2\mathbf{k}_2 e^{\lambda_1 t}=
\left(c_1\mathbf{k}_1 + c_2\mathbf{k}_2 \right) e^{\lambda_1 t}$$
If $\lambda_1<0$, the $\mathbf{x}(t)$ approaches $\mathbf{0}$ along the line determined by the vector
$c_1\mathbf{k}_1 + c_2\mathbf{k}_2$ and the critical point is a **degenerate stable node**. The arrows are reversed when $\lambda_1>0$, and the critical point is a **degenerate unstable node**
* **A single linearly independent eigenvectors**
When only a single linearly independent eigenvector $\mathbf{k}_{11}$ exists, the general solution is given by
$$\begin{aligned}
\mathbf{x}(t)&=c_1\mathbf{k}_{11} e^{\lambda_1 t} +c_2\left(\mathbf{k}_{11} te^{\lambda_1 t}
+\mathbf{k}_{12} e^{\lambda_1 t}\right)\\
&=te^{\lambda_1 t}\left[c_2 \mathbf{k}_{11} +\frac{1}{t} \left(c_1\mathbf{k}_{11}
+c_2\mathbf{k}_{12}\right) \right]
\end{aligned}$$
where $(\mathbf{A} -\lambda_1\mathbf{I})\mathbf{k}_{12}=\mathbf{k}_{11}$. If $\lambda_1<0$, then $\lim_{t \to \infty} te^{\lambda_1 t}=0$ and it follows that $\mathbf{x}(t)$ approaches $\mathbf{0}$ in the line determined by $\mathbf{k}_{11}$. The critical point is again a **degenerate stable node**. When $\lambda_1>0$, $\mathbf{x}(t)$ becomes unbounded as $t$ increases, and the critical point is a **degenerate unstable node**
**Example** $~$ Classify the critical point $(0,0)$ of each of the following linear system $\mathbf{x}'=\mathbf{A}\mathbf{x}$
<center>
$(\text{a})$ $\begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix}$, $\;$
$(\text{b})$ $\begin{pmatrix} 3 & -18\\ 2 &\; -9 \end{pmatrix}$, $\;$
$(\text{c})$ $\begin{pmatrix} \;\;2 & 4\\ -1 & 6 \end{pmatrix}$
</center>
```{python}
w = 1
xp = np.linspace(-w, w, 6)
yp = np.linspace(-w, w, 6)
x, y = np.meshgrid(xp, yp)
A = np.array([[[1, 0], [0, 1]],
[[3, -18], [2, -9]],
[[2, 4], [-1, 6]]])
A_title = ['Degenerate Unstable',
'Degenerate Stable',
'Degenerate Unstable']
fig = plt.figure(figsize=(4, 12))
for i in range(3):
xdot = A[i,0,0]*x +A[i,0,1]*y
ydot = A[i,1,0]*x +A[i,1,1]*y
lamda, v = np.linalg.eig(A[i])
ax = fig.add_subplot(3, 1, i +1)
if i != 0:
y_1 = v[1,0] /v[0,0] *xp
ax.plot(xp, y_1, 'r:')
ax.streamplot(x, y, xdot, ydot, color='blue')
ax.set_title(A_title[i])
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.set_ylabel(r'$y$')
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
if i == 2: ax.set_xlabel(r'$x$')
```
* **Complex Eigenvalues**, $\tau^2 -4\Delta < 0$
If $\lambda_1=\alpha +i\beta$ and $\bar{\lambda}_1$ are the complex eigenvalues and $\mathbf{k}_1=\mathbf{b}_1 +i\mathbf{b}_2$ is a complex eigenvector corresponding to $\lambda_1$, the general solution can be written as $\mathbf{x}=c_1\mathbf{x}_1 +c_2\mathbf{x}_2$
$$
\begin{aligned}
\mathbf{x}_1(t) &=e^{\alpha t}\left(\mathbf{b}_1\cos\beta t -\mathbf{b}_2\sin\beta t\right) \\
\mathbf{x}_2(t) &=e^{\alpha t}\left(\mathbf{b}_2\cos\beta t +\mathbf{b}_1\sin\beta t\right)
\end{aligned}$$
* **Pure imaginary roots**, $\tau^2 -4\Delta < 0$, $~\tau=0$
**Center:** When $\alpha=0$, all solutions are ellipses with center at the origin and are periodic with period $p=2\pi/\beta$. The critical point is called a **center**
* **Nonezero real part**, $\tau^2 -4\Delta < 0$, $~\tau\neq 0$
**Spiral Point:** When $\alpha<0$, $e^{\alpha t}\to 0$, and the elliptical-like solution spirals closer
and closer to the origin. The critical point is called a **stable spiral point**. When $\alpha>0$, the
effect is the opposite. An elliptical-like solution is driven farther and farther from the origin, and the critical point is now called an **unstable spiral point**
**Example** $~$ Classify the critical point $(0,0)$ of each of the following linear system
$\mathbf{x}'=\mathbf{A}\mathbf{x}$
<center>
$(\text{a})$ $\begin{pmatrix} -1 & 2\\ -1 & 1 \end{pmatrix}$,$\;$
$(\text{b})$ $\begin{pmatrix} -1 & -4\\ \;\;1 & -1 \end{pmatrix}$
</center>
```{python}
w = 1
xp = np.linspace(-w, w, 6)
yp = np.linspace(-w, w, 6)
x, y = np.meshgrid(xp, yp)
A = np.array([[[-1, 2], [-1, 1]],
[[-1, -4], [1, -1]]])
A_title = ['Center', 'Stable Spiral']
fig = plt.figure(figsize=(4, 8))
for i in range(2):
ax = fig.add_subplot(2, 1, i +1)
xdot = A[i,0,0]*x +A[i,0,1]*y
ydot = A[i,1,0]*x +A[i,1,1]*y
lamda, v = np.linalg.eig(A[i])
ax.streamplot(x, y, xdot, ydot, color='blue')
ax.set_title(A_title[i])
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.set_ylabel(r'$y$')
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
if i == 1: ax.set_xlabel(r'$x$')
```
{width="75%" fig-align="center"}
For a linear plane autonomous system $\mathbf{x}'=\mathbf{A}\mathbf{x}$ with $\mathrm{det}\,\mathbf{A}\neq 0$,
let $\mathbf{x}$ denote the solution that satisfies the initial condition $\mathbf{x}(0)=\mathbf{x}_0$, where
$\mathbf{x}_0\neq\mathbf{0}$
1. $\lim_{t \to \infty}\mathbf{x}(t)=\mathbf{0}$ if and only if the eigenvalues of $\mathbf{A}$ have negative
real parts. This will occur when $\Delta>0$ and $\tau<0$
1. $\mathbf{x}(t)$ is periodic if and only if the eigenvalues of $\mathbf{A}$ are pure imaginary. This will
occur when $\Delta>0$ and $\tau=0$
1. In all other cases, given any neighborhood of the origin, there is at least one $\mathbf{x}_0$ in the neighborhood for which $\mathbf{x}(t)$ becomes unbounded as $t$ increases
## Linearization and Local Stability {#sec-11-3}
Here we will use linearization as a means of analyzing nonlinear DEs and nonlinear systems; the idea is to replace them by linear DEs and linear systems. Let $\mathbf{x}_1$ be a critical point of an autonomous system, and let $\mathbf{x}=\mathbf{x}(t)$ denote the solution that satisfies the initial condition $\mathbf{x}(0)=\mathbf{x}_0$, where $\mathbf{x}\neq\mathbf{x}_1$.
* $\mathbf{x}_1$ is a **stable critical point**
when, given any $\rho > 0$, there is a $r>0$ such that if $\mathbf{x}_0$ satisfies $|\mathbf{x}_0 -\mathbf{x}_1|<r$, then $\mathbf{x}(t)$ satisfies $|\mathbf{x}(t) -\mathbf{x}_1|<\rho$ $\,$ for all $t>0$. If, in addition,
$\lim_{t \to \infty} \mathbf{x}(t)=\mathbf{x}_1$ whenever $|\mathbf{x}_0 -\mathbf{x}_1|<r$, we call
$\mathbf{x}_1$ an **asymptotically stable critical point**
* $\mathbf{x}_1$ is an **unstable critical point**
if there is $\rho>0$ with the property that, for any $r>0$, there is at least one $\mathbf{x}_0$ that
satisfies $|\mathbf{x}_0 -\mathbf{x}_1|<r$, yet the corresponding solution $\mathbf{x}(t)$ satisfies
$|\mathbf{x}(t) -\mathbf{x}_1|\geq\rho$ $\,$ for at least one $t>0$
**Example** $~$ Show that $(0,0)$ is a stable critical point of the nonlinear plane autonomous system
$$
x' = -y -x\sqrt{x^2 +y^2}, \;\; y' = x -y\sqrt{x^2 +y^2}$$
From the formulas $r^2=x^2 +y^2$ and $\theta=\tan^{-1}(y/x)$, we obtain
$$
\frac{dr}{dt}=\frac{1}{r}\left(x\frac{dx}{dt}+y\frac{dy}{dt} \right),\;
\frac{d\theta}{dt}=\frac{1}{r^2}\left( -y\frac{dx}{dt} +x\frac{dy}{dt}\right)$$
Substituting for $dx/dt$ and $dy/dt$ in the expressions for $dr/dt$ and $d\theta/dt$, we obtain
$$\frac{dr}{dt} = -r^2, \; \frac{d\theta}{dt} = 1$$
Using separation of variables, we see that the solution of the system is
$$ r=\frac{1}{t +c_1},\;\;\theta=t +c_2 $$
for $r\neq 0$. If $\mathbf{x}(0)=(r_0,\theta_0)$ is the initial condition in polar coordinates, then
$$ r=\frac{r_0}{r_0 t +1},\;\;\theta=t +\theta_0 $$
Note that $r\leq r_0$ $\,$ for $t\geq 0$, and $r$ approaches $0$ as $t$ increases. Therefore, given $\rho>0$, a solution that starts less than $\rho$ from the origin remains within $\rho$ of the origin for all $t\geq 0$. Hence the critical point $(0,0)$ is asymptotically stable
**Example** $~$ When expressed in polar coordinates, a plane autonomous system takes the form
$$
\begin{aligned}
\frac{dr}{dt} &= 0.05\,r(3 -r)\\
\frac{d\theta}{dt} &= -1
\end{aligned}
$$
Show that $(x,y)=(0,0)$ is unstable critical point
We see that $dr/dt=0$ when $r=0$ and can conclude that $(x,y)=(0,0)$ is a critical point. $~$ The differential equation can be solved using separation of variables. If $r(0)=r_0$ and $r_0\neq 0,$ then
$$ r=\frac{3}{1 +c_0 e^{-0.15t}} $$
where $c_0=(3 -r_0)/r_0$. Since
$$\lim_{t \to \infty}\frac{3}{1 +c_0 e^{-0.15t}}=3$$
it follows that no matter how close to $(0,0)$ a solution starts, the solution will leave a disk of radius $\epsilon$ about the origin. Therefore $(0,0)$ is an unstable critical point
* **Linearization**
We replace the term $\mathbf{g}(\mathbf{x})$ in the original autonomous system $\mathbf{x}'=\mathbf{g}(\mathbf{x})$ by a linear term $\mathbf{A}(\mathbf{x} -\mathbf{x}_1)$ that most closely approximates $\mathbf{g}(\mathbf{x})$ in a neighborhood of $\mathbf{x}_1$. This replacement process is called **linearization**
When $\mathbf{x}_1$ is a critical point of a plane autonomous system
$$
\begin{aligned}
x' &= P(x,y)\\
y' &= Q(x,y)
\end{aligned}
$$
$P(x_1,y_1)=Q(x_1,y_1)=0$ and we have
$$
\begin{aligned}
x' &= P(x,y)\simeq \left.\frac{\partial P}{\partial x}\right|_{(x_1,y_1)}(x -x_1)
+\left.\frac{\partial P}{\partial y}\right|_{(x_1,y_1)}(y -y_1)\\
y' &= Q(x,y)\simeq \left.\frac{\partial Q}{\partial x}\right|_{(x_1,y_1)}(x -x_1)
+\left.\frac{\partial Q}{\partial y}\right|_{(x_1,y_1)}(y -y_1)
\end{aligned}
$$
The original system $\mathbf{x}'=\mathbf{g}(\mathbf{x})$ may be approximated in a neighborhood of $\mathbf{x}_1$
by the linear system $\mathbf{x}'=\mathbf{A}(\mathbf{x} -\mathbf{x}_1)$, where
$$\mathbf{A}=
\begin{pmatrix}
\left.\frac{\partial P}{\partial x}\right|_{(x_1,y_1)} & \left.\frac{\partial P}{\partial y}\right|_{(x_1,y_1)}\\
\left.\frac{\partial Q}{\partial x}\right|_{(x_1,y_1)} & \left.\frac{\partial Q}{\partial y}\right|_{(x_1,y_1)}
\end{pmatrix} = \mathbf{g}'(\mathbf{x}_1)
$$
* **Stability Criteria for Plane Autonomous System**
1. If the eigenvalues of $\mathbf{A}=\mathbf{g}'(\mathbf{x}_1)$ have negative real part, then $\mathbf{x}_1$ is
an asymptotically stable critical point
1. If the eigenvalues of $\mathbf{A}=\mathbf{g}'(\mathbf{x}_1)$ have positive real part, then $\mathbf{x}_1$ is
an unstable critical point
**Example** $~$ Classify the criticl points of the following plane autonomous system
$$
\begin{aligned}
x'&= x^2 +y^2 -6\\
y'&= x^2 -y
\end{aligned}
$$
The critical points are $(\sqrt{2},2)$ and $(-\sqrt{2},2)$ and the Jacobian matrix is
$$
\mathbf{g}'(\mathbf{x})=
\begin{pmatrix}
2x & \;2y\\
2x &-1
\end{pmatrix}
$$
and so
$$
\begin{aligned}
\mathbf{A}_1 &=\mathbf{g}'({\scriptsize(\sqrt{2},2)})=
{\scriptsize\begin{pmatrix}
2\sqrt{2} & \;\;4\\
2\sqrt{2} &-1
\end{pmatrix}} \\
\mathbf{A}_2 &=\mathbf{g}'({\scriptsize(-\sqrt{2},2)})={\scriptsize\begin{pmatrix}
-2\sqrt{2} & \phantom{-}4\\
-2\sqrt{2} &-1
\end{pmatrix}}
\end{aligned}
$$
Since the determinant of $\mathbf{A}_1$ is negative, $\mathbf{A}_1$ has a positive real eigenvalue.
Therefore $(\sqrt{2},2)$ is an unstable critical point. $\mathbf{A}_2$ has a positive determinant and
a negative trace, and so both eigenvalues have negative real parts. It follows that $(-\sqrt{2},2)$ is a
stable critical point
* **Classifying Critical Points**
{width="75%" fig-align="center"}
**Example** $~$ The second-order differential equation $mx'' +kx +k_1x^3 =0$, for $k>0$, represents a general
model for the free, undamped oscillations of a mass $m$ attached to a nonlinear spring.
If $k=1$ and $k_1=-1$, the spring is called soft and the plane autonomous system corresponding to the
nonlinear second-order equation $x'' +x -x^3=0$ is
$$
\begin{aligned}
x'&= y\\
y'&= x^3 -x
\end{aligned}
$$
Find and classify the critical points
Since $x^3 -x =x(x^2 -1)$, the critical points are $(0,0)$, $(1,0)$, and $(-1,0)$. The corresponding
Jacobian matrices are
$$
\mathbf{A}_1=\mathbf{g}'((0,0))=
\begin{pmatrix}
\;\;0 & 1\\
-1 & 0
\end{pmatrix}\;
$$
and
$$
\mathbf{A}_2=\mathbf{g}'((1,0))=\mathbf{g}'((-1,0))=
\begin{pmatrix}
0 & 1\\
2 & 0
\end{pmatrix}
$$
Since $\mathrm{det}\,\mathbf{A}_2<0$, critical points $(1,0)$ and $(-1,0)$ are both saddle points. The eigenvalues
of $\mathbf{A}_1$ are $\pm i$, and the status of the critical points at $(0,0)$ remains in doubt. It may be
either a stable spiral, an unstable spiral, or a center
* **Phase-Plane Method**
The linearization method can provide useful information on the local behavior of solutions near critical points.
It is of little help if we are interested in solutions whose initial condition $\mathbf{x}(0)=\mathbf{x}_0$ is not
close to a critical point or if we wish to obtain a global view of the family of solution curves. The
**phase-plane method** is based on the fact that
$$\frac{dy}{dx}=\frac{dy/dt}{dx/dt}=\frac{Q(x,y)}{P(x,y)}$$
and it attempts to find $y$ as a function of $x$ using one of the methods available for solving first-order DEs
**Example** $~$ Use the phase-plane method to determine the nature of the solutions to $x'' +x -x^3 =0$ in a neighborhood of $(0,0)$
If we let $dx/dt=y$, then $dy/dt=x^3 -x$. From this we obtain the first-order DE
$$\frac{dy}{dx}=\frac{x^3 -x}{y} $$
which can be solved by separation of variables. Integrating gives
$$ y^2=\frac{x^4}{2}-x^2+c $$
If $\mathbf{x}(0)=(x_0,0)$, where $0<x_0<1$, then $c=-\frac{x_0^4}{2} +x_0^2$, and so
$$ y^2=\frac{(2 -x^2 -x_0^2)(x_0^2 -x^2)}{2} $$
Note that $y=0$ when $x=-x_0$. In addition, the right-hand side is positive when $-x_0<x<x_0$, and
so each $x$ has two corresponding values of $y$. The solution $\mathbf{x}(t)$ that satisfies $\mathbf{x}(0)=(x_0,0)$ is therefore periodic, and so $(0,0)$ is a center
```{python}
from scipy.integrate import solve_ivp
def myODE(t, y):
return [y[1], y[0]**3 -y[0]]
def plotPhasePortrait(ax, g, td, x0, y0, color):
for i in range(x0.shape[0]):
sol = solve_ivp(g, [0, td[-1]],
[x0[i], y0], t_eval = td)
ax.plot(x0[i], y0, color +'x')
ax.plot(sol.y[0], sol.y[1], color +'-', lw=0.2)
td = np.linspace(0, 50, 2000)
x0_0, y0_0 = np.linspace( 0.1, 1.0, 10), 0.0
x0_1, y0_1 = np.linspace( 1.6, 2.6, 30), -3.0
x0_2, y0_2 = np.linspace(-2.6,-1.6, 30), 3.0
fig, ax = plt.subplots(figsize=(6, 6))
plotPhasePortrait(ax, myODE, td, x0_0, y0_0, 'k')
plotPhasePortrait(ax, myODE, td, x0_1, y0_1, 'b')
plotPhasePortrait(ax, myODE, td, x0_2, y0_2, 'r')
ax.set_title(r'Phase Portrait: $\times$ - initial conditions')
w = 3
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
ax.set_xlabel(r'$x$')
ax.set_ylabel(r'$y$')
plt.show()
```
## Autonomous Systems as Mathematical Models {#sec-11-4}
Many applications from physics and biology give rise to nonlinear autonomous second-order DEs $x''=g(x,x')$
* Nonlinear Pendulum
$$ \frac{d^2\theta}{dt^2} +\frac{g}{l}\sin\theta=0 $$
When we let $x=\theta$ and $y=\theta'$, this second-order differential equation may be rewritten as the dynamical system
$$
\begin{aligned}
x' &= y\\
y' &= -\frac{g}{l}\sin x
\end{aligned}
$$
The critical points are $(\pm k\pi,0)$, and the Jacobian matrix is easily shown to be
$$\mathbf{g}'((\pm k \pi,0))=
\begin{pmatrix}
0 & 1\\
(-1)^{k+1}\frac{g}{l} & 0
\end{pmatrix}
$$
If $k=2n+1$, $\Delta<0$, and so all critical points $(\pm(2n+1)\pi,0)$ are saddle points. When $k=2n$, the eigenvalues are pure imaginary, and so the nature of these critical points remains in doubt. From
$$\frac{dy}{dx}=\frac{dy/dt}{dx/dt}=-\frac{g}{l}\frac{\sin x}{y}$$
it follows that
$$\displaystyle y^2=\frac{2g}{l}\cos x +c $$
If $\mathbf{x}(0)=(x_0,0)$, then
$$ y^2=\frac{2g}{l}(\cos x -\cos x_0)$$
Note that $y=0$ when $x=-x_0$, and that $(2g/l)(\cos x -\cos x_0)>0$ for $|x|<|x_0|<\pi$. Thus each such $x$ has two corresponding values of $y$, and so the solution $\mathbf{x}(t)$ that satisfies $\mathbf{x}(0)=(x_0,0)$ is periodic. We may conclude that $(0,0)$ is a center. In the case of large initial velocities, the pendulum spins in complete circles about the pivot
```{python}
w1 = 2*np.pi
w2 = np.pi
xp = np.linspace(-w1, w1, 100)
yp = np.linspace(-w2, w2, 100)
x, y = np.meshgrid(xp, yp)
g = 9.8
l = 8
xdot = y
ydot = -g/l*np.sin(x)
fig, ax = plt.subplots(figsize=(6, 3))
ax.streamplot(x, y, xdot, ydot,
linewidth=0.5, density=2, color='blue')
ax.set_title('Nonlinear Pendulum')
ax.axis((-w1, w1, -w2, w2))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w1, w1, 5))
ax.xaxis.set_ticklabels([r'$-4\pi$', r'$-2\pi$', r'$0$',
r'$2\pi$', r'$4\pi$'])
ax.set_xlabel(r'$x$')
ax.yaxis.set_ticks(np.linspace(-w2, w2, 3))
ax.yaxis.set_ticklabels([r'$-\pi$', r'$0$', r'$\pi$'])
ax.set_ylabel(r'$y$')
plt.show()
```
* Periodic Solutions of the Pendulum DE
Suppose a bead with mass $m$ slides along a thin wire whose shape is described by the function $z=f(x)$.
A wide variety of nonlinear oscillations can be obtained by changing the shape of the wire and by making
different assumptions about the forces acting on the bead
{width="55%" fig-align="center"}
The tangential force $\mathbf{F}$ due to the weight $W=mg$ $\,$ has a magnitude $mg\sin\theta$, and therefore
the $x$-component of $\mathbf{F}$ is $F_x=-mg\sin\theta\cos\theta$. Since $f'(x)=\tan\theta$, $\,$ we can use the identity $1+\tan^2\theta=\sec^2\theta$ to conclude that
$$
\begin{aligned}
F_x &= -mg\sin\theta\cos\theta
=-mg\tan\theta\cos^2\theta \\
&=-mg\frac{f'(x)}{1 +\left[f'(x)\right]^2}
\end{aligned}
$$
A damping force $\mathbf{D}$, in the direction opposite to the motion, is a constant multiple of the velocitcy
of the bead. The $x$-component of $\mathbf{D}$ is therefore
$$ D_x=-\beta\frac{dx}{dt} $$
It follows from Newton's second law that
$$mx''=-mg\frac{f'(x)}{1 +\left[f'(x)\right]^2}-\beta x' $$
and the corresponding plane autonomous system is
$$
\begin{aligned}
x' &= y\\
y' &= -g\frac{f'(x)}{1 +\left[f'(x)\right]^2}-\frac{\beta}{m} y
\end{aligned}
$$
If $\mathbf{x}_1=(x_1,y_1)$ is a critical point of the system, $y_1=0$ and therefore $f'(x_1)=0$.
The bead must therefore be at rest at a point on the wire where the tangent line is horizontal.
When $f$ is twice differentiable, the Jacobian matrix at $\mathbf{x}_1$ is
$$
\mathbf{g}'(\mathbf{x}_1)=
\begin{pmatrix}
0 & \phantom{-}1\\
-g f''(x_1) & -\frac{\beta}{m}
\end{pmatrix}
$$
and so
$$
\begin{aligned}
\tau &=
-\beta/m \\
\Delta &= gf''(x_1) \\
\tau^2 -4\Delta &= \beta^2/m^2 -4gf''(x_1)
\end{aligned}
$$
We can make the following conclusions:
* $f''(x_1)<0$ : $~$ A relative maximum therefore occurs at $x=x_1$, and since $\Delta<0$, $\,$ an unstable saddle point occurs at $\mathbf{x}_1=(x_1,0)$
* $f''(x_1)>0$ and $\beta>0$: $~$ A relative maximum therefore occurs at $x=x_1$, and since $\tau<0$ and $\Delta>0$, $\,\mathbf{x}_1=(x_1,0)$ is a stable critical point.
If $\beta^2 > 4gm^2f''(x_1)$, the system is **overdamped** and the critical point is a stable node. If $\beta^2 < 4gm^2f''(x_1)$, the system is **underdamped** and the critical point is a stable spiral point. The exact nature of the stable critical point is still in doubt if $\beta^2 = 4gm^2f''(x_1)$
* $f''(x_1)>0$ and the system is undamped ($\beta=0$):
In this case the eigenvalues are pure imaginary, but the phase-plane method can be used to show that the critical point is a center. Therefore solutions with $\mathbf{x}(0)=(x(0),x'(0))$ near $\mathbf{x}_1=(x_1,0)$ are periodic
**Example** $~$ A bead is released from the position $x(0)=x_0$ on the curve $z=\cosh(x)$ with initial velocity $x'(0)=\nu_0$. Use the phase-plane method to show that the resulting solution is periodic when the system is undamped
```{python}
w = 10
xp = np.linspace(-w, w, 200)
yp = np.linspace(-w, w, 200)
x, y = np.meshgrid(xp, yp)
g = 9.8
m = 1
beta = [0, 0.25, 0.5]
sb_title = [r'$\beta=0$', r'$\beta=0.25$', r'$\beta=0.5$']
def df(x):
return np.sinh(x)
fig = plt.figure(figsize=(5, 15))
for i in range(3):
xdot = y
ydot = -g*df(x) /(1 +df(x)**2) -beta[i] /m *y
ax = fig.add_subplot(3, 1, i +1)
ax.streamplot(x, y, xdot, ydot, density=1.5,
linewidth=0.5, color='blue')
ax.set_title(sb_title[i])
ax.axis((-w, w, -w, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(-w, w, 5))
ax.set_ylabel(r'$y$')
ax.yaxis.set_ticks(np.linspace(-w, w, 5))
if i == 2:
ax.set_xlabel(r'$x$')
plt.show()
```
* Lotka-Volterra Predator-Prey Model
There are many predator-prey models that lead to plane autonomous systems with at least one periodic solution.
The first such model was constructed independently by pioneer biomathematicians A. Lotka (1925) and
V. Volterra (1926). If $x$ denotes the number of predators and $y$ denotes the number of prey, then
the Lotka-Volterra model takes the form
$$
\begin{aligned}
x' &= -ax +bxy = x(-a +by)\\
y' &= -cxy +dy = y(-cx +d)
\end{aligned}
$$
where $a$, $b$, $c$, and $d$ are positive constants. The critical points of this plane autonomous system are
$(0,0)$ and $(d/c,a/b)$, and the corresponding Jocobian matrices are
$$
\begin{aligned}
\mathbf{A}_1 &= \mathbf{g}'\left((0,0)\right)=
\begin{pmatrix} -a & 0 \\ \phantom{-}0 & d \end{pmatrix} \\
\mathbf{A}_2 &= \mathbf{g}'\left((d/c,a/b)\right)=
\begin{pmatrix} 0 & bd/c \\ -ac/b & 0 \end{pmatrix}
\end{aligned}
$$
The critical point $(0,0)$ is a saddle point. Since $\mathbf{A}_2$ has pure imaginary eigenvalues
$\lambda=\pm i\sqrt{ad}$, the critical point $(d/c,a/b)$ may be a center. This possibility can be
investigated using the phase-plane method. Since
$$ \frac{dy}{dx}=\frac{y(-cx +d)}{x(-a +by)} $$
we may separate variables and obtain
$$ \int\frac{-a +by}{y}\,dy=\int\frac{-cx +d}{x}\,dx $$
so that
$$ \left(x^d e^{-cx}\right)\left(y^a e^{-by}\right)=F(x)G(y)=c_0 $$
Typical graphs of the nonnegative functions $F(x)=x^d e^{-cx}$ and $G(y)=y^a e^{-by}$ are shown in
{width=85%" fig-align="center"}
It is not hard to show that $F(x)$ has an absolute maximum at $x=d/c$, whereas $G(y)$ has an absolute maximum at $y=a/b$. These graphs can be used to establish the following properties of a solution curve that orginates at a noncritical point $(x_0,y_0)$ in the first quadrant
* If $y=a/b$, $F(x)G(a/b)=c_0$ has two solutions $x_m$ and $x_M$ that satisfy $x_m<d/c<x_M$
* If $x_m<x_1<x_M$ and $x=x_1$, $\,$ then $F(x_1)G(y)=c_0$ has exactly two solutions $y_1$ and $y_2$ that
satisfy $y_1<a/b<y_2$
* If $x$ is outside the interval $[x_m,x_M]$, $\,$ then $F(x)G(y)=c_0$ has no solutions
**Example** $~$ If we let $a=0.1$, $b=0.002$, $c=0.0025$, and $d=0.2$ in the Lotka-Volterra predator-prey model, the critical point in the first quadrant is $(d/c,a/b)=(80,50)$, and we know that this critical point is a center. The eigenvalues of $\mathbf{g}'((80,50))$ are $\lambda=\pm(\sqrt{2}/10)i$, and so the solutions near the critical point have period $p\simeq 10\sqrt{2}\pi$
```{python}
a = 0.1
b = 0.002
c = 0.0025
d = 0.2
def myODE(t, y):
return [-a*y[0] +b*y[0]*y[1], -c*y[0]*y[1] +d*y[1]]
fig, ax = plt.subplots(figsize=(6, 6))
td = 80
t_eval = np.linspace(0, td, 300)
x0 = 0
y0 = 50
for i in range(15):
x0 = x0 +5
sol = solve_ivp(myODE, [0, td], [x0, y0],
t_eval=t_eval)
ax.plot(x0, y0, 'ro')
ax.plot(sol.y[0], sol.y[1], 'b-', linewidth=1)
ax.set_title('Lotka-Volterra model')
w = 400
ax.axis((0, w, 0, w))
ax.set_aspect(aspect='equal')
ax.grid()
ax.tick_params(axis='both', direction='in', pad=5)
ax.xaxis.set_ticks(np.linspace(0, w, 5))
ax.set_xlabel(r'$x$, predator')
ax.yaxis.set_ticks(np.linspace(0, w, 5))
ax.set_ylabel(r'$y$, prey')
plt.show()
```
* Lotka-Volterra Competition Model
A **competitive interaction** occurs when two or more species compete for the food, water, light, and species
resources of an ecosystem. A number of mathematical models have been constructed that offer insights into conditions that permit *coexistence*. If $x$ denotes the number in species I and $y$ denotes the number in species II, then the Lotka-Volterra model takes the form
$$
\begin{aligned}
x' &= \frac{r_1}{K_1} x(K_1 -x -\alpha_{12}y)\\
y' &= \frac{r_2}{K_2} y(K_2 -y -\alpha_{21}x)
\end{aligned}
$$
Note that in the absence of species II ($y=0$), $x'=(r_1/K_1)x(K_1 -x)$, and so the first population grows logistically and approaches the steady-state population $K_1$. A similar statement holds for species II growing in the absence of speices I. The term $-\alpha_{21}xy$ in the second equation stems from the competitive effect
of species I on species II. The model therefore assumes that this rate of inhibition is directly proportional to
the number of possible competitive pairs $xy$ at a particular $t$
This plane autonomous system has critical points at $(0,0)$, $(K_1,0)$, and $(0,K_2)$. When
$\alpha_{12}\alpha_{21}\neq 0$, the lines $K_1 -x -\alpha_{12}y=0$ and $K_2 -y -\alpha_{21}x=0$ intersect to produce a fourth critical point $\hat{\mathbf{x}}=(\hat{x},\hat{y})$