1
00:00:00,000 --> 00:00:04,040
Included one of the terms out of the two.
So, let's look at the other one.

2
00:00:07,960 --> 00:00:12,600
Okay.
Now, the other term is here.

3
00:00:21,340 --> 00:00:25,813
A non-linearity.
Now, it's not that often you can solve

4
00:00:25,813 --> 00:00:29,955
non-linear ODEs exactly, sometimes you
can, okay?

5
00:00:29,955 --> 00:00:33,517
But this one here, you can solve it
exactly.

6
00:00:33,517 --> 00:00:37,428
In fact,
The solution to this is just simply here.

7
00:00:37,428 --> 00:00:50,220
Let me write it down for you.
There's this solution.

8
00:00:51,200 --> 00:00:54,609
Pretty nice.
Give it the initial value.

9
00:00:54,609 --> 00:00:57,660
Multiply by the space factor.
Done.

10
00:00:59,320 --> 00:01:03,250
So, what you see here is the two pieces,
each individually,

11
00:01:03,250 --> 00:01:07,870
I can actually solve exactly.
I don't have to put this ODE45 either,

12
00:01:07,870 --> 00:01:10,214
Right?
What is the big cost for us?

13
00:01:10,214 --> 00:01:15,523
Part of the big cost for us is when we
take time steps, is we have to develop

14
00:01:15,523 --> 00:01:20,695
these time stepping algorithms, right?
We have to say, okay, ODE45 to march me

15
00:01:20,695 --> 00:01:25,177
forward into the future.
I already have the exact solution in the

16
00:01:25,177 --> 00:01:28,205
future.
So, if you think about it, you could say,

17
00:01:28,205 --> 00:01:31,011
well,
This is a perfect place for using the

18
00:01:31,011 --> 00:01:36,492
split step method cuz in the split step
method, what I could do is take a delta t

19
00:01:36,492 --> 00:01:40,800
of this and a delta t of that,
And I have exact solutions for both.

20
00:01:41,260 --> 00:01:45,176
So, I not even, I'm not even doing time
stepping anymore.

21
00:01:45,176 --> 00:01:48,310
I'm just taking, taking my initial
condition,

22
00:01:48,310 --> 00:01:53,295
Ha, take a delta t of each one.
And I know the exact expressions for them,

23
00:01:53,295 --> 00:01:58,280
and I got myself into the future.
So, let's look at how this might look.

24
00:02:00,340 --> 00:02:06,160
Alright.
So, here's an algorithm for doing this.

25
00:02:13,160 --> 00:02:17,406
Alright, did I spell that right?
[laugh] Okay good, I think I did.

26
00:02:17,406 --> 00:02:20,777
Alright.
Sometime when you look at words they just,

27
00:02:20,777 --> 00:02:24,080
see that's why I told you not to spell in
public.

28
00:02:25,160 --> 00:02:29,301
Alright.
Here's the algorithm.

29
00:02:29,301 --> 00:02:38,906
Start off with the initial condition.
U0.

30
00:02:39,769 --> 00:02:46,300
So, this your initial function at, let's
say, time zero.

31
00:02:47,260 --> 00:02:52,060
Okay. Now, we can do one of two things.
We could either take a step in the

32
00:02:52,060 --> 00:02:55,860
dispersion first or in the nominary second
or vice versa.

33
00:02:55,860 --> 00:02:59,860
But, let's go ahead a take a step first in
the dispersion,

34
00:03:00,160 --> 00:03:01,448
Okay?
Step two, then.

35
00:03:01,448 --> 00:03:04,838
Let's come back and tell, see what this
says to us.

36
00:03:04,838 --> 00:03:10,127
This just says, okay, I need to take a
delta t forward here and what I'll do is,

37
00:03:10,127 --> 00:03:12,703
here's my formula.
This is exact, right?

38
00:03:12,703 --> 00:03:17,450
All I've got to do is take my initial
condition before you transform it,

39
00:03:17,450 --> 00:03:22,400
multiply it by this factor.
That gives me u hat and I want u which is

40
00:03:22,400 --> 00:03:25,882
just the inverse Fourier transformer bit.
So.

41
00:03:26,072 --> 00:03:27,274
Delta t [inaudible].
Yes.

42
00:03:27,464 --> 00:03:32,841
And that'll be delta t, exactly.
Okay? So, what we're going to do here is

43
00:03:32,841 --> 00:03:37,240
calculate, let's call it the dispersion
effect.

44
00:03:37,660 --> 00:03:42,760
And it's going to give us a solution you
want which is, what we're going to do is

45
00:03:42,760 --> 00:03:47,820
we're going to take the FFT of this u0,
multiply it.

46
00:03:48,100 --> 00:04:01,000
Times i, k squared, delta t over two.
And then, just inverse Fourier transform

47
00:04:01,000 --> 00:04:11,363
It cost me N log N to do this,
Okay? So, it's very, very fast.

48
00:04:11,363 --> 00:04:14,191
I'm not, I'm not using an ODE solver,
right?

49
00:04:14,191 --> 00:04:18,207
So, when you first look at that equation,
you think, oh, like, I've got, I'm

50
00:04:18,207 --> 00:04:21,883
stepping forward into the future. I've got
a, you know, Fourier transform and

51
00:04:21,883 --> 00:04:25,898
everything. ODE45 forward into time.
No, not in this case.

52
00:04:25,898 --> 00:04:30,197
I'm taking advantage of the fact that,
pretty much, I know the exact solution.

53
00:04:30,197 --> 00:04:34,320
Okay?
And this highlights something more

54
00:04:34,320 --> 00:04:39,144
important that's there.
Anytime you have information about your

55
00:04:39,144 --> 00:04:45,371
solutions and you're not making use of the
fact that you know something, you're being

56
00:04:45,371 --> 00:04:49,013
dumb, okay?
Alright. You always take advantage, every

57
00:04:49,013 --> 00:04:53,746
single time you can, anything you know,
you bring into the problem.

58
00:04:53,746 --> 00:04:57,824
If you know it, make use of it, okay?
Always, always, always.

59
00:04:57,824 --> 00:05:03,723
By the way, you don't have to make use of
it, you can do the slow way that doesn't

60
00:05:03,723 --> 00:05:08,349
take advantage of anything.
But, this is what you really want to do

61
00:05:08,349 --> 00:05:12,236
when you program.
Take advantage of the things you know.

62
00:05:12,236 --> 00:05:16,600
I just took a delta t step forward, just
using the dispersion.

63
00:05:16,600 --> 00:05:23,571
And now,
I want to take, instead of the dispersion,

64
00:05:23,571 --> 00:05:29,739
Now I want to take the non-linearity.
So, the non-linearities has a formula

65
00:05:29,739 --> 00:05:33,401
there, and here it is.
It just says, if I want to go forward,

66
00:05:33,401 --> 00:05:38,567
If I have some initial condition to get
delta t into the future, I just, there's

67
00:05:38,567 --> 00:05:41,837
my formula.
Now, that becomes a delta t. And usually

68
00:05:41,837 --> 00:05:44,453
this turns out u1.
U1 is the initial condition for this.

69
00:05:44,453 --> 00:05:49,180
Okay?
Alright. So, let's call this u2.

70
00:05:49,580 --> 00:05:59,994
U2 now is you just take this u1 and
multiply it by exponent i u1 squared,

71
00:05:59,994 --> 00:06:04,661
delta t,
Okay?

72
00:06:04,661 --> 00:06:11,195
This is the exact solution to this thing.
And I've taken advantage of that.

73
00:06:11,195 --> 00:06:17,200
Three, step four, I guess, then you just
say, alright, u0 is equal to u2.

74
00:06:17,200 --> 00:06:17,200
I'm sorry.
Delta t or deta t, or delta t with delta

75
00:06:17,200 --> 00:06:24,682
t? been in [inaudible] What's your?
Delta t over two.

76
00:06:25,069 --> 00:06:28,633
But that's the, the increment is delta t,
right?

77
00:06:28,865 --> 00:06:32,815
Mm-hm.
And then, number three increase delta t

78
00:06:32,815 --> 00:06:33,822
again.
Yep.

79
00:06:34,055 --> 00:06:35,526
So, is t2<i>(delta equal to two delta t??
Or is it.</i>

80
00:06:35,759 --> 00:06:37,695
No, no.
No, just delta t.

81
00:06:37,928 --> 00:06:43,273
I'm taking a delta t step forward.
So, it's kind of like you're saying,

82
00:06:43,273 --> 00:06:47,920
basically, I want to evolve the physics
from zero to delta t.

83
00:06:47,920 --> 00:06:49,160
Yep.
Um-hm, um-hm.

84
00:06:49,819 --> 00:06:51,969
Yeah, that's right, that's right.
Yeah.

85
00:06:52,148 --> 00:06:55,194
Oh, one parenthesis missing.
So, is everybody okay with that?

86
00:06:55,194 --> 00:06:58,180
There's your little algorithm, boom, boom,
boom, boom.

87
00:06:58,180 --> 00:07:02,898
And, oftentimes if you can take advantage
of that kind of structure, if you have

88
00:07:02,898 --> 00:07:07,616
your pieces of your dynamics that are
sitting there in your PDE that are kind of

89
00:07:07,616 --> 00:07:12,333
being separated and you know how to solve
some of those pieces, this is awesome.

90
00:07:12,333 --> 00:07:17,111
Couple of things that are nice about it.
One, we talked about numerical stiffness,

91
00:07:17,111 --> 00:07:20,309
right?
Here, totally just gets rid of numerical

92
00:07:20,309 --> 00:07:23,929
stiffness.
Why? Because you have actually used exact

93
00:07:23,929 --> 00:07:25,349
solutions.
Fantastic.

94
00:07:25,349 --> 00:07:26,555
It's great,
Right?

95
00:07:26,555 --> 00:07:32,092
So, when you have things like that, in
fact, when you think about what we talked

96
00:07:32,092 --> 00:07:38,769
about in terms of the integrating factor
method with removing numerical stiffness,

97
00:07:38,769 --> 00:07:43,171
it's kind of something like this but this
taking it one step further.

98
00:07:43,171 --> 00:07:47,702
And you're saying, just take steps
independently. If delta t is small enough,

99
00:07:47,702 --> 00:07:49,680
you'll be in pretty good shape.

