Okay. Good morning, everybody. We're reaching the end of the course.
This is the final week, so assignment three is due now and then.
The way it works is we hand out assignment four on Friday and then let's do in the box at the usual time in eighth week.
But Friday is the last lecture, and the last lecture is a special one.
It's not as rigorous as most of the lectures.
It's a talk that I first gave more than ten years ago about the history of great numerical algorithms, but I've been updating it ever since.
So it's become richer and richer as the time has gone by. If you're interested in this subject, which you surely must be, if you're still here,
then this should be enjoyable and you're welcome to bring friends who haven't seen it, if you like.
Anyone interested in numerical computing should find Friday's lecture special.
Something else I want to talk to you about is one of the handouts.
So if you look at the essay called ten Digit Algorithms, this is something I wrote in 2005.
Never published. Actually, though, it's on my Web page. I want you to read this.
I'm not going to talk about it. I want you to read it. And your reaction will be because everybody has this reaction.
Well, that's very interesting, but it has nothing to do with me.
And then I want you to read it again and you'll probably still have that reaction.
But I want to tell you that you're wrong. It does have to do with you.
This essay is addressed to everybody who uses computers for computational science, including people who do large scale computing.
So when you read that essay, when you think this doesn't apply to me, please remember that Professor Trevathan says it does apply to you.
So think again. Please read it. I feel passionately about this subject because I spent so many years trying to help
people get things done on the computer and the mistakes they make are always,
it seems, about forgetting the right way for a human to interact with a machine.
And that's what this essay is about. So please read it and please take it to heart.
Let's see back to the course we have the assignment that you've just, I hope, turned in.
And I wanted to play around a little bit with that, for example.
If we. Go to shed gooey, which is the graphical user interface of Jeb.
One of the things you can play around with there is in the demos you'll see there are some PD E's.
So if I go to Scalar PD is there are some built in examples of the scalar fields and one of them is the advection diffusion equation.
Well, two of them are the advection diffusion equation. And this one here is pretty close to your assignment.
So you can see there's an initial condition specified there, and then there's the equation specified in the box up there.
And when we press solve, it uses clever methods to solve this numerically.
I've also given you a page from the coffee table book about advection diffusion equations.
So if I press solve, we see that kind of behaviour.
So advection diffusion. Well, of course advection means the solution.
Drift in one direction and diffusion means it eventually decays away essentially because of the boundary condition.
If you think of this as heat, then the heat is flowing out of the boundary.
There's a lot of physics in a problem like that.
And this is physics and mathematics that has been of interest to me over the years because I'm interested in eigenvalue problems.
And this is a very interesting kind of situation from the point of view of eigenvalues.
Eigenvalues are often used to describe the behaviour of a dynamical process.
Will it grow? Will it decay?
And if you look at the eigenvalues of this problem there in the complex left half plane indicating decay and in fact the eigenvalues
describe that final phase where the shape has more or less settled down to something near the boundary and it's losing amplitude.
So the eigen function is sort of this shape, which then exponentially loses amplitude.
We could slow it down, I suppose. Let's see what happens if we change point three, 2.1.
We've now got a narrower pulse at the thing at the site.
Let's make it point one. Now that final shape is an eigen function, and in the study of dynamical processes, people pay a lot of attention to those.
But what's so interesting about a problem like this is that the initial physics has nothing whatsoever to do with the eigen function.
So when people tell you that eigen functions determine behaviour of processes in general, that's only true as time goes to infinity for finite time.
It's not true. And in particular,
if you're in fluid mechanics and people tell you you have to study the eigenvalues of some navier-stokes problem to find out if it's stable or not,
you should be very suspicious of that because the initial phase of the flow.
Has nothing to do with the eigen function. It's only this phase that has to do with the eigen function.
And of course, another one of your problems was on the Richardson.
Richardson is a great hero of any British person, a British scientist, a wonderful man.
And I hope you enjoyed that problem involving his work on finite differences.
Before computers were invented. Long before. And then the final one was on the great Scott equations.
There's a. Built in.
Oh, sorry. I don't know if any of you use telephone for that, but in principle, in cheap fun, we should be able to do that.
If I say spin, spin to.
Of G. S two. That's a Grace Scott demo.
It's not a very exciting one, at least on my computer, because it runs too slowly.
So far, it's not running at all. Or is it? Oops.
Is anything happening? Oh, there we are.
So this is not related to the particular initial conditions you computed, but there are two components, of course, and it's not moving.
Now it's moving. So this is an example of a process where you can get very different configurations depending on the parameters.
And that's a subject that's very much associated with Oxford, because a few decades ago,
the famous Jim Murray was the one who wrote papers like How the Zebra Got its stripes and how the leopard got its spots and so on,
using reaction diffusion equations like these. Okay.
I guess that's all I'll say about the assignment.
Let's stop that. Now in this last lecture, we're going to continue talking about polynomials and methods for solving differential equations.
And I wanted, as an aside notice it's a side to make a remark related to the last lecture.
You remember we talked about Fourier and Laurent and Chevy chef in the context of periodic functions and the unit circle and non periodic functions.
And I wanted to make a further remark about non periodic functions.
So this goes back to my high school when I took calculus,
the teacher taught us about series and this is an example of a series, one over one plus X Squared has this Taylor series.
So of course we all know that. Now, where does that series converge?
Well, it converges for X less than one, right? An absolute value.
If X is two, it diverges. If X is a half, it's fine.
So it converges. Four minus one, less than X, less than one.
And then if you're in high school and you're inquisitive, you ask Why?
What is it about that function that makes the Taylor series converge just for those values of X,
Y, not for all X or Y, not for some different range of X.
And then if your teacher is any good, he or she tells you, Well, there is a reason.
And the reason is the complex plain. Which you've heard of, even if you don't know much about it at that stage in your education,
the teacher will tell you that this function has polls that I and minus I.
And the teacher will tell you that. TAYLOR Theories also converge in the complex plane.
And they do that in circles so that the Taylor theory for this function is
going to converge in a circle bounded by the first singularity that it hits.
And that's why it converges between minus one and one, because the complex plane is telling us the deeper truth about.
Taylor theories. I remember my teacher telling me this and it just seemed so natural and important.
And I guess I think of this as my favourite argument why the complex plane matters.
Even for people who don't really use the complex plane, this is just a real question.
Why does that thing converge where it does? But you need the complex plane to understand it.
Now, the reason I wanted to mention that right now is.
This is all about Taylor theories. What I just told you. And a Taylor series.
Is interpolation by polynomials where all the interpolation points are a single point.
So interpolation at x equals zero. So polynomial.
Interpolation. At X equals zero.
For example, the first term in the Taylor series means interpolating by a constant at x equals zero.
These two terms mean that you've interpolated in some sense by a quadratic.
You've matched not only the function value but its first two derivatives and so on.
The further you go in the Taylor series, the more points you have at the origin, as it were, the more derivatives you're matching.
Now that generalises instantly to interpolation in distinct points.
For example, if you're on the unit interval, you would tend to have Chevy Chef points,
which are distributed as the real parts of equally spaced points on a circle.
So those are Chevy chef points on an interval. When you interpolate in those points, you get exactly this kind of effect.
And the only change is that instead of a circle, you get a berenstein ellipse.
So now. Instead of interpolating many, many times at the origin we're now interpolating.
Many, many times at distinct points. The Chevy chef points.
So there's minus one somewhere there and there's one.
You spread your points of interpolation out in a sensible way and you get exactly the same effect.
Where does the series converge? Where do these things behave well?
Where do they converge to whatever function you're approximating?
Well, it depends on some curve in the complex plane and the closest singularity on such a curve.
And the curve is an ellipse with focus there and focus there.
So if we're doing the same function as before. Whereas the mental health of mental.
So if we were interpolating the very same function in cheryshev points rather than at the origin,
then the convergence would occur not in a disk but in a berenstein ellipse.
In other words, this obscure fact about Berenstein ellipsis, which none of you have ever seen before I told you about it,
is simply a natural generalisation of something that you learned at high school if you went to a good high school.
Very natural stuff. It's been known for about 115 years.
But a lot of people who should know this stuff that.
Okay. So let's get back to spectral methods and I want to talk about Chevy Spectral methods based on interpolating endpoints like this.
So the principle that we've encountered so many times is interpolate and then differentiate.
So we imagine that we're given.
Some data at Chevy chef points. And the Chevy chef points are defined like this.
The formula is x sub j equals the cosine of j pi over n zero less than or equal to j less than or equal to n.
And we want the derivative. Of that data, whatever that means.
It's discrete. Of course, it doesn't have a derivative. But we want somehow to differentiate the data.
Well, the idea is to interpolate it and differentiate differentiate the interpolate.
So that's what we'll do. We'll set p equal to the unique polynomial.
Of degree less than or equal to and.
Which interpolate the data. So p of x j equals, let's say, v j if that's your data.
And then. W j is equal to p prime at x j.
And similarly for the second derivative or the third derivative or whatever.
We've seen this kind of idea several times. It's the method that we described for deriving finite difference formulas in irregular point sets.
It's 48 to 48 spectral methods where you interpolate by a trigonometric polynomial in equally spaced points.
And here with cheryshev spectral methods, you're interpolating by a polynomial in unequally spaced points.
So this is a linear process, which means if you have one vector V and another vector W,
then may or Q, then the derivative of V plus Q is the derivative of V plus the derivative of Q.
So since it's linear, we can write it as a matrix.
And how would that matrix look? Well, there's some output vector.
Which is equal to a matrix times an input vector.
So linear algebra gives a clean way to describe Chevy Chase differentiation.
And let's do an example just to make it concrete.
So, for example, if N equals two, then my Chevy chef points are just x nought equals one and x one equals zero and x to equals minus one.
So the polynomial interpolate p of x would be 0.5 x times one plus x z not.
Plus one plus x one minus x.
The one plus point five.
X x minus one. V two.
So that's the polynomial that interpolate arbitrary data v not v1v2 at one zero minus one the derivative.
Is equal to point five plus x times v not.
Minus two X times v one plus x -0.5.
The two. And that tells us what the matrix is.
These are three by three matrix whose entries are obtained by evaluating these three functions at the three grid points.
So. DH I guess by evaluating each column comes from evaluating one of these at the three grid points.
So the zeroth column, if you like, comes from evaluating this at the three grid points, 1.5.5 minus point five.
And then the first column comes from evaluating this at the grid points minus to zero two.
And the second column or this column comes from evaluating that at the grid points.
0.5. -0.5. -1.5.
So that three by three matrix is what you do.
If you have data on a three point grid, you want to interpolated and differentiate it and evaluate it on the same grid.
It's such a natural idea and. Amazingly, nobody really wrote these things down until the 1980s.
It's strange how late it was that the chubby chef methods came into play, and in fact, the names don't mean much to you.
But these matrices were first written down by Gottlieb, who?
Saini and Orszag.
In 1984. I've mentioned the odd bit of history that all these spectral methods didn't really get much attention until the theft was discovered.
The Fast 48 transform because in principle that accelerates them.
But then once they started getting attention, people did all sorts of things without using the FFR.
Of course we haven't used the FFC here. We've just written down a matrix.
So there are, of course, general formulas for these matrices.
There's a code that I put on the website called Check Dot M, which I'll show you in a moment,
which is just five or six lines of MATLAB that computes these things or in CHEB fan you can type dif match.
And get them. There's a slight change a slight difference between the two.
Tap dot m uses exactly what I've told you where you have the cosine and therefore the indexes go from right to left.
So there's the zeroth point and there's the end point in seven.
We decided that was too confusing. So we go left to right.
So whichever fun has a minus sign there, which means that would be the zeroth point and that would be the end point.
All that does is change some signs. So, in fact, let's look at the.
Examples. If you look at your handout, you'll see turning one of them sideways.
There's the little chap routine which computes GMB shift differentiation matrices.
So if I say Cheb of three. Oops I meant to say above two.
So tip of two corresponds to an equal to which means a three by three grid.
So there you see exactly this matrix. And if I say chapter three or Sabbath six, you see.
We get these dense matrices, they lack the sparsity that would be so appealing.
On the other hand, you can often get away with a 20 by 20 or 30 by 30 matrix when a finite difference scheme might require hundreds.
So they're pretty powerful when they work. Let's compare with dif.
Matt if I say above six, I get a seven by seven matrix.
I think I'll get the same if I say diff. Matt a seven.
Let me see if that's true. Yes, it's true.
Except for the signs.
So you'll notice it's the very same matrix with virtually every sign has changed because of numbering the nodes from left to right.
Suppose I said chair above five squared that corresponds to taking the second derivative and evaluating it.
Let's see if I say this match of. Six squared again, the weakest taking the second derivative.
Let's see if I say this format of six comma two where I'm rather than squaring the matrix, I'm asking the code to take the second derivative.
There you have the same thing. As it turns out in Tetfund we do a lot of fancier stuff where we're often using rectangular versions of these matrices.
So I could say something like this math for six to.
And. Let me explain what that is by reminding you what that is.
That matrix interpolate data on a six point grid differentiate twice and samples the result on the six point grid.
This matrix interpolated data on a six point grid differentiates twice and samples the result on a four point grid.
And it turns out that's a slick thing to do if you have a couple of boundary conditions you want to empower.
So it's a very well developed technology. And what I'm going to do now is show you a couple of examples of how you can use it to solve a PDA.
So let's begin with the one dimensional wave equation.
So suppose I wanted to solve you t t equals u x x.
So it's a second order one dimensional wave equation and make it as simple as possible.
I'll put it on the unit interval and I'll have the boundary condition view of plus or minus one equals zero.
And I'll use a leapfrog formula, which means that my time dispensation is leapfrog.
But my space destabilisation will be with these spectral matrices.
So if you wanted to draw a stencil, it would have to include the entire grid in space.
And then something like this in time. Nobody draws stencils for spectral methods.
They're always global, so somehow that's not relevant.
But in principle, this is what you do at that point of the grid in order to get from one time step to the next.
So the formula would be the end, plus one minus to the end,
plus V and minus one over the the time step squared is equal to the second derivative matrix times the n.
So I've just told you a whole scheme for solving this problem.
That's all you need to do. It'll work. And that's what happens in the code called M 55.
So if you look at M 55, you'll see in the top, it constructs the matrix, D, it squares it, and then it goes into a leapfrog thing.
It turns out you need a small time step for stability,
which is a feature of the established methods, and it goes through leap frog and does its thing.
And when you planted it's pretty interesting. So let's do that. So I will say m 55 wave equation, Chad.
And it asked me how many grid points I want. So I'll say 64.
Now, this is kind of an amazing plot to me, at least, because you can see the horror, the vertical lines showing you where the grid is.
And they're, of course, totally non-uniform because it's a Chevy chef grid.
And yet the wave is being simulated beautifully. It seems to be wobbling a bit, but that's just because we're connecting the dots by straight lines.
It's being simulated to very high accuracy, even when the grid spacing changes so dramatically.
Nothing funny happens. It works just fine. Let's do it again on a finer grid.
So try 128. It's a paradox of these polynomial methods that even when the physics is completely translation invariant,
the sensible thing to do is use a grid that is completely not translation and very.
I totally lost track of how matlab does colour. You notice it's now changed the colour.
I don't know why, but there you are in the code.
You'll see that there's a line where I've changed things for non-human boundary conditions.
So let me say a word about how one could do that. What's the mathematics?
So suppose I said that I want the boundary condition on the right to be a human condition.
So I'll say you minus one equals zero.
But you have one has a zero derivative.
So. Well, I didn't really tell you how I had imposed the first boundary condition,
but it's the usual story that when everything is zero, the matrices sort of automatically do that for you.
But now, of course, we have to do something substantive to impose that condition.
Well, we use the spectral philosophy.
So this is, as always, we interpolate by a polynomial and then we avow the derivative at one and we set that to zero.
And what that turns out to lead to is. We have our differentiation matrix applied to some data.
But now we want to take one of the rows of that matrix and use it to impose that boundary condition.
And for example, we can take the first row because that corresponds to.
Position X not the rightmost position, and we could replace that row of this matrix by the first row of the first derivative matrix.
I'm not giving you all the details, but by following through on that concept,
you replace rows of your square matrix with special things for boundary conditions.
So that's the principle of how you do boundary conditions in spectral methods.
You start out with a square matrix and replace some of its rows by other things, or in fact more generally,
you construct a rectangular matrix and then add some special rows to incorporate boundary conditions.
So in fact, that's the state of the art these days, though.
It's not what I'm showing you in these demos. What you typically do is you make a rectangular matrix for the differential part.
For the differential equation per say. And then you add.
Some special rose. For the boundary conditions.
So if you have a second order problem, for example, mathematically people would say that's an operator of index to you construct spectral
disparate causation matrices that are rectangles with two fewer rows and columns,
and then you add two more rows for the boundary conditions. So that's a very pretty technique and very accurate.
So in this code, I'm not quite doing it that nasally. I'm doing it the old fashioned way.
You see, there's a line at the bottom with a present sign.
If we remove that present sign, then in effect, we're doing what I described here and we'll get annoy man boundary condition instead.
So of course, I've got that preloaded. It's called M 55.
Norman. Same question, let's say 128.
So it's a human condition at the right. Can you all predict what will happen?
It doubles in amplitude briefly. The wave sort of sloshes up against the end.
Now, at the left, it's still a direct condition. So what will happen is.
The change of side. If you like.
This is a clarinet because the clarinet has one boundary condition at one end and another at another note at one end, and there slay at the other.
A flute, on the other hand, has the same boundary conditions at both. Let's do it in two dimensions.
So suppose we have. U t t equals u.
X x plus u y y. So that's the second order wave equation in two dimensions.
And of course, the simplest thing we could do is pose it on the unit square, going from -1 to 1 in both directions with a zero boundary conditions.
So here we have the usual problem of. Deciding how to represent higher dimensional objects in a computer language.
In principle, the matrices involved here could be regarded as four dimensional objects, which will act on a two dimensional grid.
So the grid. Will be Chevy chef in each direction.
So that's sort of the X indicators.
And then similarly in Y, we'd have this. So Cheryshev grids are always irregular and in more than one dimension you get this kind of effect.
The good points are, of course, these. So they tend to cluster near the boundaries, which is sometimes good.
If there's a lot happening at boundaries, sometimes it's wasteful if the physics is translation invariant.
So for this equation, it's wasteful to have all those points near the boundaries, but it's the right thing to do in the code.
M 56 I do a slick trick that works in two dimensions, though not in more dimensions,
and that is you notice near the top we define D two to be the square of one of these spectral matrices.
But then we define D to P to be the transpose of that.
The trick that's being used is to differentiate with respect to why we're going to
multiply this would we're going to have a grid of values multiplied on the left
by a matrix and that will act on each column to differentiate with respect to y to
differentiate with respect to x will have the same very same matrix of values,
but will act on it from the right. And that will have the effect of acting on each row and doing the same operation to each row.
So we're using a slick trick in this code. You see at the bottom it says u, x, x.
Which is the second derivative with respect to X is the date of the data matrix v multiplied by something on the right.
You y y. The second derivatives and y's are the data matrix v multiplied by something on the left.
So that's a very nice way to code things, sometimes in two dimensions.
Let's see what happens with that. I do leap frog again our favourite scheme for wave equations and it's called and 56 leapfrog two D Jeb.
So you can sort of see the irregular grid spaced more closely near the boundary than in the middle.
Okay. Let me say a word about spectral methods for a little bit more real problems, which means typically three dimensions.
So remember, we have the Fourier idea, which is for periodic dimensions, and we have the Chevy chef idea, which is for non periodic.
Mathematically, they're very closely related. Both of them can be done using the 50.
Maybe as a rule of thumb, if your grid has at least 128 points in any direction, you'll definitely use the 50.
If it's 64, you might well use the FFP. And of course, if it's a thousand or 2000, you definitely will.
Some of the high end simulations people do are quite incredible.
So for example, there are certainly people who've done 4096 cubed in simulating homogeneous turbulence.
They don't care about boundaries. They just want to know how the navier-stokes equations behave.
So that's a big grid that's 496 cubed, and then there's time stepping on top of that.
Those are serious computations. Probably these days they're up to 8192 cubed or something.
Now, what often happens is that sometimes these types of grids are mixed together.
And it's obvious why in a case like this.
Well, you can't quite tell from the picture. Is it periodic or not? When people do turbulence calculations, they would make it periodic.
So the turbulence people would describe as this by 48 cubed, as it were.
Other people who really did want to work in a cube might despise it by chubby chef cubed, but then there will be problems that mix things together.
So, for example, if you're in a cylinder, which people very often would be in fluid mechanics,
maybe you're studying flow in a pipe or something like that. So you have a stream wise direction, obviously.
The different dimensions have different geometry. In the other way, you might have radius, for example, and then you might have an angle theta.
And probably the most common way people would describe something like this would they would they
would take theta to be periodic of course and they would take ah to be non periodic of course.
And then maybe the subtlest dimension would be that one where physically your your physics isn't periodic,
but very often what people do for simplicity is make the pipe pretty long and make it periodic anyway.
So X would often be Fourier and in a simulation, maybe the picture I should draw should be a bit longer.
That might be the kind of grid people might use. Cylinders are hard and spheres are worse in a disk.
We can imagine a radial variable and a theta variable.
So that would be chubby, chef for you. What do you do with a sphere?
First of all, drawing it is harder.
And one of the funny things about computational science is that this problem just never goes away decade after decade.
There's never a consensus on the right way to handle this here. There are many ideas out there.
It's hugely important, not least for climate modelling.
Whenever you do things on the whole earth, of course you have to use a sphere.
But there are all sorts of problems connected with singularities of your grids.
What do you do? Even in a disk? There's a kind of a grid singularity at the middle, on a sphere.
It's much worse. You could put something at the North Pole in the South Pole, but that leads to trouble of all kinds.
Many ideas are out there. Sometimes people expand things in spherical harmonics, but that's not perfect.
Sometimes people use a couple of periodic variables and one non periodic if you have the inside of the sphere, many different ideas out there.
But I think the remarkable thing is that there's really no consensus yet about the right way to handle a sphere.
We're having fun in fun with something called Sphere fun.
Which has not quite been released yet. But we'll be in a moment. In a few weeks.
In Fear Fun. We actually map a sphere onto two periodic variables.
So of course longitude is periodic, but we also treat latitude as periodic.
So. That's one way to handle fears.
I wouldn't say it's heavily used yet in computational science, but it's there.
So that has the effect that you have a 2 to 1 mapping.
The entire earth is covered twice. So if I I'm not very good at drawing continents, let's see if Africa is down here.
Right. And Europe, then you have another copy of them sort of up here.
It weakens the singularity problems. Now I'm going to give you one more example, going back to one dimensional problems and nonlinearity.
And this is the Alan Kahn equation for which there's another handout from the coffee table book.
Think I mentioned the Allen comment equation too before. It's one of my favourites.
It's a nonlinear reaction diffusion equation that leads to interesting structure.
So the equation is u t equals u x x.
Plus you, minus you. Q. And the version I'm going to show you in a moment has the boundary conditions you have minus one equals minus one,
and you have one equals one on the unit interval.
So the interesting thing about the physics here is that this equation has three steady states.
So one study solutions would be you equals minus one or you equals zero or you equals one.
If you plug that in, this term becomes zero.
So and if it's just a steady state, that would be zero. So this would be zero.
Apart from boundary conditions, these constants would all be solutions of the Allen equation.
And what makes it physically interesting is that these two are stable.
Whereas this one is unstable. So what that means is that if you take some initial condition.
So I'll just I'll draw a function. Here's one. Here's minus one.
Suppose your initial condition looks like that? Well. What happens is that these two stable states attract the solution,
which you can interpret in metallurgical fashions if you know enough metallurgy
so that what you'll find is that this thing approaches after a short time,
begins to look like that, and this begins to look like that.
And so. So. Solutions 10 to -1 or plus one, while ignoring zero in the middle.
But often those things. Don't stay forever.
And in particular. Suppose you have a solution that does something like.
This. Minus one and one. It may look like that for a very long time, a exponentially long time.
But then eventually, in principle, it will. Turned into just a constant solution at minus one.
So these equations can describe things that happen on very long timescales in material science.
Now to describe ties that we could use, the fancy stuff that we talked about for stiff pedigrees.
But the code I'm about to show you is not fancy. It just does leapfrog.
So this one is called M 57.
But I guess we should just look at the code. So if you look at m 57.
You'll see that it's a Chevy chef coat up top and it's just a 24 point grid in this particular version.
And there's an epsilon which is in front of the second derivative.
To decide how slowly we want things to move, basically.
And what this code does is just do leapfrog over and over again.
You can see the key step is V equals V plus k times and then EPS times D2.
So that's the second derivative of D2, the square of the spectral differentiation plus V minus V.
Q So we're just plugging that in in the obvious way to leapfrog.
Let's see what happens for that. So it's called M 57.
And it asks me for an epsilon. So I'll try to point out to this is the initial condition I've chosen point to is fairly boring.
So let's do it again. With .15.
A little less boring. Let's try to point out one.
So now you can see what I described, that it goes up to plus or minus one, but then eventually flips around.
Let's go further. So I'll say. .09.
So this is the metastable state. Mental stability is a huge topic in science, and the classic example is radioactivity.
If you have a nucleus which is radioactive, well, that's a metastable nucleus, which in mathematically will not stay forever.
But the timescale may be very long. Let's try to point out eight.
So you can see a very small change in the diffusion coefficient has a significant change in how long it takes.
And for this crude code, that's as far as we can go.
If I try to go to .07. So far it looks good, but there's actually it's not numerically accurate enough.
And something now is going to happen that shouldn't. I think. Takes a long time.
So now we've switched from radium to U-235.
Now notice it's broken. The symmetry. Everything in this problem was symmetrical.
So that's got to be wrong. That's not the mathematically correct answer.
Although if your philosophy is properly adjusted when things go wrong, you can see some deeper truth in it.
Better metastable solutions do have that property that can be tremendously susceptible to slight perturbations.
So in some sense maybe that's true after all, let's play with the Alan Kahn equation also in just fun.
So if I say Chad Gooey. One of the things there is.
Alan Kahn. So there you have the equation with .03 diffusion constant on the domain -4 to 4, and you have three initial conditions.
And notice each one is a little broader than the previous one.
So that means that they will act on different time scales.
So when I solve that. The narrow one goes First Amendment, that one.
And if I make them a little bit wider, let's see what happens.
So I'll. Okay.
I'll change these numbers, determine how wide they are. Right.
So I'll change 35 to 25 and I'll change 11 to 9.
And I'll change 7 to 5. So now it's slightly less, slightly wider initial conditions.
I guess I didn't change them enough to have a pronounced effect. Well, but you see, the time hasn't gone far enough.
Let's. Let's finish the job. I'll change the time interval to 100.
And just to take a little further, I'll change 5 to 4. Okay.
So just to remind you, on Friday, it's a special lecture, the history of numerical algorithms.
Thanks.