I hope the assignment went okay. The solution sheets were written rather hastily, and in fact page two was omitted from them.
So you can see that's a separate handout. Sorry about that. Anyway, I hope you've turned them in and I hope you had some fun with them.
We've been dis criticising PD ese, although the assignment was odes and I wanted to talk a bit today about order of accuracy for discourteous Asians,
which is thoroughly analogous to what we did for ODS.
The idea being to plug in Taylor series and see what cancels.
And we're going to illustrate this on various examples. And the theme is always implicit and explicit.
Democratisation and the interplay of them in various ways.
So let's has an example.
Look at the heat equation in one D, which is u, t equals u, x, x, and let's just criticise it by a backward Euler style approach.
And if I draw you the stencil, then that's all you need to know to know what I'm going to do.
That's my stencil. So in other words, my disorganisation will be the end, plus one minus the end and position.
J divided by the timestamp will be v j plus one minus two.
V j plus v j minus one divided by the space step squared.
And then that picture tells you that I'm going to do this implicitly, which means we have M plus one up here.
So that means that in order to get from time, step, end to time, step and plus one, we have to solve the system of equations.
But the system of equations is linear because it's a linear problem.
And moreover, it's try diagonal because it's a one dimensional linear problem.
So this is easy linear algebra. You or MATLAB can solve that system without any difficulty.
If we write it as a system, I could write it as matrix times.
New vector equals old vector and the matrix b is a tri diagonal matrix.
So if you'll allow me to use notation that I hope is pretty clear, it's a tri diagonal matrix with a number minus sigma on the sub diagonal,
and then one plus two sigma on the main diagonal and minus sigma on the super diagonal where sigma is K over H squared.
So there we have a complete description of the simplest possible implicit district causation of the heat equation.
Now let's look at how that behaves. To get a sense of its order of accuracy.
So I'm going to look at the code called M42. Looks like a lot of these recent codes we set up a matrix.
I do that in a sparse mode and you can see the main line of the code is the one the for loop and then it says you equals B backslash u.
So that's where we solve this equation at every step to get the new vector.
Okay. So I'll type m42 backward.
Euler And what it does is show you an initial gas that's very under resolve.
The grid's size here is 0.5, so there are only three unknowns on such a coarse grid and it goes to time.
One eight and there you are. Then it does it again with a grid size of one quarter.
There you are. Then it does it again with a grid size of an eight.
And then it does it again with a grid size of a 16. So now it's beginning to look smooth.
You can see that's the initial condition. And after time, one eight, that's what it looks like.
You notice the zero boundary conditions. So it's zero at the right and zero at the left.
Keep going. What was that time space? Step of one eighth or 16th.
This would be 1/32. Same picture.
1/64. Is that the last one?
Now there's one more. Yep.
And another. Okay.
So at the end, it measures the value at the in the middle, at the final cut at the end of the computation.
And it looks at the error in that value as a function of the time step on a log log scale.
So you see that as the time step gets smaller, the error gets smaller.
The first two data points look, maybe quadratic, but you quickly see that it's only linear.
So we're having linear convergence of K first order accuracy is what we're seeing for backward pointer.
And that's what order of accuracy means. Let's spend a moment seeing how we could have predicted that with Taylor series.
So following what we did for ODIs is we without being too rigorous,
right down to a loose definition of order of accuracy, we suppose that we're given a PD with smooth solutions.
And we're given a finite difference approximation to the PDP.
And moreover, we have some prescription about how the time step in the space step are going to converge to zero.
So with K and H going to zero in some systematic way that we've prescribed,
for example, K might be proportional to H or it might be proportional to H squared.
We can do whatever we want.
So what we do to determine the order of accuracy, as with odds, is to talk about something called the local truncation error.
So the LTE, the local truncation error.
Is what you get if at one time step, if everything else has been exact.
So remember the idea for a local truncation error. You plug in a solution, you imagine everything has been perfect up to time.
Step in and then you take one step and you ask, How big an error have I introduced at this one step?
So the local truncation error is the difference between the new value v.
And the correct value at that point, which would be you of x j t m plus one.
Assuming that you is the solution to your PD so where you as a smooth solution.
And we get to take this one time step. So the J and plus one is computed.
From exact values at the previous time steps. So to do that, you plug in Taylor series and see what happens.
And as usual, I'm going to do one example and I'm going to pick the simplest example, which in fact will be forward Euler rather than backward Euler.
So the procedure we follow mechanically is we replace everything in sight by a Taylor series.
So for example, suppose there's a term v, j and minus one.
We replaced that by a Taylor series, expanded around the centre point.
So that would be a tailor series for you.
At x j t and minus one about x j t m.
Then we cancel as many terms as we can. And that gives us the local truncation error and then the same story as with ODS.
If the local error has a certain order, then the global error will be worse by one factor of K because we're adding up the errors at each step.
So we divide by one power of K.
To find the global error, or, as I prefer to put it, the global accuracy.
So that's the procedure. And let's do it for forward Euler.
So if I do forward Euler descriptive zation of the same heat equation.
That's u t equals u x x.
Now we're working with this stencil. So my descriptive zation would be the j and plus one equals the j and plus the.
Sorry, I forgot the the k. Yes, the j m plus one equals V.J. and plus k over x squared.
Times. The second difference v j minus 2vvj plus one minus 2vj plus v j minus one at time.
Step n. So we plug in the Taylor series.
Just as with Odyssey.
And we find that the Taylor series tells us that you evaluated at all we care about is j plus or minus one times h and at time step wn will
be equal to you at the centre value plus or minus h times its derivative plus x squared over two times the second derivative and so on.
So that's the Taylor series in space that tells us what happens when we move to the left or right from the centre point.
Jay. So plugging in that Taylor theories we can see what that second order finite difference does.
This implies that v j plus one minus to the j plus v j minus one is equal to h squared u x x.
Plus X to the fourth over 12 u x.
X x x. And so on. So plugging in the Taylor series tells us, as we'd expect, that the first term is just right.
This divided by x squared is you double x, and then the next order term is at the fourth order.
And it's symmetry, of course, that gives us that.
We've just retired in a symmetrical fashion, so all the third order terms drop out for all the odd order terms drop out.
So plugging that in, we can now compute that the end plus one.
Is equal to you plus. K u x x plus k a x squared over 12 u x x x and so on.
So that's what we get from our finite difference formula. And what we have to do now is compare that to what we should get.
Compare that to the exact solution. So let's see.
In order to do that. I'm going to use the PD whenever we see a USF that's equal to U t because it's the heat equation.
So another way to write this is u plus k,
u t and then we have k x squared over 12 u t t because any differentiation with respect to t is two differentiations with respect to X.
So I'm using the fact that you is the exact solution to the PD.
So the Taylor series tells us that the forward Euler formula gives us at the new time step this approximation.
Whereas the true solution. The exact solution. We could get by a Taylor series in time.
And that would be you at x j.
T n plus one would be you add extra atm.
Plus k times you t plus k squared over two and u t t plus k cubed over six times u t t t and so on.
So this difference between what we got and what we wanted.
Is the local truncation error. That difference is the key thing.
So we see that the local truncation error is the difference between that and this.
Well, this term cancels them, this term cancels and we're left with just that and that.
So the local truncation error is k h squared over 12 u t t minus.
K squared over to u t t plus high order terms.
Or, as we could say, it's o of.
K H squared plus K Square.
So there is the conclusion of our analysis. The local truncation error is a that size and so the global error.
Will be worse by one factor of k. So that gives us o of h squared plus k.
So that's the whole analysis. More complicated formulas are the same in principle, but much more annoying in practice.
Now, by the way, when I write something like this, oh, often in the sum of two terms, the reason I do that is that.
One or the other term might be dominant depending on how you've chosen to relate k to x squared.
For example, if K is proportional to H, then this would be the big term.
If K is proportional to x squared, then the two terms of the same.
So I wouldn't have to write them both. If K were proportional to h cubed, then this would be the dominant term.
So you need to write them both to cover all possibilities.
In our experiment I guess K was just proportional to H, and that's why as we shrank, we well, we saw this dominant term.
Okay. So you're now experts in computing local truncation errors and orders of accuracy.
And now I want to spend a few minutes showing you how to improve it.
The rule of thumb in numerical computations is that when you do something obvious,
it's first order, and then a simple trick usually gets you second order.
But going beyond second order needs more than simple tricks.
So let's look at the simple trick to make this second order accuracy.
And I can say it instantly.
We had an unseen metrical stencil there with backward Euler and an symmetrical stencil here with forward Euler.
Well, if we want to impose symmetry and make it symmetrical and then all the odd order terms will go away and we'll get one more order of accuracy.
So to improve this. We want k squared instead of k.
The trick is simply to use a stencil that does the same thing at the new time step and at the old time step,
so that by symmetry it's almost obvious that it will have to be second order accurate.
You can see at least a few expanded around that point. You'd have all the odd derivatives would drop out.
So this is called Crank Nicholson. So this formula was first proposed in 1947 by a man who just died a couple of years ago.
John Crank, a very major figure in the fusion equations.
Nicholson, I think, was either a student or a post-doc of his.
I forget which woman who died shortly thereafter. So she's sort of ancient history at this point, but he was around for many years.
So if you applied this idea to the heat equation, that's what people call Crank Nicholson.
But more generally, if you say we're going to do a Crank Nicholson style descriptive zation,
then that always means this kind of symmetry in to time levels.
So let's write down what the formula is. We get the J and plus one equals the j n.
And now, instead of a forward difference or a backward difference, we take half of each.
So we now get K over two h squared.
Plus K over two h squared. And I shouldn't have put the line there because I've already divided by x squared.
So we have the second difference at the current time.
Step v j plus one minus to the J plus the J minus one.
And then the same thing at the new time step the j plus one minus to the J.
Plus the J minus one.
So there's a crack Nicholson democratisation and in matrix form we could write that as a vector B, V and plus one equals a times.
Then so there's the. Matrix abstract of the Formula B and A are both tri diagonal.
So they both will have this kind of structure.
Thanks to the one dimensional problem. So that means it's easy to solve these equations.
It's easy to implement this in one day. What are the numbers?
B is equal to the tri diagonal matrix whose entries are minus sigma over two and one plus sigma and minus sigma over two.
And a is equal to try. AG of. Sigma over to one minus sigma.
Sigma over two. And once again, Sigma is over square.
So we've used the symmetry. We expect second order accuracy instead of first order accuracy.
Now let's run the code and make sure that happens. The code is called M 43 and it's pretty much identical to M42.
But you can see in the key line, it's now the backslash eight times you.
Okay. So let me run em.
43. So there you have the same initial condition, but now running with Jack Nicholson.
First we did a space step of a half and then space step of a quarter and then space step of an eighth space step of the 16th.
Of course, here it doesn't see much difference. 30 seconds, 64, 128, 256.
But now notice thoroughly different behaviour if you actually care about the numbers.
This is a much better scheme. We've got five digits of accuracy rather than before.
It was just three or four. So beautiful. Second order convergence.
Okay. So let's do an analogous exploration for the simplest hyperbolic equation, which would be the wave equation in one day.
For. So the one d wave equation.
It's like the heat equation, except with a second derivative in time.
So that would be u t t equals u x x.
And that has solutions that go left at speed, one or right at speed one.
So it's. Easy to write down disparate positions, and we could use Crank Nicholson and it would work fine.
However, this is not stiff like the heat equation.
Everything in this equation travels at speed. One with the heat equation.
Things travel at speed, infinity. But this is speed one.
So there's actually no need to use an implicit discrimination because you'll be able to use a big time step,
even with an explicit, discourteous action.
So with Crank Nicholson, where that's implicit, but you only need that for a diffusive problem, basically because of stability limit.
So here we don't need. To use anything implicit.
Although we could. Because stability is not a constraint.
Any value of any reasonable value of K is probably going to be easy.
It's enough to use a simpler descriptor ization. But let's make it second order in time.
And to do that, we want the symmetry and the obvious symmetry would be achieved by this picture.
So let's discard ties in space with three points and in time with three points, but centre them at the same place.
And that's called the Leapfrog Scheme. And in some sense that sort of dates to 1928, long before people were doing actual computations.
That's all you need to get second order accuracy in H and K and it will still allow you
reasonably big time steps because a hyperbolic equation has the slow speed of propagation.
We can immediately write down the formula. I hope you follow me on these.
So I'll say the end plus one minus 2vj rn plus the j and minus one divided by k squared equals v j plus one minus 2vj plus v j minus one.
Over eight squared. So a second derivative in time is set equal to a second derivative in space.
And you can see that this whole formula just contains this value at the new time step.
So it amounts to a simple linear prescription for getting the new values from the old values.
Nobody in practice would really write this with matrices except me.
So you can of course you could write it as a vector equals.
And then we have this kind of structure.
The new vector is equal to the vector from time to time steps ago, plus the matrix times the vector from one time step ago.
And a is the tri diagonal matrix whose entries are.
Sigma one minus two Sigma Sigma.
And now Sigma has a different definition. Sigma is now K squared over a square.
Everything scales differently. Now we have not against x squared but k squared against x squared.
Of course it's second order accurate the global accuracy.
Is oh of h squared plus k squared.
So we could say it's second order accurate in space and time.
And although it's not approved to say this intuitively, it's obvious that it's going to be second order accurate because of the symmetry.
So let's play around with that one a bit. So the next code is M 44 and it has very similar structure.
Again, I've used a matrix. So the key line is you new equals eight times.
You mind if you hold? So when you have a multi level scheme like this, you have to store more data.
You don't just have a vector, you you need to store the current you and the previous view and then update them as you go along.
So let's see how that behaves. Waves are more fun than diffusion.
So if I run em 44 leapfrog. There's my initial condition for the wave equation.
It's pretty hard to see what's happening on a three point grid. There's a seven point grid.
Here's a 15 point grid. Now you're beginning to see it.
So on the 31 point grid, you'll notice two waves moving in two directions and then bouncing off the end.
And let's look at the code to see why we have that. So if you look at the code, near the top is the initial condition.
So you see, you hold. Is equal to E to the -50 x squared plus 0.3 times E to the -20 x minus two squared.
And then in addition, we have to specify one other initial time level.
So we're going to effectively specifying the value at time zero and at time K at time k.
One of the pulses goes to the left and the other post goes to the right because you see, I have x plus K and x minus K,
so I've set it up so that the initial condition consists of a left going pulse and a right going pulse.
That's why we see that on the next grid.
There are the two pulses here. There's a fairly broad one plus a less broad one.
And you see the broad one goes right and the less broad one goes left and they both bounce off the boundary.
Here we are again. It's a direct condition at the boundary, which is why the sign is negated when you bounce.
I think there's one more. Okay.
Is that the end or is there yet another? That's the end. Okay.
So again, I've done a calculation of accuracy and although there's not too much data there, you can see that it's quadratic.
We have k squared accuracy. There are few variations proposed in this code.
So one of them, you can see the comments in the right where it says periodic boundary conditions.
If I remove the percent signs, then that has the effect of making things wrap around properly.
So everything is periodic. So let's do that. I've got a code pre-loaded for this, so I'll say.
And 44 PR for periodic. So now notice even the initial condition looks different because now the boundary value is a genuine data point.
It's only on that side because it's equal to the value there.
So there's our periodic array.
Of course, grid doesn't show you much. That doesn't show much, but the next one will show you something.
Now we see the two pulses. And now, of course, there's no sign change at the boundary because there's no physics at the boundary.
It's only passing right through it. Is there one more?
Okay. I think that's the end. Okay.
Again, we see quadratic convergence. Another variation on the theme.
Is. Did I write this?
Yes. You noticed? Near the top it says for fun. Switch to one point out two times h.
The stability limit for this code is that K has to be less than H.
I've been running with K equals 0.5 H. If I make k bigger than H, we'll see instability.
So let's try that. I'll switch to 1.02 times H and that's called M 44 U for unstable.
So the same initial condition. And on that course grid, you don't see a problem.
Good size a quarter. You still don't see a problem.
Grid size in eight. You see a problem?
16th. No. That looked better, didn't it?
32nd. Oops. 64th.
It's kind of intriguing that initially the thing looked smooth and that kind of
paradox arises often in numerical calculation that when things are analytic,
the errors that feed instability can be very, very small.
So it may take a while for them to appear, in fact. Sometimes in theory it would never appear.
And it's only the rounding errors that amplify enough to give it stability.
I think we have another grid. Okay. Ready? Here we go. Looks good.
But then suddenly garbage. Oops.
What's happening there? I don't know. And the plot doesn't even show any data points.
So I'm not quite sure why. But there you are since. Oops.
Well for the rest of today. I want to get back to the subject of nonlinear equations.
Is there a question? Yes. Can I explain what you mean?
Why? It's this number? Yeah. Okay, let's see.
I may not be quick enough to do that. So the new value is obtained.
From. I see a is telling us how the part of the contribution from level M so the terms that go into the A matrix should be.
That and the right. So.
This term won't have any factor in front of it. So that should be a two.
And I see a one. Why do I see a. Is that what concerned you?
Yeah. Yeah. And then the other one.
Who should be who? Yes. Why is that a one rather than a two?
I don't see. Let's look at the code and that will tell us the truth.
What does the code say? So if we go back to the code we just ran.
It says a is main diagonal is.
Oh, it is a two. Thank you, Michael. So I think it's a two.
Good. Does it look right to you now?
That's. Is that the first ever I've made in, you know, three months at like three?
Well, for the last few minutes, I'd like to return to the subject of nonlinear problems, which are always the most fun.
And in particular, just a few words back to the subject of what I call reaction diffusion equations.
And Stiff PD. I should remind you that or mentioned that one of the handouts today is an outline of the lectures in the course.
So I gave you one last term and then again this term. And so you can see where we're heading and where we are.
The theme here, as I mentioned, Last Lecture,
is that very often you have a problem with a higher order linear term combined with a lower order nonlinear term.
So many problems. Can be written in the form of a time evolution process where u t equals a linear operator, times u plus a nonlinear operator of u.
This is standard notation. When it's linear, people tend to think of it as a multiplication so they don't put parentheses when it's nonlinear.
It's not just a multiplication, so they do put parentheses.
And many times what you find is that this is linear of a reasonably high order differential order, and this is nonlinear lower order.
And what does high order mean? Well, most often that would be order two or four.
Two would be ordinary diffusion and four would be a higher order diffusion.
But sometimes it will be three. In fact, we're about to do the Katie V equation and there it's three.
What does lower order mean? Well, it might be order one or it might be order zero.
For example, with the Fisher KP equation, it was just order zero because this term was just a u squared minus you sort of a term.
No derivatives at all. On the other hand, with the Burger's equation or the Navier-stokes equations,
you would have linear second order diffusion coupled with nonlinear first order convection.
So as I mentioned earlier, any old method will give you first order accuracy.
And then there are a reasonable, reasonably large number of easy ideas to get second order accuracy.
The trick is to get higher order than that, and that turns out to be surprisingly interesting and challenging.
And I just want to make you aware of my favourite technique for that.
First of all, before I do that, let me just remind you of some of the equations that fit this general template.
So the navier-stokes from fluid mechanics are maybe the single most important.
The core of the equation, which we'll look at in a moment, the Corona Motel Service.
PINSKY Which we mentioned earlier. That's a fourth order one.
The Alan Kohn equation, which is second order.
The Con Hilliard equation, which is fourth order. The nonlinear Schrodinger equation, the Fisher CP equation we looked at.
The Hodgkin Huxley equations from neural messaging, the great Scott equations, which is a system of multiple ones and so on.
The Ginsburg Landau equations, they eichenberg equations.
There are many of these set to an argument. So it's really a very major part of science you find leads to things like this.
And my favourite set of techniques for dealing with them are called exponential integrators.
And I'm not going to go into the mathematics of that. I'll say a word, just waving my hands.
The idea with exponential integrators is to write the PDP an integral form and then approximate what's inside by a low order polynomial.
That's where it all starts from. So you write the PD, you integrate in time to make it an integral.
You approximate what's inside by a polynomial using sort of a rung, a cut, a type of thinking or a multistep sort of thinking.
And out comes what looks like an O the E formula of a slightly unusual kind, where the linear part of the problem can be integrated.
Exactly. And the nonlinear problem you do with a finite difference.
Now, I'm going to show you in one of the codes what this can end up looking like.
I'm not going to write it down here. But let me say a key thing in the history, which is this paper by Cox and MATTHEWS.
So they weren't the first to do formulas like this, but it was their paper which somehow set things going and that that's reproduced.
The first page is reproduced on there. It's 2002.
So if you look at their very nice paper called Exponential Time, different thing for systems.
Some of the ideas go back 20 or 30 years before, but this got people thinking again about them.
And then I got involved because I was interested in PD applications.
So on the back of that sheet of paper, you find this thing by me and a student, Ali Hassan.
What was that? 2005? So what Cox and MATTHEWS did was introduce what seems to be the nicest of the fourth order formulas called ETD.
AK for that stands for exponential time.
Different thing. A cut of fourth order. And then what we did was to apply it to PDS.
And this has now become a standard tool that people find just very convenient and very useful.
You use this Cox MATTHEWS formula and you can do all sorts of things,
especially when you have periodic geometries, which we haven't really talked about yet.
But for periodic geometries, for analysis makes the linear part of the problem especially tractable.
So I want to just spend the last few minutes showing you that, especially in the context of the CDV equation.
So the court does make De Vries equation is a third order equation.
It's u. T plus u.
U x. Plus you triple x equals zero.
So we've got the time evolution. And then this term is the nonlinear convection term.
And then this is the linear dispersion term.
Now the K.B., the equation goes back to the early 20th century,
but it's really in the 1970s that people discovered its extraordinary properties, which have to do with solid times.
And that term was invented in the 1970s.
Throughout mathematics, you have this interplay between linear and non-linear.
Linear is sort of easy and obvious. Nonlinear is harder, and there's much less structure somehow in nonlinear problems.
What made solid times so exciting was that they're nonlinear, very nonlinear, and yet incredibly structured and in particular.
One effect of a solid time solution is that the speed of propagation of a wave.
Depends on its amplitude. So a tidal wave moves faster than a small wave.
Now, if you take an arbitrary initial condition, it will break up into all sorts of stuff.
But it turns out that there is a solution that looks like that that maintains its shape.
So they have this form U of T equals.
A number alpha. Times. The square of the hyperbolic sea cat that one over the hyperbolic cosine times another number.
Times X minus speed times t.
And. Here being can be arbitrary.
Data Alpha is 12 basic data squared.
And see. Is for back to square.
So I pick a baiter and the bigger it is, the bigger alpha is and the bigger the speed is.
So bigger baiters mean faster waves, but also taller waves.
And loosely speaking, it looks like that it's got this hyperbolic secant squared shape.
So if you plug in a wave like that for any baiter at initial time, it will just move along in a steady way.
That's not too exciting, except that the speed depends on the amplitude.
But then what's really amazing is that if that catches up with that, they dance around a little bit and then that one simply passes it.
So if. At time zero. If you have a tall, solid tan and a short, solid tan, then at some later time.
They will have switched places. They're both travelling.
The big one overtakes that. And asymptotically, as time goes to infinity, they have exactly the same shape.
That is completely surprising. Nonlinear problems shouldn't do that.
When things interact non-linear, you expect all sorts of garbage to result.
You know, when one galaxy hits another, it turns into a spiral or something.
But here we have a case where one galaxy hits another and just passes through and they both end up with exactly the form they had before.
This was incredibly exciting to mathematicians in the 1970s,
and since then it has become more and more important in science and in particular in propagation of waves in optical fibres.
That stuff is completely reliant on the mathematics of these nonlinear waves.
That's how optical fibres manage to maintain coherence over long distances.
They exploit the mathematics of solid times. So I've given you a handout from the coffee table book about the KTV equation.
So that's that.
Maybe even more fun is to look on the back of that handout, which is a page from one of the nicest papers ever written in numerical computation.
This is by Foreign Bergin with him back in the seventies.
With him was a nonlinear wage man at Caltech, and Thornburg is a man we've mentioned before who is an outstanding numerical algorithms person.
Between them, they wrote this remarkable paper for the 1970s.
This picture is just gorgeous.
Of course, now it's easy to do things like that, but 40 years ago they realised what algorithms could be used to show these interactions.
So you see a time zero at the bottom there are three solid columns and then as time elapses,
moving up the tall one move fast, the middle one moves at a medium speed and the small one move at a low speed.
And you can see eventually they separate. They all go at their different speeds.
But you notice the shift.
For example, the slow one loses a bit of position after the interaction and you can even see three different types of interaction.
It can be shown that V saw the times have three different ways of interacting and this picture shows them all.
First, you have an interaction here and then another one here and another one here.
And the topographies of those interactions are different and everything is known about that.
So it's a beautiful subject and let's just do it in the last couple of minutes.
Well, in the last one minute.
I draw your attention to the code called M 45 KTV which spells out it's a code spells out this APD arc for a scheme of Cox and MATTHEWS.
So if you want to know the formulas, there they are. This is the whole code.
It will solve the CDV equation and the formulas are not at all obvious.
It's a running cutter type of thing where you have some magic algebra that makes all the right things cancel to give you high order.
So if I run that, I'll get DV. Let's do that.
So if I say m 45, Lee, it gives me a pair of follow times.
It's running exactly this code, giving forth hope.
You're not saying that, are you? Sorry.
So it starts out with a pair of slow times and there you see them doing the right thing.
In the end, they have the same shape they had before. It's a periodic domain, so it just keeps going like that.
So the purpose of this code is to show you precisely what the formulas are.
But if you actually want to work with these things, then I recommend what I showed you last time briefly.
The built in fun stuff. The Code by Adrian Montano called Spin.
So if I run that. With the quote active it seeds in a canned demo.
Why is that taking so long? Oh, there it is.
So it's actually using the same formulas.
But this is a more accurate version and a much more flexible version because you can switch to other arbitrary equations often.
If there were more time, I would change the initial condition a little bit to show you what happens.
But we're at the end of time, so see you on Friday.