1
00:00:11,290 --> 00:00:18,100
So are there any questions? Any questions
regarding box functions, hat functions what
2
00:00:18,100 --> 00:00:23,160
we have done so far, no okay that is fine.
3
00:00:23,160 --> 00:00:41,570
So what we have done so far in the last class
is we have defined hat functions, and the
4
00:00:41,570 --> 00:00:55,390
hat function was defined as follows. The hat
function centered about the point i right,
5
00:00:55,390 --> 00:01:05,960
so there is some interval a, b, we have created
N+1 points which results in N intervals, the
6
00:01:05,960 --> 00:01:13,399
hat function centered about the point i for
now for just for the sake of this discussion
7
00:01:13,399 --> 00:01:17,220
we will assume that all the intervals are
equal in size, but you see the way I have
8
00:01:17,220 --> 00:01:21,660
defined the hat function they need not be
of equal intervals okay.
9
00:01:21,660 --> 00:01:32,780
So the points involved are xi, xi+1 and xi-1.
So the hat function that is centered about
10
00:01:32,780 --> 00:01:47,100
xi takes the value 1 at xi, and drops in a
linear fashion to 0 at xi-1 and xi+1, and
11
00:01:47,100 --> 00:01:56,110
from there over the rest of the interval in
our problem it is 0. So the support of the
12
00:01:56,110 --> 00:02:09,950
function it is the support of the hat function
spans 2 intervals as supposed to the box function
13
00:02:09,950 --> 00:02:16,970
which was over only one interval fine. So
the Ni’s are not quite orthogonal to each
14
00:02:16,970 --> 00:02:17,970
other.
15
00:02:17,970 --> 00:02:29,879
So if you take Ni dot Nj, Ni and we take a
dot product with Nj they are not quite orthogonal
16
00:02:29,879 --> 00:02:38,301
to each other, so what does this turn out
to be? What is Ni dot Nj? Well, if Ni and
17
00:02:38,301 --> 00:02:44,599
Nj were 2 functions I and j are 2 functions
that have absolutely no overlap, then we know
18
00:02:44,599 --> 00:02:56,510
what the answer is, so they have absolutely
no overlap right, so this is Nj then Ni dot
19
00:02:56,510 --> 00:03:05,579
Nj is 0. On the other hand, if they do have
an overlap, the overlap can come in different
20
00:03:05,579 --> 00:03:06,950
forms.
21
00:03:06,950 --> 00:03:13,360
One is that the overlap can be over the interval
xi-1, xi, it could be over the interval xi,
22
00:03:13,360 --> 00:03:22,730
xi+1, or it could be over the whole xi-1 to
xi+1 okay, so we have 3 cases. So what do
23
00:03:22,730 --> 00:03:35,349
they work out? What is Ni-1 dotted with Ni?
Right, Ni-1 dotted with Ni is a hat function
24
00:03:35,349 --> 00:03:51,459
that is centered at i-1 and is 0 everywhere,
see the overlap clearly is over the interval
25
00:03:51,459 --> 00:04:08,620
xi-1, xi okay. So this in fact turns out to
be integral xi-1 to xi, what is this xi -1
26
00:04:08,620 --> 00:04:35,510
to xi obviously right alpha i
x and 1-alpha i alpha of i or i-1 call that
27
00:04:35,510 --> 00:04:39,520
i or i-1 dx.
28
00:04:39,520 --> 00:05:02,540
Where alpha i is a function of x is xi-xi-1/xi-xi-1,
I have a feeling I defined it as alpha i-1
29
00:05:02,540 --> 00:05:10,910
yesterday, it does not matter, I have feeling
I may have defined this alpha i-1 it does
30
00:05:10,910 --> 00:05:26,290
not matter. What does this integral turn out
to be xi-xi-1/6, you can check this out check
31
00:05:26,290 --> 00:05:37,890
that out okay. Now what about the other possibility
which is Ni dot Ni that i=j right, this was
32
00:05:37,890 --> 00:06:05,650
j=i-1, this is j=i, just give me the integral
xi-1 to xi+1 Ni squared dx okay, and what
33
00:06:05,650 --> 00:06:08,940
will this turn out to be?
34
00:06:08,940 --> 00:06:12,640
You have to split this into 2 this is just
integration so I am going to leave you to
35
00:06:12,640 --> 00:06:31,430
do it xi Ni squared dx+ xi to xi+1 Ni squared
dx, each one of them is basically each of
36
00:06:31,430 --> 00:06:37,300
these elements here is basically linear, linear
square gives me a quadratic integrate it gives
37
00:06:37,300 --> 00:06:43,120
me a cubic right, there are 2 of them. So
this in fact turns out to you can check this
38
00:06:43,120 --> 00:07:05,420
out 2/3 xi+1-xi, and we are assuming equal
intervals you have to a little more careful
39
00:07:05,420 --> 00:07:06,420
here.
40
00:07:06,420 --> 00:07:15,060
Because this interval may not be the same
that is xi+1-xi is the same as xi-xi-1 is
41
00:07:15,060 --> 00:07:24,350
like some h okay, since I have introduced
the idea of an h here this is like h/6 and
42
00:07:24,350 --> 00:07:32,889
this is like 2 h/3 fine okay.
43
00:07:32,889 --> 00:07:40,090
And what is the other one? The other one is
going to be the same now, Ni+1 dotted with
44
00:07:40,090 --> 00:07:55,170
Ni is going to be basically h/6, so Ni dot
Nj otherwise so for all other j for all other
45
00:07:55,170 --> 00:08:15,639
j meaning j !=i-1, i, i+1 for all other j,
what do we have? Ni, Nj, Ni or Ni Nj=0 okay,
46
00:08:15,639 --> 00:08:26,430
not quite orthogonal. So it is not as good
as the box functions right, so we have an
47
00:08:26,430 --> 00:08:33,880
overlap that consists of 3 of these functions,
so we will have to worry about that every
48
00:08:33,880 --> 00:08:36,930
time we take a dot product or something of
that sort, we will have to worry about that.
49
00:08:36,930 --> 00:08:42,339
But what did you get in exchange for that?
What we got in exchange for that is that we
50
00:08:42,339 --> 00:08:51,540
can represent on any given interval, we can
represent a linear function. So if you take
51
00:08:51,540 --> 00:09:12,329
i-1, i, i+1 using hat function of course using
one hat function, you have only one hat function,
52
00:09:12,329 --> 00:09:18,310
you can only change that one value right using
one hat function you can change only one value.
53
00:09:18,310 --> 00:09:26,089
But the minute you introduce another hat function
you can actually represent a linear interpolant
54
00:09:26,089 --> 00:09:30,529
between the 2, is that fine.
55
00:09:30,529 --> 00:09:36,870
So what we have got? What we have is that
we have an overlap of the hat functions, and
56
00:09:36,870 --> 00:09:41,930
therefore, we do not have pure orthogonality
but we have locality. We have locality in
57
00:09:41,930 --> 00:09:46,910
the sense that if I were to change if I were
to move change this one value, all it could
58
00:09:46,910 --> 00:09:52,170
do is influence the function in these 2 intervals,
it is not 1 interval like in the box function,
59
00:09:52,170 --> 00:09:56,410
it is only 2 intervals. It is not as though
the whole interval if I have a polynomial
60
00:09:56,410 --> 00:10:00,589
and I change the value, then the function
changes on the whole interval okay, on the
61
00:10:00,589 --> 00:10:02,820
whole length of our problem domain.
62
00:10:02,820 --> 00:10:09,250
Whereas here we have broken it up into sub
intervals right, and in the length i- we can
63
00:10:09,250 --> 00:10:16,310
restrict any change that I make here, we can
restrict it to those 2 intervals, is that
64
00:10:16,310 --> 00:10:22,990
fine okay. So we do not quite have orthogonality,
but we have some element of orthogonality
65
00:10:22,990 --> 00:10:31,670
between the various functions okay right.
So both in the case of the box functions and
66
00:10:31,670 --> 00:10:39,589
in the case of hat functions, I am not going
to bother to make these orthonormal okay.
67
00:10:39,589 --> 00:10:43,350
I am not going to try to make them normal,
which means I am not going to try to make
68
00:10:43,350 --> 00:10:50,069
their magnitude 1, and in the case of the
box function also I did not bother to make
69
00:10:50,069 --> 00:11:06,819
the magnitude 1. Why would I do that? What
do I gain from it? Why would I do that, look
70
00:11:06,819 --> 00:11:12,089
at this function or look at this function
why would I do that, why would I leave the
71
00:11:12,089 --> 00:11:23,730
value to which the function grows the hat
function grows, why would I leave it at 1?
72
00:11:23,730 --> 00:11:34,379
Clearly, Ni which is the magnitude is 2/3
right 2/3 h, so instead of going up to 1,
73
00:11:34,379 --> 00:11:44,330
if I go up to square root of 3/2 h, then the
magnitude Ni dot Ni would be 1. why do not
74
00:11:44,330 --> 00:11:59,829
I bother to do it? ”Professor - Student
conversation starts” (()) (11:48) so constructing
75
00:11:59,829 --> 00:12:03,360
and finding the coefficients will be easier,
that is the key, finding the coefficients
76
00:12:03,360 --> 00:12:06,069
will be easier I will tell you what I mean
by that. “Professor - Student conversation
77
00:12:06,069 --> 00:12:09,769
ends.” So let me leave that because I will
need that a little later, I will tell you
78
00:12:09,769 --> 00:12:13,029
what I mean by this.
79
00:12:13,029 --> 00:12:21,920
So if you want to represent, if we were to
say that f of x I am going to represent as
80
00:12:21,920 --> 00:12:28,339
summation over i I am not going to locate
the interval right upper limit and lower limit
81
00:12:28,339 --> 00:12:39,800
we look at that, that is why that figure is
left there, ai Ni and
82
00:12:39,800 --> 00:12:49,430
since I have already introduced the idea that
h is like xi+1-xi for any i right, I change
83
00:12:49,430 --> 00:12:54,980
it from each equals which is like okay. Because
we know that they need not be actually equivalent
84
00:12:54,980 --> 00:12:55,980
rules.
85
00:12:55,980 --> 00:13:00,279
So I will introduce this notation I may not
consistently follow this notation, but this
86
00:13:00,279 --> 00:13:04,999
is just so that you are aware of the notation
okay, where it is clear I will drop the h,
87
00:13:04,999 --> 00:13:11,019
but very often to distinguish between the
function that we want to represent and its
88
00:13:11,019 --> 00:13:17,399
representation to distinguish between them
we stick an h on top right, I may use different
89
00:13:17,399 --> 00:13:25,139
f’s but it is stick an h on top right. To
distinguish between a representation that
90
00:13:25,139 --> 00:13:27,639
is on some grid right.
91
00:13:27,639 --> 00:13:33,540
I am using this word grid for the first time
some grid which is typically of size h, I
92
00:13:33,540 --> 00:13:39,100
will call it f of h and f is the original
function that we are trying to represent,
93
00:13:39,100 --> 00:13:43,569
I do this because we are aware now that these
2 need not be the same that there is an error
94
00:13:43,569 --> 00:13:48,040
in representation. So the distinguish between
the 2 I give it a notation that is like this,
95
00:13:48,040 --> 00:13:55,009
so f of h is ai Ni, if we followed the usual
process, what we would have to do is we would
96
00:13:55,009 --> 00:13:57,869
have to take dot product to find the coefficient.
97
00:13:57,869 --> 00:14:06,040
But if I let Ni go only up to 1, then I have
the advantage that if the function value at
98
00:14:06,040 --> 00:14:18,519
the ith grid point is say 0.5, and Ni itself
takes a magnitude only 1, then ai turns out
99
00:14:18,519 --> 00:14:25,360
to be 0.5 that is the idea okay, so finding
the coefficients is easy. If you have tabulated
100
00:14:25,360 --> 00:14:32,759
data, you perform an experiment you have tabulated
data you want to find the hat function representation
101
00:14:32,759 --> 00:14:38,220
to it, you have the coefficients in the tabulated
data, you already have it that is the idea
102
00:14:38,220 --> 00:14:39,660
right, that is the advantage.
103
00:14:39,660 --> 00:14:44,309
That is why I do not make it normal, I do
not make it a unit vector, if I make it a
104
00:14:44,309 --> 00:14:48,689
unit vector then I lose that I will have to
go through and write the process the data
105
00:14:48,689 --> 00:14:55,060
more, so it helps me in a situation here it
helps me not to have to process the data right.
106
00:14:55,060 --> 00:14:59,059
So the ai is become automatically the values
the function values at those nodal points
107
00:14:59,059 --> 00:15:15,389
is that clear fine everyone okay. So ai is
the function value or the value of the function
108
00:15:15,389 --> 00:15:21,160
f of xi.
109
00:15:21,160 --> 00:15:31,059
So this in fact becomes f of h x is summation
over i f of xi which I will very often just
110
00:15:31,059 --> 00:15:44,199
call i f i Ni, and they should be from this
would really be the summation should go from
111
00:15:44,199 --> 00:15:47,480
1 through N but we need to have we have to
say something about what happens at the end
112
00:15:47,480 --> 00:15:53,261
points okay. So let us go back here and see
what happens at the end points? So what do
113
00:15:53,261 --> 00:16:01,429
I have here. so apparently I have 1 interval
here, so I have that.
114
00:16:01,429 --> 00:16:07,009
And finally there is nothing on the left hand
side my problem starts here, so I only get
115
00:16:07,009 --> 00:16:15,269
half a hat function. So my very first function,
if I were to draw it separately my very first
116
00:16:15,269 --> 00:16:27,420
function would be this N1 or N0 depending
on I have to actually you do have to be a
117
00:16:27,420 --> 00:16:42,449
bit careful with my, because I have count
starts from 0, so I have that is 0, that is
118
00:16:42,449 --> 00:16:49,389
1, and it goes on that is i, i+1, then we
go to the other extreme let us go to the other
119
00:16:49,389 --> 00:16:50,470
extreme.
120
00:16:50,470 --> 00:16:59,690
What do we have at the other extreme? We have
one more hat function here, one more hat function
121
00:16:59,690 --> 00:17:10,760
here, and finally I have one last hat function
here, and that will turn out to be the last
122
00:17:10,760 --> 00:17:26,459
hat function will turn out to be this function,
there are N intervals, and this is going to
123
00:17:26,459 --> 00:17:37,580
be, the count starts at 0 that is going to
be N, so the upper limit is going to be N
124
00:17:37,580 --> 00:17:41,410
is that fine okay, has any questions.
125
00:17:41,410 --> 00:17:47,790
Using these functions, it is actually possible
now that we can represent any function that
126
00:17:47,790 --> 00:18:01,740
we want as a piecewise linear straight line,
polyline. So if you had some functional variation,
127
00:18:01,740 --> 00:18:10,960
you have the functional values the f set xi
it is actually possible for you right to represent
128
00:18:10,960 --> 00:18:23,659
it as a polyline right, this is piecewise
straight lines, and it is continuous. “Professor
129
00:18:23,659 --> 00:18:34,900
- Student conversation starts” are there
any questions? (()) (18:25) unlike the box
130
00:18:34,900 --> 00:18:55,580
function integral f of x and integral f h
of x is the same, well we actually have to
131
00:18:55,580 --> 00:18:57,990
find out this is not conserved.
132
00:18:57,990 --> 00:19:00,940
So we need to do a little analysis as what
we have right now okay. “Professor - Student
133
00:19:00,940 --> 00:19:05,420
conversation ends.” So one of the things
that we have to do is maybe something I will
134
00:19:05,420 --> 00:19:12,080
do something I will leave for you to try it
out, so first question that you have is what
135
00:19:12,080 --> 00:19:22,160
is f of x-f h of x the norm of this okay,
so this is one question, what is the norm
136
00:19:22,160 --> 00:19:27,430
of this, am I making sense. So in a sense
that is connected to what you are saying right
137
00:19:27,430 --> 00:19:28,430
now.
138
00:19:28,430 --> 00:19:35,130
So what is this now? What does this turn out
to be? Why did we work there? What is the
139
00:19:35,130 --> 00:19:41,600
in the case of the box function right. Here,
it is very clear here I said I left it as
140
00:19:41,600 --> 00:19:45,350
one, so that the function value comes out
immediately, in the case of the box function
141
00:19:45,350 --> 00:19:52,830
what did we get in exchange? So in the case
of the box function do you understand the
142
00:19:52,830 --> 00:20:01,930
question, I said that I have a box function
and I said that I left this at 1 right, I
143
00:20:01,930 --> 00:20:05,770
left this magnitude the magnitude of the box
function I left it at 1.
144
00:20:05,770 --> 00:20:13,610
I could have made it a unit vector by making
its magnitude square root of N, I could have
145
00:20:13,610 --> 00:20:16,510
made the magnitudes square out of N, and it
would have been a unit vector the dot product
146
00:20:16,510 --> 00:20:22,460
with itself would have been 1, whereas I did
not do it. So I left it at 1, there must be
147
00:20:22,460 --> 00:20:28,430
some advantage that I got because of that
okay, so this will turn out that this is basically
148
00:20:28,430 --> 00:20:33,810
the average value, the area under this is
what is the value here will be the average
149
00:20:33,810 --> 00:20:37,400
value of the function over this interval,
you can just check and see whether that as
150
00:20:37,400 --> 00:20:40,400
a consequence with right okay.
151
00:20:40,400 --> 00:20:44,630
So on the other hand here, we need to know
what this is, just like we did for the box
152
00:20:44,630 --> 00:20:47,950
function, you need to try it this out and
make sure that right you get an expression
153
00:20:47,950 --> 00:20:53,230
for this just try it out. I would suggest
that you try functions of various kinds, let
154
00:20:53,230 --> 00:20:57,390
us look at I will just name a few and we will
see what happens. So if I have a constant
155
00:20:57,390 --> 00:21:04,600
function, hat functions I can represent it
exactly right, this norm is 0, meaning I can
156
00:21:04,600 --> 00:21:06,100
represent it exactly.
157
00:21:06,100 --> 00:21:13,250
If I have a linear again 0, so the representation
is definitely of order 1, if it is quadratic
158
00:21:13,250 --> 00:21:18,071
then I am going to have a problem right, so
you can use a quadratic, try to represent
159
00:21:18,071 --> 00:21:24,240
the quadratic and see from there what is this
error, see if you can get an expression for
160
00:21:24,240 --> 00:21:30,650
the error okay. If you can get an expression
for the error, so that will tell you something
161
00:21:30,650 --> 00:21:35,520
about the nature of the error the error term,
please do this error term will tell you the
162
00:21:35,520 --> 00:21:36,520
nature of the error.
163
00:21:36,520 --> 00:21:42,550
And it will also tell you what happens as
we shrink as we allow h to go to 0, what is
164
00:21:42,550 --> 00:21:45,750
the rate at which that error goes to 0? So
it is important that you derive that expression
165
00:21:45,750 --> 00:21:54,610
fine. The other thing that we want is I want
to make sure that we get this that hat functions
166
00:21:54,610 --> 00:22:14,250
provide a first order representation, right,
the
167
00:22:14,250 --> 00:22:19,230
box function was a 0th order representation
that means a polynomial of constant was represented
168
00:22:19,230 --> 00:22:20,230
exactly.
169
00:22:20,230 --> 00:22:25,500
In the case of the hat function it provides
a first order representation, we can up to
170
00:22:25,500 --> 00:22:45,910
a linear can be represented exactly, is that
fine okay. Let us see what else we can now
171
00:22:45,910 --> 00:22:52,540
do, is it possible for us to go for higher
order representations is there a way that
172
00:22:52,540 --> 00:22:59,290
we can get higher order representation okay,
so we would obviously want to use polynomials
173
00:22:59,290 --> 00:23:06,530
of higher order, you want polynomials of higher
order okay.
174
00:23:06,530 --> 00:23:10,700
But I suspect just like going from a constant
to a linear, when we went from constant to
175
00:23:10,700 --> 00:23:17,600
a linear we went from 1 interval to 2 intervals,
I suspect if we go from linear to a quadratic
176
00:23:17,600 --> 00:23:21,040
that possibly will have to go to 3 intervals
okay.
177
00:23:21,040 --> 00:23:29,450
So what does the nature of those functions
that we can use? So we saw that alpha of x
178
00:23:29,450 --> 00:23:39,990
was like x-alpha i
of x-xi/xi+1-xi, what is something that we
179
00:23:39,990 --> 00:23:45,200
could start of with linear, it turns out we
can actually use this to construct polynomials
180
00:23:45,200 --> 00:24:01,890
of higher order okay. So if I define 3 functions
now on a given interval, Ni 0 is alpha i of
181
00:24:01,890 --> 00:24:22,170
x squared it is clearly a quadratic, Ni 1
is alpha i*1-alpha i also clearly a quadratic,
182
00:24:22,170 --> 00:24:42,580
Ni 2 have 3 such functions will be 1-alpha
i squared, it will be a 2 there.
183
00:24:42,580 --> 00:25:01,310
And ask question how do you know there is
a 2 there, how do I know there is a 2 there,
184
00:25:01,310 --> 00:25:18,410
all of this Ni 0+Ni 1+Ni 2 at 1 is that work,
why should they add to 1, no no but why you
185
00:25:18,410 --> 00:25:22,020
see this is over the same interval, please
remember this is over the same interval, this
186
00:25:22,020 --> 00:25:31,680
is over the interval xi, xi+1, this is over
the interval xi, xi+1. What do these functions
187
00:25:31,680 --> 00:25:44,310
look like? One is going to be a quadratic
that is like this, one is going to be a quadratic
188
00:25:44,310 --> 00:25:54,790
the slope is not 0 that is like this and the
third is going to be a quadratic that is like
189
00:25:54,790 --> 00:25:57,970
this okay.
190
00:25:57,970 --> 00:26:16,930
This would in fact be this one okay, so question
that we have is why should this add up to
191
00:26:16,930 --> 00:26:21,910
1, in fact if you look at the hat functions
you will see that they are 2 even there they
192
00:26:21,910 --> 00:26:29,830
add up to 1, why do they add up to 1? You
look at the hat functions here Ni 0+Ni 1,
193
00:26:29,830 --> 00:26:45,220
Ni 0 my notation is changed a little, I called
it Ni+1 0 and Ni 1 add up to 1, why do they
194
00:26:45,220 --> 00:26:56,100
add up to 1? If they did not add up to 1 what
is the big deal? You cannot represent a constant,
195
00:26:56,100 --> 00:27:00,500
you will not be able to represent a constant
right.
196
00:27:00,500 --> 00:27:06,230
And there will be some sort of funny interpolation
going on now over and above right, if this
197
00:27:06,230 --> 00:27:10,610
did not add up to 1 that means that it could
be it is varying in some fashion, if it did
198
00:27:10,610 --> 00:27:16,020
not add up to 1 it is varying in some fashion,
if it did not add up to a constant, if it
199
00:27:16,020 --> 00:27:19,270
did not one is convenient if it did not add
up to a constant that means it is varying
200
00:27:19,270 --> 00:27:23,570
in some fashion, am I making sense right okay.
201
00:27:23,570 --> 00:27:31,640
And at any given point in the interval we
want the function value to be there to be
202
00:27:31,640 --> 00:27:38,740
it is a linear combination of these 3 convex
combinations of these 3 is that fine okay.
203
00:27:38,740 --> 00:27:42,010
So we do not want any other variation, we
want the variation that you have picked here
204
00:27:42,010 --> 00:27:46,700
that should be picked up by these 3 functions.
And therefore, they have to add up to a constant,
205
00:27:46,700 --> 00:27:51,100
and one is a very convenient constant okay.
206
00:27:51,100 --> 00:28:08,540
So in this case just like we did ai, bi there,
we could actually say ai Ni 0+bi Ni 1+ci Ni
207
00:28:08,540 --> 00:28:24,870
2, you would have the sum of these 3 qualities,
is that okay. As we go along you will see
208
00:28:24,870 --> 00:28:30,130
that I leave more and more of the details
of working things out to you, is that fine.
209
00:28:30,130 --> 00:28:37,370
This is a quadratic, so what it allows me
to do again is you have a function that is
210
00:28:37,370 --> 00:28:50,060
0 at this end, 1 at that end right, starts
at 0 at this end, goes to 1 at that end, okay
211
00:28:50,060 --> 00:28:51,060
fine.
212
00:28:51,060 --> 00:28:56,200
So it is possible for me to independently
vary what happens to the function on either
213
00:28:56,200 --> 00:29:03,180
sides of the interval right, and also there
seems to be the same symmetric about this,
214
00:29:03,180 --> 00:29:07,390
this figure does not but it should be symmetric
about that right, and there is the slope that
215
00:29:07,390 --> 00:29:12,820
is fixed at both sides. I am not I do not
have that much of a great performance for
216
00:29:12,820 --> 00:29:17,570
quadratic, I just do it for completion so
to speak. I will go on to something that is
217
00:29:17,570 --> 00:29:24,640
more important which is cubics.
218
00:29:24,640 --> 00:29:37,870
So in the case of cubics we would define how
many? 4 functions, we define 4 functions which
219
00:29:37,870 --> 00:29:48,630
are Ni 0, Ni 1, Ni 2, Ni 3, and this should
be relatively easy for you to figure out now.
220
00:29:48,630 --> 00:29:56,300
So Ni 0 would be alpha i cube it is function
of x I am not going to keep writing that,
221
00:29:56,300 --> 00:30:09,840
Ni 1 would be alpha i squared 3 of them*1-alpha
i right, so in your mind you should be thinking
222
00:30:09,840 --> 00:30:23,070
a+b whole cube. Ni 2 would be 3 of 3 times
alpha i 1-alpha i squared, and Ni the last
223
00:30:23,070 --> 00:30:36,820
one would be 1-alpha i cube, is
that fine.
224
00:30:36,820 --> 00:30:42,630
So this is just a simple algebraic process
that I am going through, and clearly the sum
225
00:30:42,630 --> 00:30:55,470
of these sum over j have Ni j is again 1,
because the sum of the 4 of these will give
226
00:30:55,470 --> 00:31:06,320
me alpha i+1-alpha i whole cube right which
is 1, which is where these constants came
227
00:31:06,320 --> 00:31:11,680
from, and now it is actually possible for
yourself to construct right any order that
228
00:31:11,680 --> 00:31:15,940
you want. Now that you have seen this process,
it should be obvious that you can construct
229
00:31:15,940 --> 00:31:18,720
any order that you want, is that fine.
230
00:31:18,720 --> 00:31:23,760
So why did I skip quickly over the quadratic
and go to the cubic? Well, the cubic is an
231
00:31:23,760 --> 00:31:35,970
interesting function, that the cubic is an
interesting function, because it gives me
232
00:31:35,970 --> 00:31:46,010
control over the function values at the end
points, and
233
00:31:46,010 --> 00:32:02,809
so this is well I just call it y right now,
x, xi, xi+1 the cubic allows me to do this.
234
00:32:02,809 --> 00:32:14,130
The slope here is 0, the slope there is 0
right, so it is going to go the 0 slope to
235
00:32:14,130 --> 00:32:22,320
1 there right, the other function 1-alpha
i cube is going to start at the 0 slope and
236
00:32:22,320 --> 00:32:31,100
0 value here that is important 0 slope and
0 value, and goes up to 1 there is that fine
237
00:32:31,100 --> 00:32:35,120
okay.
238
00:32:35,120 --> 00:32:41,800
The next 2 functions do something that is
interesting, let me choose the next 2 functions
239
00:32:41,800 --> 00:32:52,220
do something interesting, so they start with
a non-0 slope on the one side and have a 0
240
00:32:52,220 --> 00:33:04,401
slope on the other side okay, they start with
a non-0 slope on one side and have a 0 slope
241
00:33:04,401 --> 00:33:20,170
on the other side okay. So by on this interval
by using these 4 functions, and using ai let
242
00:33:20,170 --> 00:33:36,350
me ai Ni 0+bi Ni 1+ci Ni 2+di Ni 3.
243
00:33:36,350 --> 00:33:43,550
By using these 4 functions and these 4 coefficients,
it is possible for me using the first one
244
00:33:43,550 --> 00:33:51,210
ai to move this value up and down, you understand
what I am saying, just to change the single
245
00:33:51,210 --> 00:33:58,210
value alone. It is possible for me to use
di and to change move this value up and down
246
00:33:58,210 --> 00:34:03,520
independent of the others. It is possible
for me to use di and ci to actually manipulate
247
00:34:03,520 --> 00:34:07,450
the slope, you understand what I am saying.
248
00:34:07,450 --> 00:34:11,879
So in the sense in the representing the function
value, I have now got what I would call as
249
00:34:11,879 --> 00:34:17,000
the ultimate and locality and manage now right
it is not quite the ultimate obviously you
250
00:34:17,000 --> 00:34:21,730
can go to higher order, but we like the direction
in which we are going that we are able to
251
00:34:21,730 --> 00:34:25,669
manipulate the function value, and you are
able to simultaneously manipulate the slopes
252
00:34:25,669 --> 00:34:30,490
at this point okay. And what is the cost that
we paid? What is the price that we paid in
253
00:34:30,490 --> 00:34:33,970
exchange for this?
254
00:34:33,970 --> 00:34:38,860
We have a higher order polynomial of course,
you have more coefficients to handle, we have
255
00:34:38,860 --> 00:34:46,360
more intervals involved right. There will
be more intervals involved, so we will end
256
00:34:46,360 --> 00:34:53,440
up having overlap who are multiple intervals,
so what I want you to do is I want you to
257
00:34:53,440 --> 00:35:09,750
try the following for both quadratic and cubic
representations right, I just say basically
258
00:35:09,750 --> 00:35:11,180
say quadratic and cubic representation.
259
00:35:11,180 --> 00:35:17,140
If you know that the quadratic will represent
anything up to a second degree polynomial
260
00:35:17,140 --> 00:35:23,080
right, and a cubic is going to represent any
polynomial accurately up to a third degree
261
00:35:23,080 --> 00:35:27,119
polynomial, and beyond that of course then
you are going to have errors. So for both
262
00:35:27,119 --> 00:35:35,220
of these you need to find please make sure
that you are able to find f of x-f h of x
263
00:35:35,220 --> 00:35:48,030
the norm, what else do we want? Which means
that for a quadratic obviously it will represent
264
00:35:48,030 --> 00:35:51,300
quadratic properly it is likely that the cubic
will not work.
265
00:35:51,300 --> 00:35:57,400
Try a cubic, try a quartic even with the quartic
try a higher order polynomial to see what
266
00:35:57,400 --> 00:36:02,480
is it that you get. And for cubic it is the
same thing right, up to a cubic it works if
267
00:36:02,480 --> 00:36:09,330
you have a doubt try it out, and try quartic,
try a quintic to see whether, what does the
268
00:36:09,330 --> 00:36:14,530
error term turn out to be? How does the error
term work out? Okay, how does it work out?
269
00:36:14,530 --> 00:36:21,440
1 what is the error term? And how does it
converge, so one is find this and look at
270
00:36:21,440 --> 00:36:26,130
it to see as h goes to 0, how does it converge?
271
00:36:26,130 --> 00:36:29,640
What is the order? What is the rate at which
it goes to 0? Is it like h or is it like h
272
00:36:29,640 --> 00:36:36,750
squared, is it like cube right, what is the
rate at which it goes to 0? Is that fine okay
273
00:36:36,750 --> 00:36:52,110
right? So what we have now is a way by which
we are able to represent functions of various
274
00:36:52,110 --> 00:37:01,980
orders on any interval, we have a mechanism
by which we are able to find the, what should
275
00:37:01,980 --> 00:37:07,490
I say the error in our representation.
276
00:37:07,490 --> 00:37:11,530
We are hopefully once you have done the assignment
you will see that for all of them you are
277
00:37:11,530 --> 00:37:15,870
in a way you have a mechanism by which you
are able to find, the rate at which you get
278
00:37:15,870 --> 00:37:20,440
convergence okay, we will say a few words
now about what I mean by that, the rate at
279
00:37:20,440 --> 00:37:25,070
which it gets convergence, the magnitude of
the error and you have a mechanism by which
280
00:37:25,070 --> 00:37:29,280
you know what is the order of the representation
right. The idea what is the order of representation
281
00:37:29,280 --> 00:37:32,290
is something that is clear okay.
282
00:37:32,290 --> 00:37:42,190
So what do I mean by convergence, in this
context what do I mean by convergence? You
283
00:37:42,190 --> 00:37:48,869
take all these terms that we have used, what
do I mean by convergence? So as h goes to
284
00:37:48,869 --> 00:37:58,510
0, h which is like xi+1-xi for all i's, so
they are all of the same order of magnitude
285
00:37:58,510 --> 00:38:06,630
as this goes to 0, which means that N goes
to infinity the intervals get smaller and
286
00:38:06,630 --> 00:38:09,950
smaller, and the number of intervals becomes
larger and larger.
287
00:38:09,950 --> 00:38:19,140
We are asking the question does f of h go
to f, first question does f of h go to f right
288
00:38:19,140 --> 00:38:26,920
it means that it convergence. And the second
question is at what rate, do you have convergence
289
00:38:26,920 --> 00:38:36,800
and at what rate? Okay right. So this is the
first definition that you are seeing of convergence
290
00:38:36,800 --> 00:38:40,470
we will see different types of convergence,
I want to make sure you have to be depends
291
00:38:40,470 --> 00:38:43,120
on the context I want you to keep it in mind.
292
00:38:43,120 --> 00:38:48,670
So this is as h goes to 0 we have a representation,
the question that we have is what is the rate
293
00:38:48,670 --> 00:38:53,470
at which the representation that we have goes
to the actual function, what is the rate at
294
00:38:53,470 --> 00:39:00,790
which the representation error goes to 0 okay.
So and as I said there is always this question
295
00:39:00,790 --> 00:39:06,550
does it indeed go to 0 and if it goes to 0,
what is the rate at which it goes to 0? Is
296
00:39:06,550 --> 00:39:21,740
that okay fine. So what we will do is maybe
we will consider now how useful this is in
297
00:39:21,740 --> 00:39:25,930
what we have set out to do which is solve
differential equations.
298
00:39:25,930 --> 00:39:29,380
If I figure out the way to find out what is
the order that is if you give me the data,
299
00:39:29,380 --> 00:39:34,010
that is why the example that I gave you earlier
was if you perform an experiment you have
300
00:39:34,010 --> 00:39:40,570
tabulated data, from that tabulated data it
is very easy for you to fit, you understand
301
00:39:40,570 --> 00:39:45,000
very especially for hat functions it is very
straight forward for you to just extract the
302
00:39:45,000 --> 00:39:49,740
data and use it right, directly plot all you
are doing is linear interpolation, if you
303
00:39:49,740 --> 00:39:50,840
think about it.
304
00:39:50,840 --> 00:39:55,220
The only thing that I am telling you now is
every time you use linear interpolation earlier
305
00:39:55,220 --> 00:40:00,011
you are actually using hat functions, it is
that awareness that I want, every time in
306
00:40:00,011 --> 00:40:07,710
an experiment or in any work that you have
done earlier, every time you had data and
307
00:40:07,710 --> 00:40:13,630
you are connected it by straight lines. You
are actually using hat functions that is what
308
00:40:13,630 --> 00:40:16,770
you have to be aware, you understand what
I am saying, every time you connected it by
309
00:40:16,770 --> 00:40:22,250
piecewise straight lines, you are actually
using hat functions okay, that is the key.
310
00:40:22,250 --> 00:40:29,420
So this is a situation where you have the
data points ahead of time, this is a situation
311
00:40:29,420 --> 00:40:34,270
where you have what happens if you do not
have the data points ahead of them? This is
312
00:40:34,270 --> 00:40:38,360
what we encountered typically when we are
trying to solve differential equations, so
313
00:40:38,360 --> 00:40:44,240
if I had a dynamical equation a dynamical
system a system that is varying in time, I
314
00:40:44,240 --> 00:40:46,660
want to predict its behavior in the future.
315
00:40:46,660 --> 00:40:57,130
So I could in a sense have some dx/dt which
is f of x,t. And this is something that is
316
00:40:57,130 --> 00:41:06,720
varying in time, and I do not have x this
could be a particle that is travelling for
317
00:41:06,720 --> 00:41:13,849
instance right, propagation of a particle
x could be its position, so I have dx/dt related
318
00:41:13,849 --> 00:41:20,760
in this fashion. I may not have a priori before
I start, I may not have the data points in
319
00:41:20,760 --> 00:41:26,620
hand for me to fit function okay. So I can
decide that I am going to use linear interpolants
320
00:41:26,620 --> 00:41:29,600
of sometime, I can make that decision.
321
00:41:29,600 --> 00:41:34,690
But is it possible for me to say beforehand
and get an estimate as to what is there that
322
00:41:34,690 --> 00:41:41,920
I am likely to make or they are related is
it the same? Does this question make sense,
323
00:41:41,920 --> 00:41:46,190
see in one case it should be clear to you
that if I give you the data that you are able
324
00:41:46,190 --> 00:41:52,330
to use the data and interpolate, it is all
a matter of representing the function. But
325
00:41:52,330 --> 00:41:56,830
we saw the motivation that we used for why
we are sitting out to represent function on
326
00:41:56,830 --> 00:42:01,270
the computer is that, we do not know what
the function is.
327
00:42:01,270 --> 00:42:06,230
And we want to come up with an algorithm to
hunt for the function, there are different
328
00:42:06,230 --> 00:42:09,590
ways by which this can happen, in fact it
is possible to use this, we will see those
329
00:42:09,590 --> 00:42:14,850
we will see how to use those functions later
on. But right now as it stands, right the
330
00:42:14,850 --> 00:42:19,030
problem that I posed you is if I had a differential
equation which I am integrating out in time,
331
00:42:19,030 --> 00:42:21,840
I deliberately choose time because that is
in the future I am saying you do not know
332
00:42:21,840 --> 00:42:23,500
what the value is right.
333
00:42:23,500 --> 00:42:30,270
So if I deliberately integrating out in time
is there a way for me before I start the integration
334
00:42:30,270 --> 00:42:35,320
to say this is the nature of the function,
this is the representation that I am going
335
00:42:35,320 --> 00:42:40,340
to use, this is how it is going to, this is
the error that I am going to make in my representation
336
00:42:40,340 --> 00:42:47,520
fine. So there is a different kind I want
to march off, I want to step off. Given that
337
00:42:47,520 --> 00:42:52,790
I have some initial condition X0, I would
like to find X1 somehow.
338
00:42:52,790 --> 00:42:58,859
Which is very different from a situation that
we had there which was basically given data
339
00:42:58,859 --> 00:43:05,570
representing the data okay right. So what
we are going to do is we are going to take
340
00:43:05,570 --> 00:43:10,340
the slightly different track, we are going
to see here we have already seen especially
341
00:43:10,340 --> 00:43:15,050
for the box functions, we have already seen
that the error was of the order of 1 over
342
00:43:15,050 --> 00:43:20,120
N, which basically means that there was of
the order of h.
343
00:43:20,120 --> 00:43:24,880
And you will see, when you do this you will
find out errors again error in terms of h
344
00:43:24,880 --> 00:43:31,859
okay, so this may not be an obvious trigger
for you. But what I would say is we will see
345
00:43:31,859 --> 00:43:46,609
whether we can approximate a function
346
00:43:46,609 --> 00:44:13,359
at time t+delta t given the value at t fine
okay. So I use an example that may make you
347
00:44:13,359 --> 00:44:19,230
uncomfortable, but what they. So you have
you all been taking quizzes, exams and all
348
00:44:19,230 --> 00:44:21,730
of that kind of stuff so far right.
349
00:44:21,730 --> 00:44:28,410
So 6 semesters are done, next semester you
go for interviews, people look at your grades,
350
00:44:28,410 --> 00:44:33,980
they say at this point in time after 6 semesters
this is your cumulative grade point average,
351
00:44:33,980 --> 00:44:40,740
this is your grade. What does your grade likely
to be at the end of 8 semesters? That is the
352
00:44:40,740 --> 00:44:45,650
question that we are asking. Given a time
t that I have a function value your grade
353
00:44:45,650 --> 00:44:52,280
point average at a given time, what is your
grade point average likely to be at t+2 semesters.
354
00:44:52,280 --> 00:44:56,290
Someone interviewing you giving you sitting
across the table and asking you questions,
355
00:44:56,290 --> 00:45:03,640
they look at your score sheet, and they want
to make an estimate fine. So give me a good
356
00:45:03,640 --> 00:45:10,600
estimate what would so if you say have a grade
point average which is 8.5, what would you
357
00:45:10,600 --> 00:45:18,080
tell them? What would I do if I were interviewing?
What would you do if you are interviewing
358
00:45:18,080 --> 00:45:25,310
me? What is a good estimate? It is likely
that it is the same right, one good estimate
359
00:45:25,310 --> 00:45:26,460
is it likely that is the same.
360
00:45:26,460 --> 00:45:31,080
Okay, you made this, this is a cumulative
grade Point average over the last 6 semesters,
361
00:45:31,080 --> 00:45:36,790
it is likely that after at the end of 8 semesters
this is going to be your CGPA, am I making
362
00:45:36,790 --> 00:45:42,119
sense. So it is likely, so one thing one way
by which we could do it is so if you give
363
00:45:42,119 --> 00:45:58,609
me x of t, it is likely that x of t+delta
t is like approximately x of t, that is an
364
00:45:58,609 --> 00:46:05,040
approximation right, and I have change the
language that I am using now.
365
00:46:05,040 --> 00:46:09,910
So far I have been talking about the representations
on the computer, but our experience so far
366
00:46:09,910 --> 00:46:14,369
I am now admitting, it is an approximation,
it does not look like we are going to be able
367
00:46:14,369 --> 00:46:19,830
to represent functions exactly on the computer
right, so it is going to be an approximation.
368
00:46:19,830 --> 00:46:23,380
So now I come where you have live with this
reality, I come now to the point where we
369
00:46:23,380 --> 00:46:27,100
say it is an approximation.
370
00:46:27,100 --> 00:46:31,950
I want to now ask the question, what is the
approximation? What is the value? And what
371
00:46:31,950 --> 00:46:37,850
is the error in the value? Okay, and I posed
this question in this fashion, because it
372
00:46:37,850 --> 00:46:46,060
immediately motivates if you look at something
like x+t+delta t what do you want to do? Expand
373
00:46:46,060 --> 00:46:51,640
using Taylor series, am I making sense, you
look at something like x+t+delta t you are
374
00:46:51,640 --> 00:46:56,900
so why do not you just expand using Taylor
series okay. So that is basically what we
375
00:46:56,900 --> 00:46:59,970
are going to do.
376
00:46:59,970 --> 00:47:10,770
Essentially, what we will do is we will now
sort of reset right, that was the notation
377
00:47:10,770 --> 00:47:15,970
we introduced so far, but we will be going
to standard notation. So if I have f of x
378
00:47:15,970 --> 00:47:28,830
given f of x what is f of x+delta x, I introduced
the notion of t and time just to motivate
379
00:47:28,830 --> 00:47:32,150
the fact that you may not know the function
ahead of time that is the only reason why
380
00:47:32,150 --> 00:47:37,580
I used t. The question is given f of x what
is the good approximation for f of x+delta
381
00:47:37,580 --> 00:47:38,580
x?
382
00:47:38,580 --> 00:47:48,480
Well, you can say f of x+delta x a good approximation
is a f of x right, so if I am getting something
383
00:47:48,480 --> 00:47:55,260
today, if my salary is f of x today, good
approximation is f of x+delta x right, it
384
00:47:55,260 --> 00:48:01,420
is the same salary. So it is reasonable approximation
with may not always be right, but it is the
385
00:48:01,420 --> 00:48:03,840
reasonable approximation. So what is the nature
of the error?
386
00:48:03,840 --> 00:48:15,250
Use Taylor series f of x+delta x is f of x+delta
x times the derivative f prime x the prime
387
00:48:15,250 --> 00:48:25,540
indicates differentiation with respect to
x delta x squared/2 f double prime of x+ an
388
00:48:25,540 --> 00:48:33,850
infinite number of terms and I am assuming
that f of x+delta x is f of x. And in making
389
00:48:33,850 --> 00:48:43,160
this assumption I would thrown away all these
terms in Taylor series okay, all of these
390
00:48:43,160 --> 00:48:45,970
terms infinite number of terms I thrown them
away.
391
00:48:45,970 --> 00:48:52,130
I have an infinite series which I have truncated
right, the error that you create by taking
392
00:48:52,130 --> 00:49:04,320
an infinite series and truncating it is called
the truncation error right. If you have an
393
00:49:04,320 --> 00:49:12,310
infinite series representation for say a function,
the error that you make by throwing away whole
394
00:49:12,310 --> 00:49:17,540
bunch of these terms is called the truncation
error, and we will represent the order of
395
00:49:17,540 --> 00:49:23,840
the error by the leading term which is delta
x. So the truncation error here is of the
396
00:49:23,840 --> 00:49:32,580
order of delta x f prime of x, is that fine
right.
397
00:49:32,580 --> 00:49:40,470
So we tend to call this a first order error,
because the exponent over delta x is 1 right
398
00:49:40,470 --> 00:49:47,290
okay. So we will come back to this maybe on
Monday, I will try to do a demo of some kind,
399
00:49:47,290 --> 00:49:52,390
then I would suggest that you try using hat
functions and representing various functions.
400
00:49:52,390 --> 00:49:57,040
There are many different types of functions
as you can okay. And I will come back in the
401
00:49:57,040 --> 00:50:00,869
next class, and maybe try to do a demo, so
that you can see. There are some issues still
402
00:50:00,869 --> 00:50:08,829
with respect to represent in functions fine,
I will see you in the next class.