0:11

Hi, welcome again to this third week of the course, Simulation and

Â Modeling of Natural Processes.

Â In this module of the class, we'll talk about an alternative way of

Â building a numerical scheme which is called an implicit way.

Â So how does this work?

Â First we can have a motivation.

Â So we have several problems that can appear with the explicit numerical scheme.

Â Here you have an example.

Â So imagine that you have a differential equation which is simply

Â s.= -10(s).

Â So this differential equation has an analytical solution and

Â it is simply decreasing exponential.

Â 1:10

When we do an explicit side margin to solve this equation,

Â the numerical scheme we'll apply is s(t

Â + delta t) = s(t)- 10 times s.

Â So you see that now if delta t, so

Â let's say imagine that we start at s0 = 1.

Â [COUGH] If now delta t is too big, for

Â instance bigger than one-tenth.

Â What you see is that after the first iteration,

Â you will reach a point where your solution is negative.

Â So it can be really very negative for

Â instance if delta t = 1, your s1 will be -9.

Â Then if you go to the next step, what you will get is

Â that the solution will grow positive again.

Â And then again negative and positive until it might even increase in size so

Â this variation can go bigger and bigger.

Â And in the end, even become larger than the maximum value

Â of a number you can represent on your computer.

Â So this situation is illustrated on the image on the slide,

Â where you see the black curve is the analytical solution of

Â your differential equation, and you have three different cases.

Â So one is with a deep delta t small enough so

Â that the solution is relatively close to the analytical solution and

Â then in the green and blue curves, we increase delta t.

Â 3:02

What you notice is that you have an oscillation of your numerical solution.

Â In the green case, it seems that, in the end,

Â the solutions still converges towards the exponential.

Â Nevertheless, you see that the solution you get becomes even negative,

Â which is not the case for this decreasing exponential normally.

Â So, what you see then with the blue curve is that it oscillates but

Â that these oscillation become bigger and bigger.

Â And in the end, it even becomes so big that you can not

Â see it on the picture but it will become bigger than

Â the maximum number that we can represent on a computer.

Â 4:40

Let's go back to our tailor expansion we did in previous modules.

Â So instead of evaluating with the tailor expansion

Â S(j) + 1 as we did, let's try to evaluate Sj- 1.

Â So in the first equation, you get these

Â tailor expansion truncated at order one and

Â what you get these that we have Sj- 1 = Sj- delta t times f(S, tj).

Â [COUGH] Now, let's forget about the error term that is present here.

Â 5:23

And let's also rewrite this equation

Â by letting the left-hand side become Sj + 1 so

Â what we get is the following numerical scheme.

Â So we'll have Sj + 1 = Sj + delta

Â t of f(Sj + 1, tj + 1).

Â So what you see here is that our scheme is not so, the evolution of Sj

Â is not only governed by the value of Sj at the previous time step,

Â it is also governed by f of Sj at the current time step.

Â 6:20

So what do we gain now?

Â So, let's go back to our example, and so

Â you have on the right of the slide, a comparison between the two schemes.

Â So on the right you have the explicit time margin, and

Â on the left you have the implicit time margin.

Â You see that the things you have to compute are quite different.

Â Here, you don't need to solve an implicit equation, you simply need to solve

Â an equation you can do it analytically, so it's not a big problem.

Â So the implicit time scheme is that sj +1 = sj / (1 + 10 delta t),

Â while for the explicit time scheme sj + 1 = sj (1- 10 delta t).

Â 7:10

So, on the left of the slide, you see the major difference.

Â For the same delta t's as the ones I showed you in the first leg of

Â this presentation, you see that there is no oscillation.

Â Here the dashed green line is just to remind you the result with the explicit

Â time scheme or the other with dotted points are with implicit time scheme.

Â And we see here that there is no spurus oscillation and

Â that the scheme is completely stable.

Â So we solved the instability.

Â The price we had to pay is that we had to solve this equation

Â analytically before implementing the scheme.

Â 7:58

Okay, let's try to have an interpretation on

Â why is the implicit time margin more stable?

Â So on the left of your slide, you have a function which is the black line,

Â which we are trying to approximate using an explicit time scheme.

Â 8:22

At step one, what you see,

Â so you have a dot representing the value of the function.

Â And basically, you will jump to the point 2 by

Â using the derivative of this function at point 1.

Â So you really have only the information you have at your

Â current position to evaluate the value that you will jump to.

Â Then you go to point 2 and it's again, the same.

Â You will use the derivative you have on point 2 of your

Â function to jump to point 3.

Â 8:59

In the implicit time margin now, what you do is that you use the derivative of your

Â next time to evaluate by how much you must jump.

Â So you have an idea of what is the target value you will go to.

Â So you can anticipate in some sense fast variations of your function here.

Â 9:44

It's almost always also faster but

Â on the other hand, it can be not so stable.

Â So, for instance, you cannot choose any delta t and

Â still get a reasonable solution.

Â 10:01

On implicit margin, on the other hand, so

Â you need to solve this usually implicit equations.

Â So this is more complicated, not only conceptually but also to implement.

Â 10:15

How to do it is also sometimes a slower but you have a huge gain,

Â you are unconditionally stable so you don't have to care that much about

Â how much you will jump and you will still get a good solution.

Â So on the two pictures on this slide, you saw the two different approaches.

Â The dots on the left, the left picture,

Â the dots are the resolution of the growth population problem with the explicit

Â time scheme in the squares are obtained with the implicit time scheme.

Â So, you see that all in all,

Â the difference is not that huge in term of error.

Â This can also be noticed on the right,

Â where we measure the actual error committed by the two schemes.

Â So both schemes, since are both of the same order of error,

Â have pretty much the same error, and

Â the conversions of their error is almost the same too.

Â 11:18

So really the real difference is about stability and

Â how you can choose your delta t.

Â Okay, with this, I end my presentation on these implicit schemes.

Â And in the next module,

Â I will talk about the integration of partial differential equations.

Â So we'll add a bit of space dependence here.

Â Thank you for your attention.

Â [MUSIC]

Â