Okay. Hello, everybody. Today's a bit different in that I'm going to spend the time showing you fun,
which has been a centre of my research and that of the people around me for the last ten years or so.
It's relevant to scientific computing in a very central way.
It's all about a continuous analogue of MATLAB, and obviously you're all fluent in MATLAB.
MATLAB became successful because of vectors and matrices.
The idea of fun is to overload those ideas to functions and operators.
So I'm curious how many of you have tried to have fun before and how many of you have heard of it before?
The last day or two? Yeah. Okay. So this should be a life changing experience.
There's a handout, and I'm actually going to tape a lot of these commands and talk about them as we go.
So you definitely need a copy of that. Let's begin, however, by looking at the website a little bit.
So you get Google to have fun and this is what you find.
We're rather proud of the website. It's pretty.
If you want to learn how to use the thing, you go to docs and you'll find there a user's guide tab fun guide.
So if you click on the Chub Fund Guide. You'll see that chapter one is getting started with fun.
So that's what you need to get started. And then there's 16 or so chapters on different subjects.
Another key place to go at the Chip Fund website is the tab called Examples.
Which is a collection of a couple hundred examples of how to use Turbofan in different application areas.
So on the left you see a table of contents that pretty much looks like a numerical analysis textbook.
And in each of those areas, you'll find different codes that called have fun interspersed with text to illustrate various things.
So for example, if we go to ordinary differential equations linear, I find there 18 examples in that category.
Each one would be an m file that has been published to illustrate this or that.
So the first one says Fourier Spectral Collocation.
If I go to that. I see various things going on with various figures all in fun.
Maybe the other tab that's fun to click on is about.
So if you go to a bout, you learn something about the history of the project and the people involved.
For example, if I go to people, you can see photographs of the various regrettably armed men who've been involved in this project over the years.
Okay. So I want to show you what the thing does, how it works.
So we go into MATLAB, of course, and oh, I should have just emphasised the download situation.
So if you're at the website and click on download, it takes you to.
Some basic information. In the simplest way to download.
The thing is, as it says there, to paste this text right here into your MATLAB command window, and then it will it will do the right thing.
That will give you the standard branch that has been released and is much trusted.
But if you want the latest, you go to GitHub and get the development branch.
So let's see if I click on that icon there at the upper right.
It takes me to GitHub, which is the standard place that open source software is the repository.
So you can see all sorts of things if you want to know what's happening in often
you can click on issues and find all sorts of the latest things going on.
I think when I asked you before, many of you had used GitHub, right? Raise your hand if you've used GitHub.
So that's amazing. Okay. So we certainly use it all the time.
Okay. So let's play with fun and give you a sense of what it can do.
So I'll start following the hand out there with basic Jeb funds.
And the first thing I'll do is create a JAB fund without really telling you what that means,
because we'll immediately modify it to show something more interesting.
So we've just created the function X on the interval from 0 to 10 and now let's say ethical sine of x plus sign of x squared.
So now whatever we've done, it's clearly made something that looks like that function.
And the point of turbofan is to be able to compute with functions in a fast and accurate way, functions like this one.
Now, of course, mathematically we know what that means, but in fun, numerically, that's actually represented by a polynomial.
It's not a sign, it's a polynomial. If we wanted to know something about that polynomial.
The length of F tells us that it's a polynomial interpolate through 119 points.
So it's in fact a polynomial of degree, 118.
And if you wanted to see the points, you could say this.
So fun is all about interpolation by polynomials on clever grids that are good for interpolation.
These are chubby chef grids which are clustered near the end points.
So we're interpolating by a polynomial of degree 118 in a suitably clustered grid.
So that interpolation is a reliable process all the time.
Chep fine is doing that, but in principle you don't need to know that you're just using it as a calculator.
So for example, if I say G equals E to the X each of the F, it makes a new function if I plot it.
There it is. So you see, it feels like symbolic computing, but it's actually numerical.
And as you know, from symbolic computing, symbolic computing is fantastic when it works.
And often it gets sort of grinds to a halt when things get complicated.
The point of cheap fun is to not grind to a halt. So just to give you a bit of a hint about what's going on here.
If I look at the length of G, it's 914.
So that means this curve here is a polynomial of degree 913.
Now suppose I say the length of g times g. Standard MATLAB notation.
Of course, the times in MATLAB that would mean the component wise product of a vector in tetfund by analogy, instead of a vector we have a function.
So it means the position, you know, the in g of x times g of x at each value x, so the length of g times g.
Mathematically, you would expect it to be 1827 because it's a polynomial of degree.
913. But it's not that.
Because what goes on all the time is that the degrees of polynomials are reduced in order to round the whole thing to 16 digit precision.
So the idea of fun is to compute with polynomials, but constantly round them down to 16 digits.
And you can see a bit of how that happens in the next section here, how the constructor works.
So here was f again. Remember, the length of death was 119.
Well, if I say plot coefficients of F. What that will do is show me the coefficients in the actual representation of F and
I think I'll just digress briefly to write one equation on the board about that.
So if you have a function as that sufficiently smooth, for example,
it's enough for it to be Lipschitz Continuous on an interval and by default it's the unit interval.
But it could be any other than the right way to expand f for numerical purposes is as a chubby chef series.
So you write F as the sum from zero to infinity of a coefficient times a the case chevy chef polynomial of x.
So that is a chubby chef series and it's completely analogous to a three series for.
As for periodic functions, Chevy chef is for non periodic functions for AA and vital signs and cosines.
Chevy Chef involves polynomials. The coefficients mathematically are given by a formula which involves a constant two
times an integral from -1 to 1 of f of x t k of x d x divided by one minus x squared.
This is numerically a very effective series with which to represent functions.
And what Cheryshev does all the time is truncate the series to machine precision.
So this function F,
this particular function F is represented as a sum from 0 to 118 of a k t sum k of x for some numerically computed cheryshev coefficients a sub k.
And when I execute plot coefficients. What you're going to see is a plot as a function of k of the size of the coefficient on a large scale.
So mathematically the coefficients go down to zero as K goes to infinity.
Numerically, we're going to stop when we get to machine precision. Okay.
So plot coefficients of F. There it is. You see that this is 118 dots.
I really should plot them as dots. So those are the coefficients of the Chevy Chase expansion.
Mathematically, it would keep going forever. Down to zero.
Numerically, we stopped there when it's gone down about 15 orders of magnitude.
And Tetfund has very slick algorithms for doing this fast and accurately.
Just for fun. Let's make another version of that. I'll say two, and I'll make it equal to the very same function.
So that's what is it? It's a sign of x plus sign of x squared on the interval from 0 to 10.
But now I'm going to give it a special flag double length, which says.
Make this function, except take twice as many Chevy chef points as usual.
And I'm now going to plot the coefficients of F two.
So what you see here is that if you go further, you don't gain anything because of rounding errors.
It's all garbage anyway on a computer in 16 digits.
So Tetfund is constantly finding this point in order to represent a function and in fact we could even superimpose those two plots.
Suppose I say hold on and I'll say plot coefficients of F as red circles.
Then you can see that the adaptive algorithm chops at the right place.
So that's the basis of telephone to use polynomials to do fast computing.
Any questions? I'm going to show you, of course, how we can use them.
Let's say I see on my handout here. I proposed to show you a snake.
I'm not very good at snake, but let me try it anyway. Chap, Snake is a game where I'm not ready.
Really, but let me try. So the idea is that luckily it's going slowly.
I see. So you're. You're supposed to catch this apple, right?
Now it's actually illustrating a mathematical point. So the every time you catch an apple, you get one more dot in the curve.
I'm sorry. It's going so slowly. And the interpolate that's there is based on cheryshev technology so that it is a perfectly good interpolate.
So you see there's nothing really wrong with that curve. And the point is to compare that.
With what would happen if we did. Equally spaced polynomial interpolation.
Why am I spending time on this? But having started, I guess I have to.
So okay. This is relatively straightforward. Now I'm going to do it again, but this time I'm going to do it with the equity flag.
So I'll say chub fun. Chub snake. Sorry. And what is it?
I guess. Equity. So this is the same game except.
Now it's going to be basing the curve on equally spaced polynomial interpolation, which is a very bad method of interpolation.
You see, I'm not very good at this game. Okay.
Now, what you're supposed to see is that as we get more and more dots in our in turbulent.
It oscillates more and more. And if my playing is up to the challenge.
You will see. That it's pretty dramatic.
So in fact, equally spaced interpolation has oscillations that grow by a factor of two.
Every time you add one point. So if I every time we capture one more apple, the wobbles should get twice as bad.
Let's try to get about three more. Okay. And then we'll move on.
Okay. Good. Okay.
We're doing pretty well here. So this is equity based interpolation.
That's the wrong phenomenon. It's called. And the runner phenomenon says you should never interpolate data by polynomials in equally spaced points.
Because the oscillations will be terrible. So if wealthy.
So if Jeb Fund had been based on equally spaced interpolation, we wouldn't have been able to go past degree 15 or so.
But in fact, we can go to degree in the thousands. Okay.
So let's go back to F. There was a F. And let's do some stuff with it, for example, if I say some of that.
Well, in MATLAB, some would add up the elements of a vector.
So here we do the continuous analogue, which is to integrate over the interval where F is defined.
So that will be the integral from 0 to 10 of this function.
F If I say F prime times g. Well, in MATLAB that would be a row vector times a column vector.
In Turbofan it's a row function times, a column function, an inner product.
So again, that's computed by an integral evaluated to 16 digit precision.
If I say norm of F, the idea is if you're a MATLAB user, you automatically know what this means.
You know, this will mean the square root of the integral of the square.
Or if I say norm of f comma, one will get the one norm.
Or if I say norm of f comma inf, we'll get the inform.
Suppose I say come some of F well in MATLAB comes is the indefinite integral operation, right?
Is the discrete cumulative sum. The continuous analogue is the indefinite integral.
So there, there's that. And on the other direction, if I say diff of F well diff in matlab is a finite difference in TETFUND it's a derivative.
So back to EF again. One of the key things of Tetfund and one of the most useful features is root finding, which is really wonderful.
So if I say Roots of F, then it will compute all the points where that function goes through zero and return them as a vector.
Ah, so there's that vector r. And let's guess plot them.
I could say plot Avar against FLIR as dots.
So they're the roots. Very quick way to do global root finding on an interval.
Let's do another example. Let's say Bess equals Jeb fun of Bessel j of zero x on the interval from 0 to 1000.
Okay, so there's a vessel function. If I plot it, you want to see its roots.
Okay. Our equals roots of this plot.
Hold on. Plot R against roots of a sorry against Bess of R as red dots.
So there you see, those are the roots. And I could zoom in. How does this room work?
How is it? I'm not doing very well.
My zooming here. Sorry. Anyway, the roots are all there to high accuracy.
So Japan has this global feature because things are represented globally as polynomials.
It means that any operation you do more or less gets the right answer over the whole interval.
So let's go back to F. And let's make another function.
I'll say hat equals the absolute value of one minus x minus five over five, and I'm going to plot hat as a black line.
Oops, I forgot. What did I do wrong?
I meant one minus absolute on the inside. So plot f I meant hat equals the equals one minus the absolute value of x minus five over five.
So in the first few years, Chevy Fun was all about globally smooth functions.
But of course, in applications, people always have piecewise smooth functions.
So we had to make it so that it could handle piecewise smooth things.
And the black curve is an example of a piecewise linear function.
We call that still a step fun, but each piece we call a fun.
So a chair fun consists of one or more funds that one has to fund.
And then all the applique, all the manipulations of tab funds that you might expect we've tried to implement.
So for example, suppose I say h equals the max of f and hat.
So H is now another type of fun, which should be the maximum of the black curve and the blue curve.
So if I plot it, there it is, and I can do all sorts of things.
Now, what's the maximum of H or what's the standard deviation of H or what's the norm
of H or what's H evaluated at 5.3 or what's the infinity norm of H and so on.
So all of these things are implemented by algorithms that do the right thing from all the pieces to find the maximum.
We find the maximum on each piece and then find the maximum of those numbers.
Or to do the integral, we would integrate over each piece and then add up those integrals.
So let's do some more like that. Suppose I say HP four h prime equals the derivative of H.
I could then say extrema. Equals the roots of the derivative.
And then I could say plot extrema against h of extrema as black dots.
So there you see, we found all the roots of the derivative, including those where the derivative jumps from one side to the other.
So here the derivative jumps from negative to positive, and there's a dot.
There's no dot here because the derivative is jumping from negative to negative.
So there's no group there. I'll skip a little bit.
For most of its history, Tetfund was all about cheryshev expansions and non periodic functions.
We didn't do the periodic case because it seemed too obvious. Everybody knows about Fourier.
Most people don't know about Gem often. But eventually we realised, even if it's obvious, it's still useful.
So eventually a couple of years ago we added a capability for periodic functions.
So for example, if I say E to the sign of pi x, what if I just did this?
I get a perfectly good function. Bubs.
Hold off. That's a Chevy chef representation of a periodic function.
But we could also get a periodic representation. If I say trig, then it's the same thing graphically, but a completely different representation.
It's now a 48 series. And indeed, if I say plot coefficients of F, then you can see that the 48 series has a zero component there.
And then as you go negative and positive wave numbers, it decreases down to machine precision in the usual fashion.
So let me show you again some piecewise smooth jab funds.
So if we say x equals scribble, there is no fun like jab fund.
What that does is it makes a jab fun. So let's plot and I'll say plot x axis equal.
So this is a piecewise linear function, but the catch is it's a piecewise linear, complex function.
So that's the real part and that's the imaginary part. It's a function of a real variable, as always with fun, but it's a complex function.
So maybe the first piece would be that stroke of the T, and then the second piece might be that stroke of the T.
So this has maybe 100 pieces, but often it's just a function.
So I could do things like what's S at point three or what's the maximum of the real
part of S or what's the maximum imaginary part of this or what's the norm of this?
Or What's E to the s? So here we're computing.
A complex function or what each of the three times as can anyone guess what this will look like.
I can't hear you. What? Yeah.
Uh. Yeah.
So that's a rotation. So several of you said it, but here for you, there's a seven memory stick, eight gigabytes.
Yeah. So this is just another function.
It's piecewise smooth, no longer piecewise linear, and each piece would be 16 digit accurate, representing the curve that it's supposed to be.
It's actually a pretty good way to explore your complex functions.
You know, if you want to know what does the sign look like or something, you know, anyone know?
Well, you do that and you can pretty quickly get a sense of things. So what does the hyperbolic sign look like?
And so on. What does the square look like? Let's try.
We'll get square s. So lots, lots to play with.
Okay. Turning over the page now,
I'm going to show you the stuff that was the original motivation for even though it turned out to be not the most important thing for users.
So the original idea is one that we mentioned a few lectures ago of taking long skinny matrices and turning their columns into Continua.
So you imagine instead of an M by N Matrix, an infinity by n matrix, where each column is a function.
So for example, suppose X is the trivial fun on the unit interval by default.
And suppose I make a quasi matrix, as we call it, 1xx squared, x cubed, x to the fourth.
So hopefully you can just from that, see what it's got to mean.
It's it has five columns and each one is a function.
So I could do things like evaluate a I could say what's a at point three comma.
To. Who can tell me the answer to that? Right.
You get another memory stick. Who was that? That you. Okay. Let's do one more.
Okay. Let's say. Point five. Karma for that.
Happy. Somebody.
Yeah, I think that's right. All right, so I'm running low here, but who was that?
Sorry, who was that? You. Okay.
So A is this object which is continuous by five.
If you say size of A, you get infinity by five.
So Cliff Muller, the guy who invented MATLAB, like to have fun and this is the thing he likes most.
Every time he sees infinity by five, he just laughs.
He loves it because you know, it's such a sweet, natural generalisation of classic MATLAB stuff.
If I were to plot a Oh, I like spy. If I spy A you can get a sense of continuous by five or if I plot a Well,
you know, in MATLAB, when you plot a matrix, the default is it plots each column.
So there you see the columns of A, there's one and X and so on.
If I do linear algebra, I get the correct continuous analogues.
So for example, the Q, R Factorisation of A is a product of a matrix that's infinity by five by a matrix that's five by five.
Or if I plot Q. Well, think about the QR factorisation here we have five functions in the QR.
Factorisation we orthogonal those functions. So if I plot Q, I'll get the same functions except orthogonal.
Who knows what those are called?
They're legendary polynomials because the genre of polynomials are what you get when you are in lies x, x squared and so on.
And the unit interval. And you can do things like the singular value decomposition of a.
So what does that mean? Well, you know the picture for the SVD.
Let's draw that on the board. So you know that if you take a matrix.
Say an m by n matrix. Then it maps from our end.
To our M. And it always maps the unit ball in our m to a hyper ellipsoid.
So origin goes to origin and then the singular value decomposition is a way of getting at the principal axes of that hyper ellipsoid.
Well, if it was infinity, it's the same thing. So now we have a quasi matrix.
Whatever our infinity means. So again, it's mapping this end dimensional unit ball onto a hyper ellipsoid.
This lives in an infinite dimensional space, but it only has dimension end generically.
So it's a finite, dimensional, hyper ellipsoid in an infinite dimensional space.
The speed has the obvious interpretation.
So this here would be the first singular value times, the first singular vector, and this would be, if you like, the next singular value.
Times, the next singular vector and so on, and their pre images would be vectors over here.
So everything makes perfectly good sense mathematically in infinite dimensions.
And chip fun has algorithms that compute that. So the SVR, we just did.
Those are the singular values, the length of the axes.
So this is what we were doing when Tetfund was created originally, which is more than ten years ago.
But as far as we can tell, people don't use this stuff very much at school, but who needs it?
What turned out to be much more important than practice was differential equations.
So let me show you a bit of that. Let's make what we call a check up.
So I'll say L equals check up on the interval from -20 to 20.
So check up, of course, is going to stand for an operator, a differential operator, and let's create one.
I'll make it define it by an anonymous function, typical MATLAB style.
So this operator takes the second derivative and then subtracts x times you from that.
So it's a variable coefficient linear operator in this case.
Of course we're going to need some boundary conditions. So I'll say l dot LBC equals one held dot RBC equals zero.
And then in tetfund you can solve this by backslash, just the way you would solve a matrix problem in matlab.
So if I say you equals l backslash zero.
So what that's doing is solving l u equals zero for you.
So l u equals zero would be a differential equation. And we're using whatever algorithm it takes to solve that.
In fact, the algorithm I can describe easily, it consists of just criticising the problem on a Chevy chef grid of size 17 and then
33 and then 65 and so on until the constructor gets down to machine precision.
So it's a standard Chevy chef spectral method in this automatic loop of finer and finer grids until machine precision.
So if we do that, we have just solved for you. First time you do anything takes forever.
Let me prove that that's true. Let's do it again. Faster.
So there we've solved this differential equation. The solution there is an area function.
You know, this is the area differential equation. And as you can imagine, it's very easy to play with things.
Suppose I had changed the operator, for example, by putting a point one in front of the derivative.
So there's a principle of differential equations that whenever you want to make the solution more interesting,
you reduce the constant on the highest derivative.
So if I now solve it and then plot you.
Oops. You'll see it's a higher oscillation, but that's still a polynomial.
It's a telephone. There's its length. What's the max of you?
What's you at? -2.3. What's the norm of you?
All sorts of calculations are in the same fun framework.
And then you can do other fun, linear stuff. For example, what about the eigenvalues of this operator?
Now, if you think about MATLAB and Eigenvalues, there's a command eigg, which gives you all the eigenvalues of a matrix.
Now I give an operator wouldn't make sense because an operator has infinitely many eigenvalues.
We're never going to compute infinitely many. I was, on the other hand, is the MATLAB command to get a few eigenvalues of a big matrix.
So we've overloaded that to give eyes of an operator.
So by default it will give you six of them. And I see because of that small coefficient, it's taking me a while.
Suppose I only wanted three of them. I could say something like that.
Let's do another one for fun playing with eigenvalues of Schrödinger operators.
So for example, here I'm on the interval from -3 to 3.
I could make a Schrödinger operator and find its eigenvalues. But for fun, we've got a special command that does that all for you.
So if I say, well, let's say quantum states of X squared.
Now what that does is it sets up a Schrödinger eigenvalue problem with a potential corresponding to x squared.
And that computes by default the first ten eigen functions, and then it plots them at their appropriate height.
So the physicists among you will recognise the spacing one three, five, seven, nine.
The reason it's .1.3.5 is that I think Planck's constant has been set at 2.1 or something.
So there you have eigen functions of this operator.
This one you could do on paper, of course, but you don't have to change it very much to get something more challenging mathematically.
So there we have the first ten eigen functions of the absolute value function.
And there you can see it's a different shape and the spacing between the eigenvalues is different.
If you're a physics type, you can have a lot of fun with double well potentials and illustrate all sorts of things here.
How many people know this kind of picture? That's enough.
Let's try to put in a double well, potential. Okay. So we'll say let's see if the is x squared.
And I say quantum states of V. Then I get that.
Okay, now let's put a little something in the middle. I'll say the equals.
The max of itself.
And then I'll say. Uh, 1.5 minus five times X squared, I'm guessing here.
Will that be a double? Well. Let's see if I pluck V.
Does that look good? That's what might work. You think it'll work?
Let's try quantum states of V, see if it's interesting. Huh?
What happened? Oh, I said absolute X instead of V.
Oh, it worked. Okay, so here you have a double.
Well, potential the lowest state.
There are two island modes here with virtually identical eigenvalues.
The lowest one would be the blue one, which is an even function.
And the next one is the red one, which isn't on function.
So there you see the kind of line splitting that you get in the spectroscopy are more or less the same thing here, the lowest.
Well, these are the third and fourth eigen functions.
One of them is approximately even and the other is approximately the green looks even and the blue looks odd.
And then as you get near the top of the double, well, it begins to be less important.
And once you get way above it, it looks as if there's no barrier at all.
So, in fact, if we let's compute 30 of them instead of just ten of them.
That's taking too long. That's annoying. So here you can see that the one kind of physics is happening down here and rather different up there.
As a rule, telephone is supposed to be the most convenient method for solving anything available, but it's never the fastest numerically.
I mean, it shouldn't take 5 seconds to solve that problem.
Okay. Let me show you a little more. For a few years, telephones, differential equations were linear.
But then we realised how we could embed them in a Newton iteration in an automated way.
Everything done in this sort of continuous mode. So now you can also do nonlinear things, and I could do that all with check ups.
But to keep the time under control, I'm going to go into the graphical user interface called Jeb Gooey.
So there we are in February. And what you can do here is type a differential equation and see what happens.
So there are a bunch of demos built in and if I went to the area equation, we'd find the kind of thing we looked at before.
Or let's see, let's go to the an advection diffusion equation.
So here we have you double prime plus U, prime plus U, and then some boundary conditions.
If I solve that.
You can see there's a boundary layer at the left end and then the plot down here is showing you the chubby shove coefficients of the solution.
So that's a polynomial of length, about 40. And those are the Chevy chef coefficients.
Let's make the boundary layer narrower. So I'll change point oh to 2.0 to.
So now again, it's a smooth polynomial, but its length has gone up to 122.
Of course, if the boundary layer were of with ten to the minus sixth, this wouldn't be an efficient way to go.
But it's surprisingly good when you're when numbers like 100 are floating around.
If I made it 0.0002, would that still work? See it still worked.
It's a very narrow boundary layer, but no problem. It's only a polynomial of length 322.
On the other hand, if I tried to make it, you know, semitone scale, we'd be in trouble.
Let's show a couple of other examples, some nonlinear ones. So still in the boundary value problem context.
Suppose I say, for example, the non-linear pendulum. So there you have you double prime equals minus sign of you with some boundary
conditions and you can specify an initial guess if you want for the Newton iteration.
And when you press solve, it goes ahead and does a down to Newton iteration.
In the bottom left you can see the corrections that are being added to the step.
This one has converged and there's the converged solution. And you don't have to do this in the Google.
You can export all this to an amp file which turns it into a Jeb fun command.
There's other fun stuff. Let's do a couple more and let's do a let's do the Lorenz equations.
So here we have an initial value problem. There are three bodies.
This is the classic example of a chaotic system.
So if I solve it, it does it thing.
And there you see a chaotic trajectory and you see three curves down here showing the chubby chef coefficients of the three components.
Or we could play with eigenvalue problems. So for example, here's a famous one or Sommerfeld problem.
This comes from fluid mechanics. It's a fourth order complex generalised eigenvalue problem.
And I believe the demo here is computing 50 eigenvalues.
So this is from fluid mechanical stability for flow between a channel.
It's taking a while. But there the eigenvalues in the complex plane the first, the 50 rightmost eigenvalues of this operator.
In the complex plane, there are the eigen functions plotted all on top of one another.
But of course, you could isolate them all if you wanted to.
And there's also some PD stuff built in here, though not quite as reliable.
So, for example, here's the Alan Kahn equation, which is when we like, it's a time dependent PD so Chevy Chef stuff in space and other things in time.
This is an equation whose steady state is going to be the solution minus one.
And when we make it go, those three spikes will decrease to zero at different rates because they have different widths.
So I think on my computer, this goes very slowly, if I remember right.
That's pretty slow. All right. But anyway, you can solve some Pedes.
So that brings us to about three years ago. And then we've been moving into two and soon three dimensions.
So let me just show you a little bit about have fun in two dimensions.
So for example, suppose I say cheap fun to.
Of a function of X and Y, and there's a trivial function.
And similarly, I suppose I say y equals Jeb fun to the function of x and y, another trivial function.
Now I can play with x and Y by default on the unit square from -1 to 1 squared.
So if I say equals cosine of 20 x for example, times e to the minus five times x squared plus y squared.
Then it's doing a similar process of constructing a finite representation to machine precision of this function.
So if I say plot of death, you'll get some kind of surface.
Or if I say contour of F with 50 levels, you'll get a contour plot with a lot of levels.
And of course, you can evaluate you can say F of zero zero.
What will that be? I have one more memory stick now.
I have two more memory sticks. Who said it first.
Did you already have a memory stick? Oh, okay. Mm hmm.
Um, but then, of course, you can do things like compute.
You can take exponentials and so on. If I take the length of this f, it turns out what that gives you is a certain rank.
This turns out to be a function that's separable into an x times a y component.
On the other hand, if I start computing with it, there's G, for example.
Length of G is rank nine. So this function is represented as a sort of a rank nine approximation.
And the mathematics is very much connected to data compression and matrix completion and all that stuff.
I mentioned this a little bit the other day when I mentioned that Gaussian elimination is now an intuitive algorithm.
Well, Tetfund, too, is using an iterative form of Gaussian elimination to construct approximations.
Let's do contour of G. So it looks the same because it's the same shape here.
And of course you can do various things. So if this is G.
If I say some of, gee, I get a check fund because by default some would plug some long columns.
So if I plot some of G. You get a curve.
On the other hand, if you want to integrate in both directions.
Well, you could say some of some of G and that would integrate in one direction and then the other.
Or we have a built in command some two of G. It's very good at doing things like finding Minima and Maxima.
Let me, however, do this. Explain command. That's kind of new.
So suppose you want to know what's happening when it constructs one of these ten fun tools.
Now. Let's see if this works. This is your Chevy fun movie. So that's the function we're explaining.
First it gets sampled on a grid. And then.
It goes a bit slowly. So then it does this rank one approximation.
So there's a row in a column. So now it's seeing whether F can be represented by rank one, this particular F can.
So it's not a very good choice for the explained function.
We should have done G instead. My apologies. But anyway, it then does this wonderful movie stuff.
And explains how you've thereby reduced your two day function to a couple of
one day functions which are then approximated with turbofan as usual fashion.
Those are some plots of the coefficients of the X function and the Y function.
And then I think it's about to show you that the final representation.
Is a suitable product. But since this is rank one, it'll be a fairly trivial product.
How is it stored? It's stored as two quasi matrices, but these quasi matrices are infinity by one, so they weren't very exciting quasi matrices.
Now, let's see. I'll show you like one more thing. What will I show you?
Well, I'm going to skip to number 14 and just do that.
So suppose I say theta equals 0.9 times pi times x and phi equals pi times x and capital f equals minus one plus point three times cosine of phi.
Stop me if you see a typo, tell me so I can fix it.
Times sign of theta and then I'll say one plus point three times cosine of phi, times cosine theta and point three times sine.
Anyone see any errors here? Hope that's right.
This play. In the first line.
That's a good point. Yes. So this will be garbage. Okay.
Thank you very much. So I should have said five equals pi times y.
Okay. Now, if I do a surface plot of f you see, we can do these.
I need an access. Equal access. Equal can light show.
So we can do this fun stuff with surfaces and through these and we're extending it to methods of computing functions on spheres and disks.
So it's really turned out to be a wonderful organising principle.
Just to remind you, the essential idea is always continuous analogues of familiar, discrete things.
Okay, so that's it. Now, let's see. Mikhail is going to hand out assignment to.
Is that the usual way through him and and through Z.
Okay. Thanks.