1
00:00:04,180 --> 00:00:07,160
CLEVE MOLER: The Lorenz
strange attractor, perhaps

2
00:00:07,160 --> 00:00:10,450
the world's most
famous and extensively

3
00:00:10,450 --> 00:00:14,510
studied ordinary
differential equations.

4
00:00:14,510 --> 00:00:20,270
They were discovered in
1963 by an MIT mathematician

5
00:00:20,270 --> 00:00:23,820
and meteorologist,
Edward Lorenz.

6
00:00:23,820 --> 00:00:27,780
They started the field of chaos.

7
00:00:27,780 --> 00:00:31,400
They're famous because
they are sensitive

8
00:00:31,400 --> 00:00:34,380
to their initial conditions.

9
00:00:34,380 --> 00:00:36,790
Small changes in the
initial conditions

10
00:00:36,790 --> 00:00:41,070
have a big effect
on the solution.

11
00:00:41,070 --> 00:00:44,780
Lorenz is famous for talking
about the butterfly effect.

12
00:00:44,780 --> 00:00:51,820
How flapping of butterflies'
wings can affect the weather.

13
00:00:51,820 --> 00:00:58,000
A butterfly flying in
Brazil can cause a tornado

14
00:00:58,000 --> 00:01:05,440
and Texas is a flamboyant
version of a talk he gave.

15
00:01:08,410 --> 00:01:12,280
The equations are almost linear.

16
00:01:12,280 --> 00:01:16,320
There's two
quadratic terms here.

17
00:01:16,320 --> 00:01:23,450
The equations come out
of a model of fluid flow.

18
00:01:23,450 --> 00:01:26,710
The Earth's
atmosphere is a fluid.

19
00:01:26,710 --> 00:01:31,370
But this range of parameters,
the three parameters, sigma,

20
00:01:31,370 --> 00:01:35,420
rho, and beta, these
are outside the range

21
00:01:35,420 --> 00:01:41,830
that actually represents
the Earth's atmosphere.

22
00:01:41,830 --> 00:01:43,840
We're going to take a
look at these parameters.

23
00:01:43,840 --> 00:01:47,230
These are the most
commonly used parameters.

24
00:01:47,230 --> 00:01:54,775
But we're going to be interested
in other values of rho as well.

25
00:02:01,510 --> 00:02:04,110
But I'm a matrix guy,
so I like to write

26
00:02:04,110 --> 00:02:06,090
the equations in this form.

27
00:02:06,090 --> 00:02:08,400
Y dot equals Ay.

28
00:02:08,400 --> 00:02:12,716
It looks linear except
A depends upon y.

29
00:02:12,716 --> 00:02:16,900
And so there's y2, the
second component of y,

30
00:02:16,900 --> 00:02:20,500
appears in the matrix A.

31
00:02:20,500 --> 00:02:26,100
This helps me study the
differential equations

32
00:02:26,100 --> 00:02:29,210
in this form.

33
00:02:29,210 --> 00:02:33,110
This matrix form is
convenient for finding

34
00:02:33,110 --> 00:02:34,920
the critical points.

35
00:02:34,920 --> 00:02:38,760
Put a parameter
eta in place of y2.

36
00:02:38,760 --> 00:02:41,430
Try to make the matrix singular.

37
00:02:41,430 --> 00:02:44,780
That happens when eta is beta
times the square root of rho

38
00:02:44,780 --> 00:02:46,300
minus 1.

39
00:02:46,300 --> 00:02:53,020
And then the null vector
is the critical point.

40
00:02:53,020 --> 00:02:59,690
If we take this vector as the
starting value of the solution,

41
00:02:59,690 --> 00:03:02,430
then the solution stays there.

42
00:03:02,430 --> 00:03:06,250
Y prime is 0.

43
00:03:06,250 --> 00:03:11,090
This is an unstable
critical point.

44
00:03:11,090 --> 00:03:22,090
And values near this solution
deviate the solution.

45
00:03:22,090 --> 00:03:23,535
Won't stay near the solution.

46
00:03:27,210 --> 00:03:35,950
In May of 2014, I wrote a series
and blog post in Cleve's Corner

47
00:03:35,950 --> 00:03:41,240
about the MATLAB ordinary
differential equations suite.

48
00:03:41,240 --> 00:03:50,660
And I used the Lorenz
attractor as an example.

49
00:03:50,660 --> 00:03:55,080
And I included a program
called Lorenz plot

50
00:03:55,080 --> 00:03:56,525
that I'd like to use here.

51
00:04:02,940 --> 00:04:06,650
Here's Lorenz plot.

52
00:04:06,650 --> 00:04:09,150
Set the parameters.

53
00:04:09,150 --> 00:04:13,110
Set the initial value
of the matrix A.

54
00:04:13,110 --> 00:04:16,720
Here is the critical point.

55
00:04:16,720 --> 00:04:20,950
Here is an initial value
near the critical point.

56
00:04:20,950 --> 00:04:24,210
Integrate from 0 to 30.

57
00:04:24,210 --> 00:04:25,816
Use ODE 23.

58
00:04:28,860 --> 00:04:32,410
Give it a function called
the Lorenz equation.

59
00:04:32,410 --> 00:04:38,520
Capture the values t and y
and then plot the solution.

60
00:04:38,520 --> 00:04:44,440
I'm going to do a plot with
the three components offset

61
00:04:44,440 --> 00:04:46,100
from each other.

62
00:04:46,100 --> 00:04:50,960
And here's an internal
function Lorenz equation

63
00:04:50,960 --> 00:04:54,800
that is called by ODE 23.

64
00:04:54,800 --> 00:04:58,130
And it continuously,
every time it called,

65
00:04:58,130 --> 00:05:05,470
it modifies the matrix A updates
it with the new values of y2.

66
00:05:05,470 --> 00:05:09,525
So let's run that function.

67
00:05:16,800 --> 00:05:18,820
And here's the output.

68
00:05:18,820 --> 00:05:22,460
Here is the three components
of the Lorenz attractor.

69
00:05:22,460 --> 00:05:25,350
Time series is functions of t.

70
00:05:25,350 --> 00:05:27,500
It's pretty hard to see
what's going on here

71
00:05:27,500 --> 00:05:31,990
except to say they start out
with their initial values,

72
00:05:31,990 --> 00:05:34,680
oscillate around
them, close them

73
00:05:34,680 --> 00:05:38,920
through for a little while,
and then begin to deviate.

74
00:05:38,920 --> 00:05:42,000
And it's hard to see
what they're doing.

75
00:05:42,000 --> 00:05:48,330
They're just oscillating in
an unpredictable fashion.

76
00:05:48,330 --> 00:05:51,720
We need another graphic to see
what's really going on here.

77
00:05:55,970 --> 00:05:59,180
I want to write a program
called Lorenz GUI.

78
00:05:59,180 --> 00:06:02,340
Lorenz Graphic User Interface.

79
00:06:02,340 --> 00:06:08,190
That's out of my old book
calle this one is really

80
00:06:08,190 --> 00:06:11,750
out of Numerical Computing
with MATLAB, NCM.

81
00:06:15,190 --> 00:06:18,670
OK, I hit the Start button.

82
00:06:18,670 --> 00:06:21,440
Here are the two
critical points in green.

83
00:06:21,440 --> 00:06:24,680
We started near
the critical point.

84
00:06:24,680 --> 00:06:27,480
We oscillate around
the critical point.

85
00:06:27,480 --> 00:06:36,290
And here is the orbit.

86
00:06:36,290 --> 00:06:38,860
This is just going
back and forth.

87
00:06:38,860 --> 00:06:41,570
It oscillates around
one critical point then

88
00:06:41,570 --> 00:06:45,390
decides to go over and oscillate
around the other for a while.

89
00:06:45,390 --> 00:06:49,030
It continues around
like this forever.

90
00:06:49,030 --> 00:06:50,870
This is not periodic.

91
00:06:50,870 --> 00:06:53,620
It never repeats.

92
00:06:53,620 --> 00:06:58,620
Now, the butterfly is associated
with Lorenz in two ways.

93
00:06:58,620 --> 00:07:03,120
One is the butterfly
effect on the weather.

94
00:07:03,120 --> 00:07:07,190
Also, this plot looks
like a butterfly.

95
00:07:07,190 --> 00:07:11,700
I can grab this with
my mouse and rotate it

96
00:07:11,700 --> 00:07:13,560
in three dimensions.

97
00:07:13,560 --> 00:07:16,880
So I can get different
views of the orbit.

98
00:07:16,880 --> 00:07:19,180
It's still being computed.

99
00:07:19,180 --> 00:07:22,640
We're adding more
and more to the plot.

100
00:07:22,640 --> 00:07:27,270
And I can look at it from
different points of view

101
00:07:27,270 --> 00:07:32,900
to get some notion
of how this is

102
00:07:32,900 --> 00:07:35,590
proceeding in three dimensions.

103
00:07:35,590 --> 00:07:38,420
It almost lives in two
dimensions, but not quite.

104
00:07:45,010 --> 00:07:48,370
Earlier, we've seen solutions,
differential equations

105
00:07:48,370 --> 00:07:50,810
with periodic solutions.

106
00:07:50,810 --> 00:07:54,470
Here, this isn't periodic.

107
00:07:54,470 --> 00:07:59,360
Just going like this
[? forever. ?] Now,

108
00:07:59,360 --> 00:08:04,350
this is perfectly--
this isn't random.

109
00:08:04,350 --> 00:08:08,300
This is completely determined
by the initial conditions.

110
00:08:08,300 --> 00:08:12,580
If I were to start it over again
with those exact conditions,

111
00:08:12,580 --> 00:08:14,970
with those exact
initial conditions,

112
00:08:14,970 --> 00:08:18,610
I'd get exactly this behavior.

113
00:08:18,610 --> 00:08:20,820
But it's unpredictable.

114
00:08:20,820 --> 00:08:24,700
It's hard to say
where this is going.

115
00:08:24,700 --> 00:08:30,740
I can clear this out and see
the orbit continue to develop.

116
00:08:35,419 --> 00:08:36,272
Press Stop.

117
00:08:46,360 --> 00:08:47,750
Now I have a choice.

118
00:08:47,750 --> 00:08:52,860
This pull down
menu here allows me

119
00:08:52,860 --> 00:08:55,720
to choose other values of rho.

120
00:08:55,720 --> 00:09:01,710
28 is the value of rho that
is almost always studied,

121
00:09:01,710 --> 00:09:05,620
but there's a book
by a Colin Sparrow

122
00:09:05,620 --> 00:09:12,460
that I've referenced in my in
my blog about periodic solutions

123
00:09:12,460 --> 00:09:14,410
to Lorenz equations.

124
00:09:14,410 --> 00:09:15,880
And let's take another value.

125
00:09:15,880 --> 00:09:21,393
Let me choose rho equal to
160 and clear and restart.

126
00:09:24,890 --> 00:09:37,770
Now, after an initial
transient, this is now periodic.

127
00:09:37,770 --> 00:09:42,630
So this is not chaos.

128
00:09:42,630 --> 00:09:45,595
This is a periodic solution.

129
00:09:49,630 --> 00:09:53,370
And these other
values of rho, not rho

130
00:09:53,370 --> 00:09:58,030
equals 28, that's chaotic,
but these other values of rho

131
00:09:58,030 --> 00:10:01,660
give periodic solutions
with different character.

132
00:10:01,660 --> 00:10:05,000
That's a long,
interesting story that I

133
00:10:05,000 --> 00:10:10,030
talk about in my blog
following the work of Sparrow.