1
00:00:16,590 --> 00:00:26,990
how to solve these problems my lectures are
going to be of course centered on algorithms
2
00:00:26,990 --> 00:00:33,020
but the derivation of algorithms i am more
worried about how these algorithms are derived
3
00:00:33,020 --> 00:00:42,100
rather than what are these algorithms i want
to derive runge-kutta methods 1 class of algorithms
4
00:00:42,100 --> 00:00:47,980
which are based on taylor series the other
class of algorithms based on polynomial or
5
00:00:47,980 --> 00:00:56,210
vieta’s theorem multistep methods or predictor-corrector
methods on the class of algorithms
6
00:00:56,210 --> 00:01:03,420
i will briefly touch up on orthogonal collocations
then we will move on to talk a little bit
7
00:01:03,420 --> 00:01:11,630
about convergence or numerical stability of
these algorithms why 1 algorithm has better
8
00:01:11,630 --> 00:01:16,590
properties than the other so comparing the
algorithms what is the basis for comparing
9
00:01:16,590 --> 00:01:27,039
the algorithms after that we will spend time
on some special applications like there are
10
00:01:27,039 --> 00:01:31,220
methods of converting a boundary value problem
into initial value problem they are called
11
00:01:31,220 --> 00:01:32,220
as shooting methods
12
00:01:32,220 --> 00:01:40,220
we will look at shooting methods and then
if time permits we will have a peek at what
13
00:01:40,220 --> 00:01:48,140
are called as differential algebraic systems
differential algebraic systems are 1 in which
14
00:01:48,140 --> 00:01:52,709
you have solve simultaneously differential
equations and algebraic equations in fact
15
00:01:52,709 --> 00:01:58,930
a problem which is very very often encoded
in chemical engineering though it is very
16
00:01:58,930 --> 00:02:03,500
very important we can probably get time only
to touch up on some algorithms some ideas
17
00:02:03,500 --> 00:02:07,429
of di systems
18
00:02:07,429 --> 00:02:28,730
so let us begin our journey into ode-ivp last
class i talked about a general set of ode-ivp
19
00:02:28,730 --> 00:02:55,099
which is dx/dt=f(x t) initial condition corresponds
to x not x belongs to rn n dimensional vector
20
00:02:55,099 --> 00:03:01,659
and i want to find out the time trajectories
or i want to find out spatial trajectories
21
00:03:01,659 --> 00:03:11,299
so actually to generalize i had made a small
modification i had just said here some independent
22
00:03:11,299 --> 00:03:20,769
variable neta at time 0 or at special coordinate
0 whatever it is at a initial condition is
23
00:03:20,769 --> 00:03:28,739
known to you you want to integrate this differential
equation over some finite interval
24
00:03:28,739 --> 00:03:34,650
i want to integrate this differential equation
over a finite interval in independent variable
25
00:03:34,650 --> 00:03:52,620
neta that is my problem
before we begin talking about the methods
26
00:03:52,620 --> 00:04:02,310
of solving like we discussed a little bit
about existence of solution uniqueness of
27
00:04:02,310 --> 00:04:10,220
solution and so on when we talked about solving
linear algebraic equations or towards the
28
00:04:10,220 --> 00:04:16,079
end i gave a lecture on existence of solutions
for nonlinear algebraic equations i am going
29
00:04:16,079 --> 00:04:20,180
to very very briefly mention about this aspect
30
00:04:20,180 --> 00:04:28,740
not really get into deep into this now it
is very very important there are 3 issues
31
00:04:28,740 --> 00:04:45,780
that are primary concern in the beginning
32
00:04:45,780 --> 00:05:31,180
existence of solution that is solution or
a solution first essential thing that a solution
33
00:05:31,180 --> 00:05:40,270
for a given differential should exist typically
except for some differential equations which
34
00:05:40,270 --> 00:05:45,730
have been conceived by mathematicians typically
most of the differential equations that you
35
00:05:45,730 --> 00:05:59,840
want to solve are some models of a physical
system no physical system exist and just like
36
00:05:59,840 --> 00:06:08,220
a physical system has different behavioral
patterns for different starting conditions
37
00:06:08,220 --> 00:06:13,580
a model also has different behavioral patterns
for different starting conditions for a specified
38
00:06:13,580 --> 00:06:19,979
initial condition a solution should exist
for the given differential equation that is
39
00:06:19,979 --> 00:06:24,490
very very important if may happen that you
have done a wrong modeling solution does not
40
00:06:24,490 --> 00:06:29,930
exist physical system of course exist you
have developed a model for the physical system
41
00:06:29,930 --> 00:06:36,879
and there are some wrong assumptions or there
is something wrong which you are understanding
42
00:06:36,879 --> 00:06:44,300
of the system and no solution exist for the
initial condition that you are specified
43
00:06:44,300 --> 00:06:51,050
now if the solution exist we are worried about
1 more thing we are worried about the uniqueness
44
00:06:51,050 --> 00:07:05,100
of the solution once i have existence of the
solution i am worried about uniqueness here
45
00:07:05,100 --> 00:07:41,409
concern is each set of initial condition
46
00:07:41,409 --> 00:07:49,290
uniqueness of solution is another important
aspect of the solutions of differential equation
47
00:07:49,290 --> 00:07:53,240
now you might wonder why am i worried about
existence and uniqueness which appear to be
48
00:07:53,240 --> 00:07:55,780
very very mathematical concepts
49
00:07:55,780 --> 00:08:02,400
actually they are just abstractions of something
that we know from the reality first of all
50
00:08:02,400 --> 00:08:13,320
the behavioral pattern exist for a real system
so if the model represents a real system a
51
00:08:13,320 --> 00:08:22,490
solution should exist for a given initial
condition second thing that we know is that
52
00:08:22,490 --> 00:08:30,690
this i would call something like a principle
of determinism that if you for most engineering
53
00:08:30,690 --> 00:08:41,360
systems if you start with same initial condition
you will get the same identical behavior
54
00:08:41,360 --> 00:08:46,750
very very important you will not get different
behaviour under identical conditions that
55
00:08:46,750 --> 00:08:51,970
is mathematical way of saying it that a solution
should be unique i should not get different
56
00:08:51,970 --> 00:08:59,560
solution for same initial condition does not
make i should get identical behavior for identical
57
00:08:59,560 --> 00:09:13,520
initial conditions the third important aspect
is continuity of solution with respect to
58
00:09:13,520 --> 00:09:32,150
initial condition
59
00:09:32,150 --> 00:09:41,140
the third aspect is continuity of the solution
with respect to initial condition we want
60
00:09:41,140 --> 00:09:46,770
that the solution of the differential equation
should depend continuously on the initial
61
00:09:46,770 --> 00:09:53,340
condition now when i talk of continuity you
think of that epsilon delta definition and
62
00:09:53,340 --> 00:10:00,830
then you might think this is complex it is
not if you try to understand what is it trying
63
00:10:00,830 --> 00:10:11,370
to quantify or abstract then it is not so
difficult what do you know about continuity
64
00:10:11,370 --> 00:10:20,820
about continuity what we know is that will
a small perturbation in the input will change
65
00:10:20,820 --> 00:10:27,030
result in a small perturbation in the output
a bounded change in the input will lead to
66
00:10:27,030 --> 00:10:31,750
bounded change in the output is what we are
worried about in the continuity a function
67
00:10:31,750 --> 00:10:39,120
when it is continuous in a very crude way
of saying a small change any amount of small
68
00:10:39,120 --> 00:10:43,100
change should lead to a small change in the
function value
69
00:10:43,100 --> 00:11:01,020
now we know from working with real systems
that even though we demand uniqueness of the
70
00:11:01,020 --> 00:11:06,750
solutions when you actually perform experiments
you can never repeat identical conditions
71
00:11:06,750 --> 00:11:15,580
even if you decide that that is how you do
the simple experiment that you have a pendulum
72
00:11:15,580 --> 00:11:24,390
and then you want to understand motion of
the pendulum you start from some theta you
73
00:11:24,390 --> 00:11:29,300
want to start from some theta 0 and then you
have developed equation for governing the
74
00:11:29,300 --> 00:11:30,300
pendulum
75
00:11:30,300 --> 00:11:35,310
you have to understand those equations even
if you want to repeat the experiment from
76
00:11:35,310 --> 00:11:40,830
same theta 0 every time it is impossible to
conduct an experiment which will be every
77
00:11:40,830 --> 00:11:48,670
time starting from same theta 0 if you do
10 experiments it will be some theta+delta
78
00:11:48,670 --> 00:11:56,670
theta every time now what is important what
we know from physics what we know from observations
79
00:11:56,670 --> 00:12:02,530
is that minor change in the initial conditions
leads to minor change in the solutions
80
00:12:02,530 --> 00:12:12,110
it does not lead to significant drastic change
in the solution if a minor change in the initial
81
00:12:12,110 --> 00:12:20,310
condition leads to a drastic change that does
not happen in real systems if you change the
82
00:12:20,310 --> 00:12:30,750
initial condition of the system slightly the
solution that you obtain if i start from theta
83
00:12:30,750 --> 00:12:38,800
0 next time i start from theta 0+some delta
theta then next time i start with theta 0-delta
84
00:12:38,800 --> 00:12:48,140
theta the solutions that i get for each one
of these cases of the motion of the pendulum
85
00:12:48,140 --> 00:12:51,050
will be close
86
00:12:51,050 --> 00:12:57,160
this you know the way of quantifying this
mathematically is saying that the solution
87
00:12:57,160 --> 00:13:01,480
is continuous with respect to the initial
condition if i perturb the initial condition
88
00:13:01,480 --> 00:13:11,400
a little the solution will get perturbed a
little very very important perturbation in
89
00:13:11,400 --> 00:13:18,570
the initial condition can occur when you are
solving a differential equation somebody might
90
00:13:18,570 --> 00:13:25,500
i have given initial condition which has some
variable is one-third
91
00:13:25,500 --> 00:13:32,910
somebody might decide to do it 033 somebody
might do it 0333 somebody else might do it
92
00:13:32,910 --> 00:13:40,080
03333 and the solutions that you get should
not drastically change because he takes 033
93
00:13:40,080 --> 00:13:46,110
and she takes 0333 they should be close by
similar solutions so third aspect which is
94
00:13:46,110 --> 00:13:56,080
important is the solution continuous with
respect to initial condition i am not going
95
00:13:56,080 --> 00:14:08,220
to go too deep into this i am just going to
state 1 theorem
96
00:14:08,220 --> 00:14:18,601
which talks about the continuity aspect existence
uniqueness and continuity so we will define
97
00:14:18,601 --> 00:15:11,380
something called a region
98
00:15:11,380 --> 00:15:23,390
i am defining a region in n+1 dimensional
space n+1 dimensions because x is an n dimensional
99
00:15:23,390 --> 00:15:31,360
vector neta is a scalar parameter time space
whatever dou/dou x dou/dou t whatever you
100
00:15:31,360 --> 00:15:36,520
are looking at it could be time it could be
space depending upon what you are looking
101
00:15:36,520 --> 00:15:45,320
at and looking at a region the region is defined
using norms this is using only 1 norm this
102
00:15:45,320 --> 00:15:51,750
is using absolute values because neta 0 is
the initial point where you are starting
103
00:15:51,750 --> 00:16:09,330
the value of x at neta 0 so this should be
actually x neta 0 x-x neta 0 then let us see
104
00:16:09,330 --> 00:16:56,410
what these theorem says of existence of solutions
105
00:16:56,410 --> 00:17:10,000
now this theorem gives a condition under which
a unique solution exist it says that if f
106
00:17:10,000 --> 00:17:22,819
and its first partial derivative that is dou
f/dou xk f is a function vector its partial
107
00:17:22,819 --> 00:17:31,820
derivative with i-th component of x that is
also a vector this is also a vector this partial
108
00:17:31,820 --> 00:17:38,090
derivative of the function vector with i-th
component of x is also a vector we are saying
109
00:17:38,090 --> 00:17:49,980
that if this function vector and its partial
derivative is continuous function on domain
110
00:17:49,980 --> 00:17:53,149
on the set d that we have defined
111
00:17:53,149 --> 00:19:10,629
if it is continuous
then
112
00:19:10,629 --> 00:19:18,940
actually x tilda here is the initial condition
i am starting with the initial condition and
113
00:19:18,940 --> 00:19:39,840
initial value of the independent variable
and it also says that the solution is continuous
114
00:19:39,840 --> 00:20:06,659
function of the triplet detailed statement
you can see here what i want to point here
115
00:20:06,659 --> 00:20:15,530
is that how do i judge the problem what is
the importance of this theorem importance
116
00:20:15,530 --> 00:20:22,501
of this theorem is that i am able to judge
about existence and uniqueness of the solution
117
00:20:22,501 --> 00:20:28,559
and continuity of the solution without actually
having to solve it solve the problem
118
00:20:28,559 --> 00:20:35,279
i do not want to solve the problem i do not
want to solve the differential equation problem
119
00:20:35,279 --> 00:20:40,590
i just want to look at a differential equation
and make a judgment whether solution exist
120
00:20:40,590 --> 00:20:48,269
is it unique and if it is unique then the
third thing is is it continuous with respect
121
00:20:48,269 --> 00:21:01,279
to initial condition time and spatial coordinate
expertise my initial condition is the solution
122
00:21:01,279 --> 00:21:08,559
continuous with respect to x tilda is it continuous
with respect to t not is it continuous with
123
00:21:08,559 --> 00:21:11,280
respect to t
124
00:21:11,280 --> 00:21:16,200
now of course there is 1 more aspect which
i am not talking about right now this solution
125
00:21:16,200 --> 00:21:21,059
corresponds to the real system behavior i
am not talking about that right now i am just
126
00:21:21,059 --> 00:21:28,799
saying that in real system what i know that
a solution exist it is continuous with respect
127
00:21:28,799 --> 00:21:34,860
to perturbations in the initial condition
if i slightly start a little later with the
128
00:21:34,860 --> 00:21:38,559
same initial condition i will get a similar
solution
129
00:21:38,559 --> 00:21:43,279
if you think of 2 people doing experiments
on 2 different pendulums which are identical
130
00:21:43,279 --> 00:21:49,380
they start at different points in from the
initial condition the solution will not be
131
00:21:49,380 --> 00:22:00,590
different if the systems are identical
i can judge about the existence of the solution
132
00:22:00,590 --> 00:22:08,320
just looking at continuity of f and continuity
of the first derivative with respect to each
133
00:22:08,320 --> 00:22:34,330
of the elements of x i will just give an example
then we will move on to solving the problems
134
00:22:34,330 --> 00:22:40,990
bifurcations we are talking about the behavior
in the neighborhood of some steady state conditions
135
00:22:40,990 --> 00:22:48,269
even then uniqueness if these conditions are
met solution will be unique bifurcations you
136
00:22:48,269 --> 00:22:54,470
are talking about the steady state behavior
under some parametric variation do not confuse
137
00:22:54,470 --> 00:23:03,960
bifurcation with existence and uniqueness
in bifurcation we are looking at the local
138
00:23:03,960 --> 00:23:10,840
behavior of all the solutions in the neighborhood
of some steady state point
139
00:23:10,840 --> 00:23:13,799
each 1 of them could be an unique solution
starting from a unique initial condition if
140
00:23:13,799 --> 00:23:17,330
you start from an initial condition and it
will get a unique from the same initial condition
141
00:23:17,330 --> 00:23:27,080
you will get the same solution
if you start from the same initial perturbation
142
00:23:27,080 --> 00:23:35,480
from the bifurcation point you will get the
same solution that is important see if it
143
00:23:35,480 --> 00:23:42,529
is unstable reactor if you perturb from the
unstable point in the same way you will get
144
00:23:42,529 --> 00:23:43,529
the same solution
145
00:23:43,529 --> 00:23:52,649
you cannot get a different solution for example
this is an unstable system i am trying to
146
00:23:52,649 --> 00:23:59,799
balance it on my hand this is an unstable
operating point this is an inverted pendulum
147
00:23:59,799 --> 00:24:05,769
and if i put it like this it is a stable system
so this is an inverted pendulum if i perturb
148
00:24:05,769 --> 00:24:10,690
it slightly the way it will behave if i do
the same perturbation every time it will behave
149
00:24:10,690 --> 00:24:13,289
in the same manner every time that is what
i am worried about
150
00:24:13,289 --> 00:24:29,379
let us see a brief application of this theorem
on a specific example
151
00:24:29,379 --> 00:24:35,600
what are these i am writing here in a very
mathematical way that there is a region in
152
00:24:35,600 --> 00:24:41,720
which the solution region of interest region
of interest is there in every physical system
153
00:24:41,720 --> 00:24:48,510
for example if i am working with concentrations
concentrations cannot be negative so you have
154
00:24:48,510 --> 00:24:52,470
to work with in the positive quadrant when
you work with concentrations
155
00:24:52,470 --> 00:24:57,669
there is no meaning for the solution or meaning
for the differential equation when it goes
156
00:24:57,669 --> 00:25:04,740
to the negative point same way about temperature
pressure all these physical variables unless
157
00:25:04,740 --> 00:25:08,769
you start talking about perturbation variables
perturbation variables can be positive or
158
00:25:08,769 --> 00:25:16,190
negative but absolute variables had been positive
so we have to worry about existence of solution
159
00:25:16,190 --> 00:26:02,610
in certain regions of state space let us look
at this 1 specific example
160
00:26:02,610 --> 00:26:10,970
so this corresponds to f(x t) i am giving
you some differential equations right now
161
00:26:10,970 --> 00:26:17,659
i am not worried about whether this corresponds
to a physical real system it is a mathematical
162
00:26:17,659 --> 00:26:25,299
example now i want to apply our theorem without
having to solve i want to judge whether the
163
00:26:25,299 --> 00:26:35,899
solution will exist for every x and t for
every initial condition x not t not if i start
164
00:26:35,899 --> 00:26:41,950
from that will the solution exist will it
be unique will it be continuous with respect
165
00:26:41,950 --> 00:26:49,220
to x not t not and t
166
00:26:49,220 --> 00:26:53,590
now this theorem asserts i just wanted to
understand the application of the theorem
167
00:26:53,590 --> 00:27:00,169
if you are interested in knowing the proof
of the theorem we can refer to books on differential
168
00:27:00,169 --> 00:27:05,230
equations where the proofs are given but for
us as engineers we are just worried about
169
00:27:05,230 --> 00:27:14,380
knowing whether a solution exist for the given
problem first of all we have to see whether
170
00:27:14,380 --> 00:27:22,519
each 1 of them is it a continuous function
is this a continuous function of x1 x2 x3
171
00:27:22,519 --> 00:27:23,889
and t
172
00:27:23,889 --> 00:27:30,879
if you examine all of them these are continuous
functions of x1 x2 x3 and t so first condition
173
00:27:30,879 --> 00:27:44,059
is that f(x) neta should be continuous function
of the dependent variable the second condition
174
00:27:44,059 --> 00:27:58,119
is i have to worry about 3 vectors what are
the 3 vectors 1 is dou f/dou x1 this is the
175
00:27:58,119 --> 00:28:30,809
first vector dou f/dou x1 turns out to be
0 cos t and 1 dou f/dou x2 there are 3 different
176
00:28:30,809 --> 00:28:41,549
vectors which i should look at this is my
f(x t) dou f/dou x1 dou f/dou x2 dou f/dou
177
00:28:41,549 --> 00:28:42,549
x3
178
00:28:42,549 --> 00:28:48,929
if these partial derivatives are continuous
functions or continuous function vectors you
179
00:28:48,929 --> 00:28:57,470
can see for examining these function vectors
you can see that these are continuous functions
180
00:28:57,470 --> 00:29:04,190
since these are continuous functions we are
guaranteed that a unique solution exist for
181
00:29:04,190 --> 00:29:10,080
this particular set of differential equations
starting from any initial condition any time
182
00:29:10,080 --> 00:29:18,999
t not moreover if you perturb initial conditions
by small amount the solution will be perturbed
183
00:29:18,999 --> 00:29:19,999
b a small amount
184
00:29:19,999 --> 00:29:32,480
this we know from analysis of this particular
f(x t) and important aspect i am going to
185
00:29:32,480 --> 00:29:38,019
leave it at this point just the idea of doing
this or sensitizing you about these fundamental
186
00:29:38,019 --> 00:29:44,159
issue you might be solving a problem which
does not have a solution or in some region
187
00:29:44,159 --> 00:29:50,450
solution may not exist because in some region
continuity of this might be lost so you should
188
00:29:50,450 --> 00:30:00,010
at least be aware of that one can examine
without actually having to solve whether solution
189
00:30:00,010 --> 00:30:05,299
exist is it unique and will small changes
in the initial conditions will it lead to
190
00:30:05,299 --> 00:30:06,299
small changes in the solutions
191
00:30:06,299 --> 00:30:16,240
that you can just decide looking at the continuity
of these vectors let us move on to solving
192
00:30:16,240 --> 00:30:22,610
this let us say that we have for given problem
solution exist it is continuous and all that
193
00:30:22,610 --> 00:30:31,690
so now we move on to the algorithms so before
i start with the algorithms i want to talk
194
00:30:31,690 --> 00:30:46,659
about some basic concepts which we will be
using throughout
195
00:30:46,659 --> 00:31:04,460
first thing is marching now what i am going
to do is for the sake of notational simplicity
196
00:31:04,460 --> 00:31:12,390
i am going to just go back here and not worry
about the integration with the respect to
197
00:31:12,390 --> 00:31:21,250
the spatial coordinates i am going to call
this as t and i am going to say at time=0
198
00:31:21,250 --> 00:31:25,820
but the same things can be worked out when
you are starting integration with special
199
00:31:25,820 --> 00:31:36,030
coordinate with space part=0 the other special
coordinate is at 0
200
00:31:36,030 --> 00:31:40,700
everything that i am going to say about time
in the context of integration over a special
201
00:31:40,700 --> 00:31:50,679
coordinate same things can be applied marching
in time if you want to read it every time
202
00:31:50,679 --> 00:31:58,139
as marching in the independent variable is
fine now i want to solve this problem typically
203
00:31:58,139 --> 00:32:08,200
from over an interval t belonging to some
time 0 to some tf i want to see how a reactor
204
00:32:08,200 --> 00:32:15,700
concentration profile is when i give a step
change in the feed flow rate or feed concentration
205
00:32:15,700 --> 00:32:23,919
whatever variable of interest that is me over
a period of time from time 0 to next 30 minutes
206
00:32:23,919 --> 00:32:28,530
i have this model differential equation model
i am playing with it it is like a toy with
207
00:32:28,530 --> 00:32:35,669
me i give a change in the input i record i
want to integrate and find out concentration
208
00:32:35,669 --> 00:32:42,239
profile temperature profile as a function
of time that is what is the assignment which
209
00:32:42,239 --> 00:32:45,080
i have given to you as computing assignment
210
00:32:45,080 --> 00:32:49,869
we are supposed to find it as a function of
time so actually it is the entire function
211
00:32:49,869 --> 00:32:58,960
that i want to find out when you do this numerically
it is not possible often to solve this problem
212
00:32:58,960 --> 00:33:04,480
over the entire interval that you intend to
solve i might be wanting to find out the trajectory
213
00:33:04,480 --> 00:33:16,279
for next one hour but when i integrate i do
not solve 1 initial value problem which is
214
00:33:16,279 --> 00:33:22,919
starting from initial condition at 0 and then
entire trajectory over the entire interval
215
00:33:22,919 --> 00:33:37,350
what i do is i divide subdivide i want to
reach here so this is my tf i subdivide this
216
00:33:37,350 --> 00:34:20,639
into say t1 t2 t3 …what i do is i subdivide
this interval from 0 to tf into smaller intervals
217
00:34:20,639 --> 00:34:30,940
and i go marching in time which means i integrate
from time 0 to time t1 i solve 1 initial value
218
00:34:30,940 --> 00:34:38,370
problem with this as my initial condition
at time 0 and i reach only up to time t1 this
219
00:34:38,370 --> 00:34:45,130
t1 could be for example i want to integrate
the differential equation over 1 hour
220
00:34:45,130 --> 00:34:54,950
but i make a small step from 0 to 1 minute
then the condition at the end of 1 minute
221
00:34:54,950 --> 00:35:02,440
is the initial condition for the next problem
so i march from here to here 1 minute to 2
222
00:35:02,440 --> 00:35:09,230
minute 2 minute to 3 minute and likewise i
go on hopping in time now it is not necessary
223
00:35:09,230 --> 00:35:16,510
that these steps should be uniform they can
be non-uniform depends upon the problem at
224
00:35:16,510 --> 00:35:26,480
hand so i go marching in time and instead
of solving 1 initial value problem i solve
225
00:35:26,480 --> 00:35:33,350
multiple initial value problems 1 after another
sequence in time
226
00:35:33,350 --> 00:35:39,690
the end condition the final condition of the
first initial value problem will be the initial
227
00:35:39,690 --> 00:35:48,970
condition for the next initial value problem
and so on this is how even the problem which
228
00:35:48,970 --> 00:35:53,740
you are supposed to solve in the part of the
computing assignment is to be solve so you
229
00:35:53,740 --> 00:35:59,410
go marching in time
230
00:35:59,410 --> 00:36:20,950
as i said the way you do this
is t0=0 00:36:39,880
that ti-t(i-1) let us call this hi this we
call as integration interval
232
00:36:39,880 --> 00:36:45,260
this we call as integration interval so one
of the major problems in solving ordinary
233
00:36:45,260 --> 00:36:51,430
differential equation initial value problem
is how do i choose integration interval appropriately
234
00:36:51,430 --> 00:37:00,240
we will talk about this in some detail at
a later point what is the basis for choosing
235
00:37:00,240 --> 00:37:01,830
integration intervals
236
00:37:01,830 --> 00:37:06,750
but remember that you are never going to solve
the problem in 1 shot we are going to solve
237
00:37:06,750 --> 00:37:12,490
the problem by marching in time by subdividing
into sequence of multiple initial value problems
238
00:37:12,490 --> 00:37:20,100
and the final value of the last problem is
the initial value for the next problem that
239
00:37:20,100 --> 00:37:26,400
is how we are going to solve it it is like
saying that if you want to go from here to
240
00:37:26,400 --> 00:37:30,360
the gate you are never going to jump in 1
shot from here to the gate
241
00:37:30,360 --> 00:37:37,940
we are going to go in steps steps could be
variable depending upon whether it is a up
242
00:37:37,940 --> 00:37:42,890
the slope or down the slope the pace could
be variable you might be running you might
243
00:37:42,890 --> 00:37:50,880
be sometimes walking but you are never going
to go in 1 shot we will go in steps and the
244
00:37:50,880 --> 00:37:55,510
difference between any 2 steps we will call
it as integration step size this is the first
245
00:37:55,510 --> 00:38:13,710
important concept just a notation that i am
going to use throughout before i move on
246
00:38:13,710 --> 00:38:37,840
so this
let us say function f evaluated at x(ti) this
247
00:38:37,840 --> 00:38:52,840
function vector f evaluated at x at ti and
time ti i am going to denote this as f(i)
248
00:38:52,840 --> 00:38:57,760
this is neither superscript nor subscript
this is a vector it can have a superscript
249
00:38:57,760 --> 00:39:05,520
it can have a subscript i am talking about
a time index here when i write f(i) which
250
00:39:05,520 --> 00:39:15,510
means function vector f evaluated at time
ti using x(ti) and time ti i am going to use
251
00:39:15,510 --> 00:39:24,460
this short hand notation fi for this
252
00:39:24,460 --> 00:39:37,300
similarly i am going to use short hand notation
x(ti) as x(i) that means value of the vector
253
00:39:37,300 --> 00:39:44,570
x at time ti instead of writing every time
ti ti makes my notations very very complex
254
00:39:44,570 --> 00:39:56,030
i am going to use this similarly whenever
i get a jacobian matrix i am going to say
255
00:39:56,030 --> 00:40:12,140
dou f/dou x evaluated at x(ti) ti when this
matrix appears if it is evaluated at time
256
00:40:12,140 --> 00:40:25,730
ti i am going to just call this as dou f/dou
x
257
00:40:25,730 --> 00:40:34,030
subscript i subscript i will indicate that
it has been evaluated at time ti
258
00:40:34,030 --> 00:40:39,210
this is to simplify the notation as we go
along because the notation can become very
259
00:40:39,210 --> 00:40:45,580
very complex when you are trying to solve
ode initial value problem this is the notation
260
00:40:45,580 --> 00:40:54,550
please keep this mind this is what we are
always going to look at
261
00:40:54,550 --> 00:41:05,650
the second important concept that i want to
mention here
262
00:41:05,650 --> 00:41:11,970
is explicit algorithm and implicit algorithm
there are 2 classes of algorithms which we
263
00:41:11,970 --> 00:41:17,880
are going to look at some of them are called
as explicit some of them are classified as
264
00:41:17,880 --> 00:41:23,160
implicit right now i am not going to derive
after some time we will derive algorithms
265
00:41:23,160 --> 00:41:27,190
some of them will turn out to be explicit
some of them turn out to be implicit
266
00:41:27,190 --> 00:41:32,830
right now i am not going to derive the algorithms
while giving the idea i am going to take 1
267
00:41:32,830 --> 00:41:39,160
simple algorithm which all of you probably
know from your undergraduate mathemetics is
268
00:41:39,160 --> 00:41:45,590
euler’s method i am going to illustrate
what is an implicit euler method and explicit
269
00:41:45,590 --> 00:41:50,300
euler method this is just introducing the
terminology 1 is the marching in time second
270
00:41:50,300 --> 00:41:58,550
is explicit and implicit this i need when
i go along
271
00:41:58,550 --> 00:42:24,000
second basic concept that i wanted to know
is
272
00:42:24,000 --> 00:42:30,190
now i have this differential equation just
look the differential equation i have this
273
00:42:30,190 --> 00:42:37,430
differential equation let us say i have done
some integration and i have reached a point
274
00:42:37,430 --> 00:42:46,830
at tn now tn need not be the last point tn
is some intermediate point i want to go to
275
00:42:46,830 --> 00:42:54,320
some other final condition tn is some point
where i have reached i want to solve initial
276
00:42:54,320 --> 00:43:06,410
value problem which is over the interval t
belongs to tn+1
277
00:43:06,410 --> 00:43:20,180
i have started
278
00:43:20,180 --> 00:43:44,880
from time 0 t1 t2 i have come to point tn
and then my problem is to go to tn+1 i have
279
00:43:44,880 --> 00:43:54,070
reached here i want to go to tn+1 what i want
to do is i have reached up to point tn and
280
00:43:54,070 --> 00:43:59,560
then i want to go to point tn+1 so i have
broken down my initial value problem into
281
00:43:59,560 --> 00:44:04,930
sequence of initial value problems i have
somehow solved up to point tn i want to go
282
00:44:04,930 --> 00:44:15,360
from tn to tn+1 the simplest algorithm you
know from your undergraduate is euler’s
283
00:44:15,360 --> 00:44:42,510
method let us go to euler’s method
284
00:44:42,510 --> 00:45:09,160
now i can approximate the left hand side using
x(tn+1)-x(tn) this is an
285
00:45:09,160 --> 00:45:23,270
approximation of the left
hand side now let us take the simplified case
286
00:45:23,270 --> 00:45:43,410
where h is constant
difference between we are taking equal size
287
00:45:43,410 --> 00:45:59,300
steps left hand side can be written as x(n+1)-xn/h
with our new notation the left hand side can
288
00:45:59,300 --> 00:46:15,200
be approximated so i would say that dx/dt
is approximated like this now comes the question
289
00:46:15,200 --> 00:46:20,160
first of all remember we are only solving
this problem approximately
290
00:46:20,160 --> 00:46:26,200
in most of the cases when f(x) is nonlinear
it is not possible to solve the problem exactly
291
00:46:26,200 --> 00:46:38,840
analytically the true solution is more than
often times is not know now question is how
292
00:46:38,840 --> 00:46:46,310
do i approximate the right hand side this
is a function of x and t now the question
293
00:46:46,310 --> 00:46:56,790
arises is whether i should use value of x
this is my initial point i know what is xn
294
00:46:56,790 --> 00:47:07,870
here at this point i can evaluate the function
vector f because xn is given to me it is known
295
00:47:07,870 --> 00:47:08,870
to me
296
00:47:08,870 --> 00:47:18,760
time tn is known to me but if you look at
a differential equation carefully actually
297
00:47:18,760 --> 00:47:29,000
it requires the function derivative the derivative
vector that is f(x t) at each point in this
298
00:47:29,000 --> 00:47:35,790
is not it when you integrate actually you
should know at each point but we do not know
299
00:47:35,790 --> 00:47:41,150
what is the future value you are currently
at time tl you are advancing in time we do
300
00:47:41,150 --> 00:47:46,250
not know the future value you make a simple
approximation that the derivative over this
301
00:47:46,250 --> 00:47:51,730
interval can be approximated
302
00:47:51,730 --> 00:48:02,930
one simple approximation is f(x t) over the
entire interval is approximately=f(xn tn)
303
00:48:02,930 --> 00:48:13,950
you
take the initial value find the derivative
304
00:48:13,950 --> 00:48:24,780
at the initial point local derivative and
if you make this approximation this we call
305
00:48:24,780 --> 00:48:48,480
as f(n) then with this approximation i can
write explicit euler algorithm this is x(n+1)
306
00:48:48,480 --> 00:49:07,580
i am just rearranging the equations x(n+1)=xn+x*
do you agree with me i have just combined
307
00:49:07,580 --> 00:49:11,250
these 2 approximations and arrived at this
algorithm
308
00:49:11,250 --> 00:49:21,430
what it says is that vector x at time point
tn+1 is function of xn and derivative computed
309
00:49:21,430 --> 00:49:36,570
with respect to xn this algorithm is called
as explicit euler algorithm on the right hand
310
00:49:36,570 --> 00:49:45,130
side every thing is known to me xn is initial
value known to i have arrived at that xn by
311
00:49:45,130 --> 00:49:52,010
some means and now i am getting new value
xn+1 when you go from xn+1 to xn+2 what will
312
00:49:52,010 --> 00:50:02,150
happen xn+2 will be function of xn+1 xn+1
would be known to you so you start from n0
313
00:50:02,150 --> 00:50:08,100
what will happen if you start from x0 x1 will
be known to you after you implement this step
314
00:50:08,100 --> 00:50:16,160
then when you go to x2 x1 is known so go to
x2 and so on so you go on marching in time
315
00:50:16,160 --> 00:50:21,230
very very simple way of implementing the algorithm
somebody might say well i do not really agree
316
00:50:21,230 --> 00:50:26,990
that you should take this approximation how
can you say that the derivative in the time
317
00:50:26,990 --> 00:50:27,990
is going to remain constant
318
00:50:27,990 --> 00:51:03,560
he would come up with an approximation x
319
00:51:03,560 --> 00:51:10,100
he would say no no i should take the derivative
at n point not at the beginning point third
320
00:51:10,100 --> 00:51:18,520
person may say well that is not right you
should take average of initial point and the
321
00:51:18,520 --> 00:51:34,130
end point now let us take that view i want
to take average of this +1/2 let us say this
322
00:51:34,130 --> 00:51:43,720
is a better approximation now if this is the
better approximation then i am just taking
323
00:51:43,720 --> 00:51:46,870
the derivative at initial point what is my
algorithm
324
00:51:46,870 --> 00:52:22,400
my algorithm becomes x(n+1)=xn+h/2 f(x(n)
tn)+fx(n+1) tn+1 what is the trouble with
325
00:52:22,400 --> 00:52:30,280
this algorithm trouble with this algorithm
is that xn+1 appears on the left hand side
326
00:52:30,280 --> 00:52:41,020
and on the right hand side how will you solve
this problem in general f is a nonlinear operator
327
00:52:41,020 --> 00:52:45,750
you take a reactor or you take a distillation
column f will be a nonlinear operator how
328
00:52:45,750 --> 00:52:54,190
will you solve this problem
i want hear louder
329
00:52:54,190 --> 00:53:02,510
newton-raphson or successive distributions
or optimization it is a nonlinear now once
330
00:53:02,510 --> 00:53:08,530
you have developed this algorithm this equation
is a nonlinear algebraic equation with what
331
00:53:08,530 --> 00:53:19,920
is unknown x(n+1) is unknown xn is known to
you so this is computable this part is computable
332
00:53:19,920 --> 00:53:25,670
what is not computable is this because x(n+1)
is not known to me i am marching in time i
333
00:53:25,670 --> 00:53:27,200
do not know what is the future value
334
00:53:27,200 --> 00:53:38,200
so i have to guess my future value and do
iterations to solve this problem i have to
335
00:53:38,200 --> 00:53:43,560
solve this problem iteratively and this particular
algorithm is an implicit algorithm it is not
336
00:53:43,560 --> 00:53:52,000
an explicit algorithm here you have an explicit
solution of x(n+1) in terms of xn here you
337
00:53:52,000 --> 00:54:05,520
do not have an explicit solution so this is
categorized as
338
00:54:05,520 --> 00:54:30,780
implicit while this particular algorithm is
categorized as explicit algorithm
339
00:54:30,780 --> 00:54:36,290
this is implicit algorithm this is explicit
algorithm
340
00:54:36,290 --> 00:54:44,090
this is easier to solve we will see after
some time does it give great solutions it
341
00:54:44,090 --> 00:54:51,030
is less accurate you have to use very very
small h this 1 is difficult to solve every
342
00:54:51,030 --> 00:54:56,010
time you have to solve a nonlinear algebraic
equation gives great results numerical stability
343
00:54:56,010 --> 00:55:04,550
is excellent so what is difficult to solve
actually gives you dividends more accurate
344
00:55:04,550 --> 00:55:09,530
better results easy to solve you have to be
very very careful in choosing h i am not saying
345
00:55:09,530 --> 00:55:11,270
you cannot use this
346
00:55:11,270 --> 00:55:19,420
unless you use h to be very very small this
explicit algorithm will not work here the
347
00:55:19,420 --> 00:55:23,440
calculations are more because you have to
choose small h your calculations are more
348
00:55:23,440 --> 00:55:31,430
because you have to do iterative calculations
you get nonlinear algebraic equations so just
349
00:55:31,430 --> 00:55:37,770
look at this i am solving an ordinary differential
equation subject to initial conditions i am
350
00:55:37,770 --> 00:55:43,860
marching in time so one giant ode-ivp is converted
into sequence of ode-ivps
351
00:55:43,860 --> 00:55:52,150
each one of them inside requires iterations
nonlinear algebraic equation to be solved
352
00:55:52,150 --> 00:56:00,370
look at the complexity of calculations but
this is better than this so we tend to use
353
00:56:00,370 --> 00:56:06,490
this rather than this or you can use this
no doubt but you have to choose h to be very
354
00:56:06,490 --> 00:56:12,020
very small so you have to understand the differences
and then use which 1 to use when and so on
355
00:56:12,020 --> 00:56:20,610
we will of course get into those details when
you use which 1 why and so on
356
00:56:20,610 --> 00:56:28,540
so these basic terminology will get on to
the algorithm development from the next class
357
00:56:28,540 --> 00:56:33,430
there is 1 more concept called stiffness of
algorithm or stiffness of differential equations
358
00:56:33,430 --> 00:56:39,020
but we will come to stiffness of differential
equations a little later these 2 are initially
359
00:56:39,020 --> 00:56:46,940
good enough to get started we will develop
these algorithms numerical methods of integrating
360
00:56:46,940 --> 00:56:55,050
differential equations and then we will move
on to analysis part when is 1 better than
361
00:56:55,050 --> 00:56:55,810
the other and so on