Tip:
Highlight text to annotate it
X
Hello and welcome to this lecture 3 of module on ODE, boundary value problems. the type
of problems that we have been solving in this particular module are, for example, we have
looked at heat conduction in a rod, and that particular case, the problem that we ended
up with was d T by d x equal to sum function of T d T by d x or rather d T by d x square
is sum function of T d T by d x and x. The way, we said we can solve this particular
problem is by two methods. One, which we considered in the previous lecture, was the shooting
method and the method that we are going to consider in this particular lecture is through
using finite differences. So, in shooting method, what we did was converted
in shooting method, we converted this ODE boundary value problem into ODE initial value
problem. In that particular case, we guess a value for the initial value and based on
that guess of the value, we try to see how close we get to the actual boundary value
in this particular problem. If we are far away from the boundary value
and not close enough from the boundary value, we use either a bisection rule or a regular
falsie method or Newton's method in order to change our initial values, such that the
boundary values are met. That is its strategy that we followed in shooting method. Now,
this strategy we saw that work for the heat conduction problem, where we had the problem
of d square T by d x square equal to some linear function. In today's module, first
what I am going to do is take up an example where the shooting method is not going to
work. The second example that we had spoken about in the first lecture itself was a reactor
with axial dispersion and that was our example two.
So, that was based on a modification to the example that we had done in ODE initial value
problems. the PFR, the plug flow reactor example, we considered in ODE initial value problem
was of the form v d c by d x, where c is concentration, is going to be equal to minus k multiplied
by c to the power 1.25. So, this was the example that we had taken in the previous module.
Now, this we can modify in presence of axial dispersion. We will have another term, which
corresponds to the axial dispersion term, and that axial dispersion term will be of
the form D, which is the dispersion coefficient multiplied by d square c by d x squared
Now, with this the original initial value problem, was what I have written in white,
with the initial conditions given as c at 0, is going to be equal to sum value c 0.
Now, with this d square c by d x square also included, our boundary condition, we will
need a second boundary condition and typically the second boundary condition is as we had
seen, c dash L equal to 0. So, the first derivative of the concentration c vanishes at the end
of the reactor and that becomes our second boundary condition. So, what I have shown
in the white color is what we had solved in the previous module. What I am showing in
the pink color along with the original equation that is what the problem is we are going to
solve in this particular module. So, I believe the values that we had taken
in the previous module were k by v was 1 by 2 and d by v, we can take it as 1 by 200.
So, what I mean by that is substituting the values, we can have this as d c by d x equal
to minus c to the power 1.25 by 2 plus 1 by 200 multiplied by c double dash. So, that
would be the example and c 0 that we had taken in that example was c 0 equal to one. So,
what we will do is we will take c to the power 1.25 by 2 on to the left hand side and we
will multiply throughout by 200.
So, we will get the equation of the form d square c by d x square is going to be equal
to 200 times d c by d x plus 100 times c to the power 1.25 and this will be subject to
the condition c at 0 equal to 1, and c dash at L equal to 0. This is the problem that
we intend to solve. As we had done before, we will write y equal to c, and z equal to
d c by d z, which will result in two o ODEs; the first ODE, sorry d c by d x, not d z.
This will result in two ODEs. The first ODE is going to be d y by d x is going to be equal
to z and the second ODE is obtained from over here and that is going to be d z by d x is
going to be equal to 200 times d c by d x, which is 200 z plus 100 multiplied by y to
the power 1.25. So, these are going to be our two ODEs: ODE
number one, ODE number two, which we are going to solve using our initial condition c 0 equal
to 1, and our c dash 0 equal to a guess value. This is going to be our initial value problem
that we are going to solve, such that we finally, meet the boundary condition. To arrive at
the boundary condition c dash at L equal to 0. So, c at 0 equal to 1, I am going to replace
as y 0 equal to 1, c dash 0 equal to guess, I am going to replace that as y 0. Sorry,
not y zero but, z zero equal to guess. We are going to shoot such that we arrive at
the boundary condition z at L equal to 0. So this is the problem that we are going to
try to solve using Microsoft excel. Basically, what I want to show you is how this particular
way of solving this problem could lead to certain issues that we need to be aware of.
So, let us create a new problem, new spread sheet, where we are going to solve this particular
problem. Let us go to a new sheet, sorry and what we are going to do is solve the problem
that I just showed on the board. We will increase the size of font size and all those we will
increase.
So, let us try to solve the problem the problem that we wanted to solve we would write that
as y dash equal to z and z dash is going to be equal to 200 z plus 100 y to the power
1.25.
So, I will just do format cells, and I will just beautify it little bit. So, this is the
problem that we are going to solve with the initial values, y 0 equal to 0, and let us
try certain other initial value. We will try that for a bunch of initial values and see
what happens. We will choose our h less, choose our h as
0.01 as we did previously, or let us choose it as 0.05, let us say. And x we are going
to start with 0 and over x i plus 1, is going to be equal to the previous x plus h. I will
do function f 2 and put dollar signs over there so that we are fine. Now, we require
y and we require z, y is known to us, the initial y is 1. Let us say initial z is going
to be minus 0.01, which is what z we are going to start off with. Now, y dash is equal to
z, so we will have k 1 1, it is just going to be equal to z; y dash is equal to z, k
1 2 is going to be equal to 200 multiplied by z plus 100 multiplied by y to the power
1.25. That is going to be our k 2. 200 multiplied
by z, plus 100 multiplied by y to the power 1.25. Next, we want y plus k 1 h by 2. So,
y plus h multiplied by k 1 by 2, and we want z plus h k one by 2. So, this is essentially
what we want and so that is going to be equal to y plus and again this is what we have done
in the previous lecture of this module also. So we have y plus h multiplied by k 1 1, divided
by 2 and I press f 2 over here, and edit this by putting dollar sign, so that when I drag
and drop our h value does not change. This I can just drag it to z plus h k 1 by 2 and
I will press f 2 to figure out that is indeed we have z, so that is c 6 plus h multiplied
by k 1 2 multiplied by k 1 2 divided by 2. Remember, it is not the whole thing that is
divided by 2, but only the h multiplied by k 1 guy is actually going to be divided by
2, so this is need the correct form. Now, we want to find k 2 1 and k 2 2; k 2 1 and
k 2 2, is to be found, and again this we can get by just coping and pasting it over here.
The reason we can get it by copy and pasting is because the relationship of this particular
cell with this cell is the same that we need as the relationship between this cell and
this cell. So, we will just go and do an f 2, to see what the value is. So, k 2 1 should
be equal to z plus h k by 2 and that is exactly what we have our k 2 as and our k 2 2, should
be 200 multiplied by this value plus 100 multiplied by this value to the power 1.25.
So, let us do f 2 and see indeed whether that is true. So, 200 multiplied by this guy, which
is what we had to replace this with plus 100 multiplied by this guy to the power 1.25.
So, y is being replaced by y plus h k 1 by 2 and that is indeed what we have over here.
Actually, so this f 6 is y plus h k 1 by 2 and g 6 is z plus h k 1 by 2, so which is
indeed what we need for our problem. So, our y, the new guess is going to be equal to previous
one, see y i plus h multiplied by k 2 1. We do f 2 and put dollar signs over here, and
we should have it correct. Now, this z is going to be equal to z plus h multiplied by
k 2 2, and again I will press f 2 and put dollar sign. This is what we have been doing
all throughout, so there is nothing odd, nothing new about it. So, we will just drag and drop
this to the next row and we need to solve this up to say x equal to ten, let us say.
So, we will just drag this, until we think it should be enough. So, that is x equal to
1 and let us just go down. And so let us do this up to x equal to 2, let us not even go
up to 10. That is enough for me to show you what the problems are. So, let us say, we
choose the value of z equal to minus 0.01, and quickly you will see that this particular
method is diverging. This, why we get this as an error over here, is because the number
that we would get over here based on the numerical value should be infinity.
Let us try another value z equal to 0. We will see the same problem. Let us try z equal
to 5 and we will see the same problem. So, let us say z equal to 0, we will see that
after about 1.2 meters of length, we get the concentration predicted as infinity. Now,
if z let us say we increase it to 5, which is not a correct value, because of reaction
the concentration should be decreasing but, if you go and check again, we have this guy
as going to a very large value again. So, what that means is basically if our initial
guesses are not in the correct ball park or not in the correct direction, there is no
way for the method that we are going to follow, the shooting method to really figure out that
this is the wrong steps that we are trying to take, and there is no way that one could
recover from these type of errors, simply because the method has not converged and indeed
it has diverged. So, what we need is z should be the fairly
large negative value, so let us try to make this value as minus ten, and if we make this
value of as minus ten, our y value becomes negative. So, immediately our k 1 becomes
square root of we are trying to take a square root of a negative number and therefore, it
does not work. So, maybe we have gone too negative, so let us try to go to say minus
5. Minus 5, also does not work, because this value immediately has got a negative. Let
us say minus 2, see how it works. Minus 2, well this value sounds reasonable but, this
value has immediately gone negative again minus 2 is not working.
So, let us try minus 1.5. Again, we have the same point type of problem. Let us try minus
1; again we have a problem, after the second iteration. Let us try minus 0.5 and with minus
0.5 it work for two iterations but, it did not work beyond this two iterations.
So, what I am trying to show over here is we take smaller and smaller values and still
now with minus 4 we are going to infinity, but with minus 5, if we see, with minus 0.4
we are going to infinity, but minus 0.5 we are going to a square root of a negative number
and the method cannot continue. So, this is one of the biggest problems with the shooting
method, is that it is a method that is often times it fails in order to converge.
The initial value problem that we can get through a shooting method, the initial value
problem itself may not be solvable. The reason that initial value problem may not be solvable
is because the eigen values of the problem that we will end up with, might either one
of the eigen values or multiple of these eigen values might be positive, which basically
means, once we start off with a solution that solution is going to diverge and at certain
point that solution is going to diverge too infinity or minus infinity.
Unless, we can get a solution or we can guarantee a solution of an initial value problem, we
will not be able to proceed with the shooting method. This is not actually limited to just
this particular problem that I showed you, it is not just limited to the axial dispersion
problem. This type of problems does happen. For example, in the heat conduction problem,
if we add up say a heat generation term. Let us say there is some kind of a heat generation,
because of electrical heating at the center of the rod or something like that. Some of
those heat generation term themselves might lead to the same type of instability that
we saw with the reactor. Likewise, if there is a radiation within this
particular system, the radiation problem itself has certain amount nonlinearities associated
with t to the power 4 terms. Those radiation nonlinearities are also going to cause some
problems with the shooting method. So, the overall crux of the matter is that while shooting
method is indeed going to work in certain specific examples, shooting method does not
work in certain other examples. The method of analysis that we took up in
the ODE initial value problem in the previous module that is the method of analysis that
you need to choose in order to figure out whether the ODE initial value problem is going
to converge or not. Typically, the problem in shooting method happens because of the
ODE initial value problem not converging. Usually, if the ODE initial value problems
are going to converge to certain solutions, then we can actually get the algebraic equations
part to converge. For example, we can use a bisection method,
which is guaranteed to converge, or even the Newton-Raphson's method or Fixed point iteration
type of a method, if we are going to use. Those problems tend to be often well behaved
that we can indeed go ahead and use the shooting method. So that is all I have to say about
the shooting method. Now, let us go to the second method that we talked about using the
finite differences and we will take up an example of using the finite differences after
I show how to use the finite differences on the board.
So, we had started we had introduced ourselves to using the finite difference method for
the heat conduction problem. The heat conduction problem, if we stated again was d squares
T by d x square was equal to beta times T minus 30, where beta value was equal to 0.01.
So, that was the problem that we wanted to solve with the boundary conditions T 0 equal
to 30, and T 2 equal to 80. So, we have a 2 meter long rod. Now, this 2 meter long rod,
we are going to divide it into n intervals. These are going to be n equally spaced intervals,
so we will call this node as 1, this node as 2, this node as 2, and so on up to nth
node and n plus oneth node. We are going to write all the domain equations
for all of these nodes, and the boundary equations for node number 1, and node number n plus
1. As we had seen, because we have Dirichlet type of boundary conditions, we do not need
any ghost point method. We can only go with the usual method of solving that is have the
domain conditions for the nodes 2 to n and boundary conditions for the node 1 and n plus
1. So, the domain conditions or rather the domain equations for node i, is going to be
now d square T by d x squared. We will be able to write that as T i plus 1, minus 2
T i plus T i minus 1, divided by delta x squared equal to 0.01 multiplied by T i minus 30.
So, we are going to take a 0.01 multiplied by T i on to the left hand side and finally,
we are going to get 1 by delta x squared T i minus 1 minus 2 by delta x squared plus
0.01 multiplied by T i plus 1 by delta x squared, T i plus 1, is going to be equal to minus
3. And this equation is going to be true for i equal to 2 to n. And for i equal to 1, the
equation that we are going to have is T 1 equal to 30, because T 1 is nothing but, T
at the initial point, we have a Neumann boundary condition.
So, T 1 equal to 30 is one equation and the final equation is T n plus 1 equal to 80.
Now, we have 2 to n that means there are n minus 1 equation over here. 1 and 2 equations
over here, so there are total n minus 1 plus 2, which is n plus 1 equations; n plus 1 equation
and n plus 1 unknowns. These are linear equations and we can solve them using the Tridiagonal
matrix algorithm that we had looked at in the linear algebra course.
Now, if we were to write this in the tridiagonal from, what we get is basically let us just
try to write this overall equation in the form of a x equal to b and continue writing
this. Now, the x bar is going to be nothing but, T 1, T 2 and so on up to T n and T n plus 1 equal to
b bar. The first equation we said was T 1 equal to 30, which was our first equation.
So, with the equation T 1 equal to 30, we will write it as one multiplied by T 1 plus
0 multiplied by T 2, plus 0 multiplied by T 3, and so on up to 0 multiplied by T n and
0 multiplied by T n plus 1 equal to 30. So, that is going to be the first row.
The second row we had 1 by delta x squared T i minus 1. So, that is going to be. So,
in the second row, if we look at this particular equation, in the second row what we will have
is i equal to 2. So, this becomes T 1, this is T 2 and this is T 3. So, the coefficient
of T 1 is 1 by delta x squared, coefficient of T 2 is minus 2 by delta x square plus 0.01,
the coefficient of T 3 is delta x squared and all other coefficients are 0.
So, we will write that down over here. It is 1 by delta x squared is the coefficient
for T 1. The coefficient for T 2 is minus 2 by delta x squared minus 0.01. That is the
coefficient for T 2. The coefficient for T 3 is again 1 by delta x squared and everything
else is 0 that is what we will get in the second row. Likewise, in the third row, we
will have 0, we will have 1 by delta x square over here, minus 2 by delta x square, minus
0.01 over here, 1 by delta x square over here and rest everything would be 0.
Let us go back to the equations and this is all going to follow for all of those rows
and let us look at what we are going to get at the nth row. In the nth row that means
where i equal to n, we will have a coefficient for T n minus one. We will have a coefficient
for T n; we will have a coefficient for T n plus 1. All other coefficients are going
to be 0 and the value on for the right hand side b is going to be minus 3.
So, also in the previous examples, we will have the value as minus 3 in all of the rows
from 2 to n. So, what we said is going to be happen in the row n, is going to be that
we are going to have 0 initially, and we will have non-zero terms for T n minus 1. We will
have a non-zero term for T n, and we will have a non-zero term for T n plus 1. These
non zero terms correspond to T n minus 1. This is the term for T n and this is the term
for T n plus 1.
So, if we notice, it is exactly the same term that is going to repeat. It is 1 by delta
x squared minus 2 by delta x squared minus 0.01 and 1 by delta x squared. So, I will
just write the last two terms over here; minus 2 by delta x squared minus 0.01, and over
here again we have 1 by delta x squared, and everything else is zeros. The last row is
going to correspond to the boundary condition and the last boundary condition if we look
at it is 1 multiplied by T n plus 1 equal to 80.
So, we substitute that over here and we will get everything else is going to be zeros and
we will have 1 over here. So, 1 multiplied by T n plus 1 is going to be equal to 80.
So, to recap for this particular example, what we have is the first row has one corresponding
to the T 1 term and zeros everywhere. So, we will have T 1 plus 0, plus 0, plus 0, is
going to be equal to 30. So, T 1 equal to 30 is our first equation. Our last equation
is we have 0 multiplied by T 1 plus 0 multiplied by T 2, bla bla bla so, plus 1 multiplied
by T n plus 1. So, our last equation is going to be T n plus
1 equal to 80, and all the middle equations are going to be 1 by delta x square multiplied
by i minus 1, minus 2 by delta x square minus 0.01 multiplied by i and 1 by delta x square
multiplied by i plus 1. So, that becomes our matrix A. This is our matrix X and this becomes
our matrix b, and we can solve this particular module using the tridiagonal matrix algorithm
or any of the other methods that we saw in the linear algebra part of the course.
So, what I am going to do next is go on to the Microsoft excel and show how this particular
problem can be solved. I am not going to be use the tridiagonal matrix algorithm but,
I will use the matrix inversion method that Microsoft excel provides us. So, that is what
Ii am going to do but, the way it will be solved, way this problem would be solved in
any kind of a computer implementation of this is indeed to exploit the structure of the
tridiagonal matrix that we end up with and we exploit that structure and we get that
overall solution, using the T D M A algorithm.
So, let us go to Microsoft excel and try to solve this problem. We will try to solve the
same problem again. So, the problem that we are trying to solve is T double dash equal
to 0.01 multiplied by T minus 30. This is the problem that we are going to solve. We
will first define our length and that goes from 0 to 2. So, our length is going to be
2. Our number of steps that we are going to take as n. let us defined this as 10 and our
delta x or del x is going to be equal to length divided by n.
So, those are the parameters for solving this particular problem, using the tridiagonal
matrix algorithm. When we say that we have n equal to 10, basically means that the matrix
A is 11 by 11 dimensional matrix and matrix b will be another 11 by 1 dimensional vector.
So, we will need all of them. So, let us just go and increase the font sizes. So, this is
what we have. So, the 11 rows are going to represent the matrix A, so I will just merge
them. Matrix A and this is going to represent our vector b. And the matrix A will have 11
rows. As we had seen the first row is 1 multiplied by T 1 plus 0 multiplied by T 2 and so on
and so forth. So, we will put zeros everywhere else, is going to be equal to 30. That was
our initial condition. Let us look at what the next condition was.
It is 1 by delta x squared so it is going to be 1 divided by del x squared. That is
going to be this value. The next value is going to be minus 2 divided by del x squared
minus 0.01. recall, what we had written over here, the minus 2 divided by del x square
comes in because of the T double dash term and minus 0.01 comes in because of 0.01 multiplied
by T is taken to the left hand side. That is what we get and this is the value
that we are going to get over here. And this term is going to be 1 divided by delta x squared
again, because that is the coefficient that multiplies T i plus 1, and then we have 0
0 0 0 0 0 0 and 0, and the b value that we had is what is left on to the right hand side.
So, if you look at this expression, what this T once we take to the left hand side, the
thing that is the left on the right hand side is 0.01 multiplied by minus 30 that is equal
to minus 0.3.
So, that is what we will have left on to the right hand side and I think while writing
on the board I had made a mistake on the right hand side, I had written all of those values
as 3. Actually, they should not be 3; they should be 0.3, because it corresponds to 0.01
multiplied by 30, which is 0.3. Now, the third row concerns the equation for T 3. The equation
for T 3 is 1 by delta x squared multiplied by T 2. So, that is going to be equal to 1
by delta x squared multiplied by T 2 minus 2, by delta x squared equal to minus 2, by
delta x squared minus 0.01 multiplied by T 3, and same 1 by delta x squared multiplied
by T 4. So, what we had is T double dash was 1 by
delta x squared, multiplied by T 2 minus 2, by delta x squared multiplied by T 3 plus
1, by delta x squared multiplied by T 4. Then when we took this minus where 0.01 T on to
the left hand side, we got this as 2 by delta x squared minus 0.01, minus 2 by delta x square
minus 0.01. Rest everything else is 0, so we will just put 0 over here, 0, 0, 0, 0,
0, 0 and 0, and this should be minus 0.3. That is what we will get. Now, a pattern emerges.
What is happening is that if you look at the three diagonals those three diagonals tend
to be equal. Whatever, values that we are going to get
along these particular diagonals, are going to equal, because those values are not changing
with the equation. So, this is going to be equal to the value on the previous row and
previous column and we can just copy it throughout the entire thing, and this should be fine.
So, 25, 25, 25 is repeated again, 25 will be repeated at the bottom, so on and so forth.
This value will be equal to 0 and this guy is going to be equal to minus 0.3. So, that
is going to be our fourth row, and this will repeat up to the tenth row, nth row, where
n equal to 10 so forth. Then it will repeat for the fifth, sixth, seventh, eighth, ninth
and tenth row. This is an incorrect thing. So, this should
be equal to 0, sorry. So, the first row should be equal to zero all throughout, and this
is what we are doing just drag and drop. So, this is the fourth row, fifth, sixth, seventh,
eighth, ninth and tenth. So, we will drag it down up to the tenth row, and this is what
we get and we will check those values again and minus 0.3. So, these are the first 10
rows and we need also the eleventh row, corresponding to n plus 1 but, let us check the tenth row.
The tenth row is for the temperature T 10, so we have 0 multiplied by T 1, plus 0 multiplied
by T 2, and so on, up to 0 multiplied by T 9 T 8, plus 1 by delta x squared multiplied
by T 9, minus 2 by delta x squared plus 0.01 multiplied by T 10, plus 1 by delta x squared
multiplied by T 11. That is going to be equal to minus 0.3.
And the last row is going to have zeros everywhere except the last element, where we are going
to have one over here. So, this represents T 11 equal to 80 degrees. So, this is what
we are going to get. So, that is matrix A; this is vector b. Now, what we need to do
is invert the matrix. So, I will have this particular row where I will call this is as
inverse of matrix A. Now that we have constructed matrix A and we have constructed the vector
b. Just give me a minute or so I will just recap. Sorry about that so, we cut the last
four minutes and we re-shoot from here, so I will go on for nine more minutes from now.
Now, that we have matrix A and our vector b, that we have obtained for this particular
system, lets now go ahead and calculate the inverse of matrix A. Again, when you are trying
to solve this particular problem using a numerical technique, it is for this particular problem,
where we have a tridiagonal system of equations, it is not computationally sound method to
calculate the inverse and then calculate x. Simply, because we can exploit the structure
of a tridiagonal matrix, in order to calculate the value of x, the solution x that we are
going to get from the system. However, because we do not want to go into using a tridiagonal
matrix algorithm, instead of that I will just use matrix inverse in order to solve this
problem.
So, what I will do is in the next 11 rows, I am going to compute the inverse of the matrix
over there. So, equal to m inverse and we choose the entire 11 by 11 array. When we
choose this array, just to the right hand bottom of the choice of that array, you will
see a small thing that will popup which says 11 r cross 11 c. That means that right now
I have chosen an 11 by 11 array, 11 rows and 11 column arrays.
So, I will just complete the bracket and press enter. Now, what I have is the inverse is
computed in one of these rows, and we want to one row and one column and what we want
to do is copy this as a matrix inverse for the entire 11 rows and 11 columns. So, I will
now select 11 columns. This is the first row; second, third, fourth, fifth, sixth, seventh
eight, nine, ten and eleven. So, now I have chosen 11 rows and 11 columns, and now I want
to copy this as a matrix inverse. So, at this stage I will press f 2 and control shift and
enter. Remember, this is what we had done earlier, control shift enter is going to do
a matrix computation in this particular row. And if you go and press f 2 at any of the
row and column within that system, what you will see is that it has copied m inverse A
8 to K 18 over here, and when you go to the first... When you look at the actual formula,
you will have this A 8 to K 18 put inside these curly braces. What these curly braces
actually signify is that it is actually a matrix inverse and it is not just a simple
formula. With this matrix inverse, we can now calculate our solution x, our T matrix.
So, x is going to be equal to inverse of A multiplied by b and that we can do by doing
m mult; m mult is a matrix multiplication where we required two arrays array 1 and array
2.
Array 1, we are going to give as the first array over here, comma array 2 is nothing
but, the vector b. So, we will just choose the vector b over here, and then close the
bracket. That should give us the x and this x, we need to again. We cannot copy, paste
this x. What we need to do is we need to select the 11 dimensional vector, press f 2 and then
press control, shift and enter and this will give us the overall temperature.
So, I will call rather than calling it x, I will call this as T and I will have another
vector called x, which is going to represent the locations. This location is going to start
with x equal to 0 and the next one is going to be previous guy plus h or plus delta x
and press f 2, put dollar signs and that should be the trick, and I will copy paste it.
So, this is our x and the temperature I will just copy it again, once again. So, that I
can then plot it easily, temperature equal to this guy and we will plot temperature against
x by going to insert and inserting a scatter plot.
So, what we have done is we have just plotted the x versus temperature and you can see that
the x versus temperature is looks exactly similar to what we had when we used the previous
method of solving that is the shooting method. So, this is how we can solve this particular
problem using the finite difference algorithm.
So, let me now go on to conclude this particular module of ODE boundary value problems. What
we covered in the ODE boundary value problems? We covered the difference between boundary
and initial value problems. In initial value problems, we had the conditions specified
only at one location. Whereas, in the boundary value problems, we had the condition specified,
the initial boundary conditions specified at two boundaries.
An example that we took for the boundary value problem was a reactor with axial dispersion.
We took this particular example using the shooting method and showed that shooting method
indeed has problems, because of nonlinearities. As long as the ODE initial value problem that
we get is going to work, as long as that condition is satisfied, our system of equations is going
to be solvable. If that condition is not satisfied we will not be able to solve the system of
equations.
Then we took up the second example of heat conduction and this is the example that we
solved using two different methods. Those two different methods were the shooting method
and the finite difference algorithm. A final piece of statement about the shooting method
and the finite difference algorithm is shooting method as we saw does have a certain limitations,
but is relatively simpler to use compared to the finite difference algorithm. That is
because ODE initial value problems tend to be often easier to use and there are certain
software that are available to solve the ODE initial value problem.
However, the finite difference algorithm is going to be a much more powerful method in
order to solve a general ODE boundary value problem. Now, the finite difference algorithm
that we have seen has one of the problems, with the finite difference algorithm ends
up being that some of the methods especially to handle the boundary of conditions tend
to be first order accurate and not higher order accurate. But, going to higher order
accuracy methods is going to be straightforward in a boundary value problem.
For example, d square T by d x square, we represented by a central difference formula
which is a second order accurate formula. d T by d x, if we represented using a first
order formula using either the forward or backward differences that is going to be order
h to the power 1 accurate. But, if we use a central difference, it is going to be h
squared accurate. So, that is where we stop with this particular module and I will see
you in the next module.