Modeling with Mathematics and Computation

Applied mathematician David Ketcheson explains how math and computation model the world through two approaches: principle-based models from physical laws and data-driven models from datasets. He walks through machine translation using word vectors and linear algebra, then demonstrates simulations of paper airplanes, tsunamis, and smoke rings.
Chapters
It's a great honor and a pleasure for me to be here and speak to you today. Like he said, I've been at KAUST for the past almost 5 years now, and in all that time, I've never been to visit KAU, and I feel actually sad about that, but very happy that I'm changing that fact now. We are your younger and smaller neighbors to the north, but We would like to have lots of interaction with you. And I'm excited to learn that now PhD programs are being established here in the college. And I think we can now have a lot of interaction in terms of research between our universities. And that's my hope. I have to warn you, my voice today is a little bit strained. I've had a cold. And I'm hoping that it will last for the full hour. If not, we'll have a short lecture. So yeah, I want to talk about modeling with mathematics and computation. My background is in applied mathematics, and I study how to apply mathematics, or really how to solve mathematical models using computation. Okay, and the images here on the title slide are just some teasers of things that will come up during the presentation. Also, I've changed my presentation a little bit from the abstract in order to keep it more focused. I won't talk almost at all about my own work. I really want to talk about why mathematics and computation are important and are really the languages that one must speak in order to be fluent in technology and our understanding of the world. And also, I've tried to keep the examples, I think, Interesting and fun, so they may be less serious than what was indicated in the abstract, but hopefully more interesting. And I want to say also, please feel free to ask questions at any time during the presentation. I wanted to be interactive with the audience, and if you're in another room that I can't see, feel free to just yell out a question because I can't see you raise your hand. I won't mind if you interrupt me. Thank you.
Okay.
So there are really, I think, 2 categories of mathematical and computational models. Historically, almost all of them have been what I'll call principle-based, or you might say equation-based. And these models are based on some fundamental understanding of the phenomena in the real world. And we try to find equations that describe the observations that we see. So a very well-known example of this is Kepler's laws describing the motion of the planets in the solar system, right? These were based on years and years of very refined observations that allowed him to come up with a more accurate model. And then we can solve these equations to make predictions about what will happen in the future or in circumstances that we haven't observed. The other kind of models that are becoming more and more important, and I think in our lifetimes we'll see them be more important actually than these principle-based models, but that's just speculation. They're what I will call data-driven models. So everybody knows that nowadays we have a lot of data about a lot of things, much more than was available even 10 or 20 years ago. And these models are based on using, you know, really collecting just huge amounts of information. So this might be information, you know, on the internet, information from traffic sensors, information from satellites, and then using data to infer relationships, right? So it's not that we have some deep understanding of what's going on, but just based on all of this data, we can determine when, you know, this situation implies that this will happen. And we can make predictions based on that model just like we would with a principle-based model. And I should say that often these 2 kinds of models are combined. So when you see the weather forecast, for instance, it's a combination of both of these models, right? So obviously we've been watching weather in the Hejaz region, say, for a long time and Even if you had no equations to describe the atmosphere, you could say, well, whenever the, you know, there are clouds to the north, they come south and, and reach Jeddah, right? So that's the sort of data-driven approach. But also weather forecasts are based on simulation using the principle-based approach. So I'm going to talk about each of these kinds of models and some of the advantages and disadvantages. The main The main difference that I see between them is that principle-based models, like physics models for instance, like Newton's laws of motion or relativity or quantum mechanics— these are canonical examples— are things that are understandable by humans. Now you might debate with me whether quantum mechanics is understandable by humans, but the idea is that really we have some insight into the physical nature of things on which these models are based. But we have to have that in order to develop a principle-based model. Whereas a data-driven model, the advantage is it only requires that we have observations. We don't need to understand anything about what is happening. We just need the data. But the trade-off is that really the model itself is just an encoding of relationships that the computer understands. And it's a challenge to get human-understandable relationships out of these models. So I'm going to start with some examples of data-driven models. So one of these, which I'll go into in some depth, is a model for translation between different languages. So of course, the ideal way to translate between 2 languages is to have someone who knows both languages. And therefore knows the correspondences between words in the different languages. But it was suggested already 30 years ago by researchers that if you just had a machine analyze all the books ever written in, say, English and all the books ever written in Arabic, the machine could actually probably come up with as good or better a system of translating than an individual human expert. And now we're seeing the reality of that. So this is the Google Translate webpage, which is based in large part on a data-driven model. Okay, you can also use data-driven models, for instance, to predict human preferences or interests. And this is a place where I think principle-based models aren't very useful. Ironically, we don't understand ourselves or how we work so well. At this level. But if you know that, you know, most people who read, you know, one book also liked another book, or who saw one movie also liked another movie, right, you can use this to predict human behavior. And this is, I think, more and more the advertisements that you see on the internet are based on these kinds of models, right? So if you use Amazon, then it looks at the things that— the products you've examined, the things that you've bought, and things that were bought by other people who bought similar things, and it suggests to you things that it thinks will be of interest to you. And this is really becoming, from a practical and financial standpoint, a very huge effort. So for example, just a few years ago, Netflix, which is this company that rents movies by mail and now over the internet, they ran a competition to see— they released a huge amount of data and said, can you, based on this data, determine what movies all these users will like? And they gave $1 million to the winning team. Right, so this is a big deal and I'm sure they've made a lot more than $1 million off of using the models that came out of that. Okay, and then another very common example where data-driven models are useful is image recognition. So what, what is this image of? Does anyone know? Yeah. The King Fahd Fountain. The King Fahd Fountain, right? Okay, and we all know that because we've seen it and it's quite iconic and famous. But how would a computer know what is in this image, right? Or just if you give a computer an image with faces in it, can it tell where the faces are, right? And actually nowadays, just in the past few years, we all have, or many people have personal experience with this because if you buy a digital camera nowadays, it will figure out where the faces are in the picture. It can even detect if someone is smiling, right? And this is based on training the algorithms using lots and lots of data. Yes? Yes, these are usually statistical. Yes, these are usually statistical. That's right. Yeah. But there are principle-based models that are statistical also. So I would say that's not necessarily a defining characteristic. For instance, quantum mechanics only tells you probabilities. Right, but it's purely— it's not data-driven at all, right? It's purely equation-based. Okay. All right, so I want to go in some depth into this translation through data mining, and let me just, in case— how many of you have used Google Translate before? Raise your hands. Okay, almost everyone here. Okay, my internet connection is a little bit slow, and since you've all used it before, maybe I won't wait for this to load. I'll just go back to the presentation. But one of the really interesting things is that the researchers at Google— oh yeah, okay. So this is a scientific paper by 3 researchers. And notice you can tell by their email addresses they work at Google, right? But they've made the information about how they're doing this translation freely available on the internet. Now, I don't think this paper contains every detail of maybe a lot of the tricks that they use or things that they combine together in Google Translate, but it is sort of their latest and greatest algorithm for doing machine translation. And anyone who wants can go and read it, right? But you need to understand some mathematics. That's the language you need to understand. Let me see if— Okay, it came up. So just as an example, I can, you know, since I don't know how to say this in Arabic, I can at least visually tell you, thank you for inviting— I'm not thinking— thank you for inviting me here. Okay. How good is the translation? I'm curious.
Good.
Perfect. Okay. So it's a very simple phrase. And if you try, you can find things that it will not get correct. And you can even go over here and you can tell it, I think this is a better translation, or that is a better translation. And if many people do that, the behavior of the system will change. So it's driven by user behavior also. Okay. All right. So I want to go a little bit into what is described in this paper, right? And if you want to learn more about it, you can go read it. But the general approach to doing this is you feed a huge amount of text into your computer, right? So maybe we have, you know, 1,000 books written in English and 1,000 books written in Arabic that have all been digitized and we put these into our computer. Or for instance, you can go and download— there's a file online that anyone can grab that has the first 1 billion words on Wikipedia. And this includes many languages. Of course, this would still be a small dataset compared to what Google Translate is trained on. You can— I mean, they probably train it on the whole internet. Okay. But the next step is just within each language, so I'm not comparing the 2 languages yet, but within each language, I'm going to create a map of where each word lives. And really what I'm going to do is assign a vector or a position in some high-dimensional space to each word. And this is a very simplified view where a model like this was applied and they projected this high-dimensional space down onto just 2 dimensions, and they're showing in English and in Spanish the words for the numbers 1, 2, 3, 4, and 5. And you can see that the figures look quite similar. And even if you can't read, maybe from the back, what the words are, you can tell which ones correspond to which ones in the 2 languages. So by creating a map— there's— so nothing has been done here to make correspondences between the 2 languages. All that's been done is to create a map of the words within their own language. But what you find is that words appear at similar places in the map, right, for different languages. Words with the same meaning appear at similar places. Okay, the next part then is you have someone or some database that knows some of the words and their translations. Okay? So maybe you have a dictionary of the 1,000 or 10,000 most common words English and Spanish, right? And so you determine a map between the languages based on that. And then this is the prediction part of the model, right? The point of a model is to predict. You apply the same map to the words whose translation you don't know, right? So for instance, that map— if I applied the same map that took me from 4 here to cuatro, which is 4 in Spanish, it would take me from 5 here to this point. And it's not exactly where 5 lives in the Spanish map, but it's close enough that I can tell that's the closest word, right? And I could guess correctly that that's the translation. Okay. The translation of 2 goes to here, which is a little bit further from the Spanish translation dos, but it's still close enough that I could guess that that's the right word, right? Okay. So this is a very simplified view. In reality, these word vectors would be much higher dimensional, right? Not just 2-dimensional. Excuse me. But this is an actual figure produced by the algorithm in that paper that I mentioned, and this figure appears in their paper. Okay, so how do you make these maps of relations among words? Well, you use some math. Right? So each word is a vector, like I've said, and the idea is that words are closely related if the angle between the 2 vectors is small. So I don't care how long the vector is, because actually the length of the vector, as I'll describe in a moment, just has to do with how many times the word appears, how common it is. But I don't want to just always pick the most common words as translations. So I can take the inner product, the dot product of 2 vectors, right? That's equal to the product of their lengths multiplied by the cosine of the angle between them, right? So if they're parallel or close to parallel, like here I've just— this isn't a real figure. This is just me drawing something to illustrate, right? So camel and horse maybe might have quite similar vectors that have the, you know, almost the same angle, right? So this theta angle between them would be quite small and the cosine would be close to 1. Whereas penguins, say, right, which is a very different kind of animal, would have a large angle, right? And this cosine would be closer to 0, right? If you have 2 orthogonal perpendicular vectors, then this will be 0. This is called cosine similarity. And what's actually used in practice is the inner product of the 2 vectors divided by the product of their norms, which of course, if you do the math, that just gives you the cosine function. Cosine of this angle. But how do we assign these vectors, right? That's really the heart of it all. There are several ways to do it. They all are based on, or almost all of them are based on, taking many words near where a given word appears in the, in the text that you have, right? And then basically associating it closely to words that often appear near it. And really, so the skip-gram model in particular, it— the idea is that you remove one of the words from a sentence or from a phrase, and you try to design the model, choose the vectors so that the, the model will, will predict the right word to fill in the blank there, right? So maybe some words that could possibly fill in the blank are here, right? And obviously It's much more likely that design would fit here than, say, orange, right? So design, then its vector would, would be more closely associated with these other words that appear near it, right? Obviously, I'm glossing over quite a bit here, and these algorithms are more involved, but they're— I should say they're nothing that you can't understand if you know If you have a good understanding of linear algebra and trigonometry. That's really all there is to it. There's some levels of complexity built up, but there's no more, I would say, sophisticated mathematics, right? And the way people come up with new models in this area, as far as I can tell, is still really intuition, right? It's not extremely sophisticated mathematics, but if you understand the basic mathematics, then you can understand these models. Okay, so just to give a little bit more of the sort of somewhat more sophisticated mathematics that comes into play. So there's some Bayesian statistics that underlies this model. So this— so wi and wj are the, the words wi would be maybe some word that I think will fill in here, and wj will be one of the other words in the sentence. And this notation means the probability of word i appearing here given that word j appears here, right? If I didn't know anything about the words out here, then I would just have to choose randomly. But now I have some conditional probability, right? And Bayesian statistics tells us how those things are related. And this model is based on this kind of expectation for that probability, where here these are inner products, right? This is the transpose. And u and v are what are called input and output vectors. So one of them corresponds to the probability of a word being here in the blank part, and the other one corresponds to a word being here in the part that I have kept. Okay, and then finally, once you have all these word vectors, you have to decide how to make a correspondence between the 2 maps. And it's not as simple as I've shown here. Really, to get this image, they had to project down, they had to do some rotating and scaling, right? So what they found is that there's really some linear transformation between the, the map of words in one language and the map in the other. Right? So maybe my map in Spanish is, you know, upside down compared to my map in English, right? I need to figure that out, right? It's just the relative positions of the words that are the same. So what I do is I try to find some matrix W such that when I apply W to any word vector over here, it takes me close to the word— the appropriate word vector over here. And this I do using my dictionary, right? The words whose translations I actually know. Already. And what's done is to try to minimize the sum of least squares, all right, of the residuals. Okay, and there's an interesting website that somebody built using this model. So this is just the output of a model based on the algorithm that I've just described. described, but you can add and subtract these vectors from each other, right? So what they found is, for instance, that if you ask what is something like a king, right, but it's not a man, instead it's a woman, right? Well, what would that be?
A queen.
A queen, right? So what I'm doing here is taking the word vector for king, subtracting the word vector for man, and And adding the word vector for woman. Okay, so in the paper where they trained this model on more data than I think was used in this website, it actually comes up with queen. Oh, and I can show that later. Okay, here you can see what happens. I think this website was not trained with enough data, so it's trying to guess and it comes up with at least something that is a woman, daughter, but not the correct answer. So, and this brings up a really good point, the power of these models relies critically on having enough data to put into them. If you don't, then your model will be useless. Because again, you don't have a deep understanding of what's going on here. You're just using the computer to analyze lots of data. But I— so I played around a little bit with things in the Middle East here. So if we ask what is like Abu Dhabi, but it's not in the UAE, Instead, it's in Saudi Arabia, right? So Abu Dhabi is the capital of the UAE. So what would be the sort of right answer here? Riyadh, of course, right? Okay. So, okay. So for some reason, it still wants to talk about the UAE, but it at least gets Riyadh as its second guess. And just for fun, I asked it, what is the Dubai of Saudi Arabia? Okay, maybe not a good question to ask, but any guesses before it comes back? That's what I thought. So, yeah, okay, it really likes the UAE as an answer, but the second answer is Jeddah. Okay, so I think there's something to this. All right, so there's that website. Again, I think that website really surprisingly didn't use enough data. But oh yeah, so you can train— you can get this model yourself. So there's a link to the code for it in the paper that I showed you, and someone has even built a Python interface to it. Python bindings. How many of you have programmed in Python here? Ah, so, okay, so Python is not so widely used in the college. I was hoping this would be the good thing. How many people have programmed in C or C++? Okay, so, so there is a C— C or C++, I think C++ library of this also. I find Python to be extremely intuitive. So this model, the Python version of it, is in this Oh, let me make the text bigger. This Python module gensim and this word2vec contains the algorithm of this skip-gram technique that I showed you. And what I've done here is just loaded a 100-megabyte file of English text. It's from Google Books, I think, right? And then I ran this model on it, and this size equals 200 means that I kept 100 words before and 100 words after the blink. So much more information than what I showed you in the slide. And then I can ask it, yeah, the question that the website failed on. So I can ask it, what is a word that is like woman and like king but not like man? Right, so this is what we said the answer should be, queen. And indeed, this one that's been trained on more data, even though I ran it on my laptop, comes up with the correct answer. And it's telling me something here about how confident it is that answer. And you can ask it other things like, which of the following words doesn't fit? And I already gave away the answer there, but I gave it university, college, school, and city, right? Okay, which one doesn't fit? City, right? The others are places of learning. Yeah, and it correctly gets that. And all it's doing is looking at the cosine similarity between these words and finding the one that points in, you know, the most different direction from all the others. And then you can just give it a word and say, what are the most similar— that, you know, the 10 most similar words that you know that are like mathematics? So it came up with mathematical, physics, astronomy, analytic, philosophy, interestingly. Okay, I think these are pretty reasonable answers. We could give it computation here if we wanted to. Okay, and it comes back with computability, automata, algorithmic, computational, numerical, right? I think it's quite interesting. Okay, so you— but what I wanted to show you here is that without much work, because actually I don't know very much about these models, this isn't my research, and I had fun looking into this and order to prepare this talk. But it took me only a few minutes of work to download the model, run it on some data, and try out some of these examples. And you can easily do the same. Okay. Any questions before we move on to principle-based models? Okay. By the way, I don't know— I didn't notice what time we started. When do I need to finish by? Okay. Thank you. Okay, so principle-based models. So most models in physics, chemistry, biology, what we think of as the hard sciences, are these kinds of models, right? They're based usually on what we call differential equations. So I was talking to some of the students in the college here, so I know that you take 2 years of calculus. And calculus describes how functions and their derivatives or integrals are related to each other. And a differential equation is just a relationship between a function and some of its derivatives. And it turns out that these, these things that we call differential equations are, I would say, our primary tool of understanding the physical world through mathematical models. And here are just some of the applications. Okay, I won't bother reading them all. I mean, these are just some randomly selected ones off the top of my head. Almost anything you can think of, it has been modeled with differential equations. And I will show several examples now. So for instance, the way an airplane flies. This is an extremely simplified model of an airplane. I'm not looking— I'm not modeling how the air flows over the wings of the airplane. All I'm doing is saying I have an airplane moving at some velocity and at some angle theta to the horizontal, and there are— there's a gravitational force on it, there's a lift force pushing it up that comes from the wings, but I'm not going to go into the details of that, and there's a drag force from the friction of the air. There's actually an error in this diagram. I found this on the internet, and then I thought I will leave this diagram there. as a lesson that we shouldn't believe everything we find on the internet, right? So if this is the angle theta, then it's the same as this angle between these 2 vectors, right? And actually, this vector should be what? Not proportional to the sine of theta, but the cosine.
Cosine theta.
This vector should be mg cosine theta, and And this one should be mg sine theta. And then, okay, so if x is the position of the airplane in the horizontal and y is its position in the vertical, right, then the, the rate at which its horizontal position is changing depends on its velocity multiplied by the cosine of theta, right? This is basic calculus. And its vertical position is v times— the rate of change of its vertical position is its velocity times the sine of theta. And then Newton's laws give us these 2 equations for how the velocity and the angle change in time, right? So this is the gravitational force, but the component of it should be this vector that's pushing the airplane backwards, right, slowing it down. And this is drag, and r is my drag coefficient. And I've assumed that the drag is just proportional to the square of velocity, which is a commonly used simple model for For friction. Okay, and then there's a similar equation for the rate of change of the angle where we have the gravitational force and the lift here. And what I've left out, of course, is any force from the engine's motors, right? So this is actually a model for a glider, right, that's just launched with some initial velocity and then has to float using its wings after that, right? Or we can think of, for instance, a paper airplane. So someone took this and— oh yeah, let me just say, so if we want to— if I want to solve this model, so say you tell me, okay, I've got an airplane, it's going to, you know, start with this velocity and this angle, where will it land or what will happen to it? Right, then I could apply this model to make a prediction, but I need to solve these 4 differential equations.
Right.
And okay, now this is the area that I work in. Right, so developing computer methods for solving differential equations, and it's a very important— well, of course I think it's a very important area of research, but there are many people in the world who work on this and lots of applications. And in general, we can write a system of differential equations in this way, where v now is maybe some vector. So maybe all 4 equations I've combined into just one artificially here. And And f is some arbitrary function that depends on those variables v. And a very simple way to integrate this equation, right, what does this tell me? This tells me that the slope of the function v is given by this function f.
Right.
So what I can do, if I'm given some solution v at time n, then I can just take a step using the slope of the solution. Right, so I'm going to step forward some finite amount of time that I've called delta t here, but I'm going to do it in the direction of the slope, and then I'm going to— I'll use that as my new solution, and then I'll evaluate the slope again.
Right.
So for example, here's the maybe the simplest differential equation, right? The rate of change of v is equal to v. The solution of this is just the exponential function, right? Because its derivative is itself. Right, e to the— e to the t here, right? And so the trajectory would be something like this. This is the correct solution. And if I start at this point and I take a step using this, then I'll step along the tangent line to this curve, right? So I'll end up at not quite the right place, but close. And then if I take another step, now I step on the tangent line of another curve that passes through this point. And I end up a little further away from the true solution, and so on. And you can see the errors build up over time. And if I want to get smaller errors, there are various things I can do. I can take smaller steps, then I have to take more steps, so I have to— I need a, you know, more computational power. Or I can use smarter algorithms. Okay, and I won't go into more detail about this except to say that, you know, there's a lot to be learned here. I'll just show you what you can do if you're able to solve these differential equations. Yeah, so Sage, this is an open-source free mathematical software that is built on Python, also the Python programming language, and you can put some code on the— in this language on the internet, and anyone can run it. So someone did this, and you can make it interactive. And I won't go through the details of this code. I just want to point out that what's being done here— I'll show you what it does in a moment. So here's R, that drag coefficient. Here's my initial value of y, right? And then this vector is all the right-hand parts of those differential equations. Okay, so what this code is doing is solving those differential equations, and then the rest of the code is really just about plotting it and making it interactive. Okay, and it's using a much more sophisticated algorithm than the one I showed on the previous slide for solving the differential equations. So it's using a Runge-Kutta method, if you know what that is. If not, don't worry. Okay, so Let me make this smaller now. Okay, so I hit evaluate on this code and what I see— okay, there's a slider here. I can choose my initial velocity and I can choose the initial angle of my airplane. And oh, by the way, they chose that value of the drag to model the flight of a paper airplane. So there's a lot of drag here, right? And it's interesting to just look at this model and see, you know, does it fit your intuition? How many of you have ever made a paper airplane?
I have.
And thrown it? Okay, good. I thought so. Me too, many times, right? So this is what happens. You'll notice the, the velocity here is all the way at the left end. So I'm using a very, very small velocity, and this is what happens if you just kind of, you know, barely let your airplane go. It will kind of fall, right? But it picks up speed. So then eventually it gets going fast enough to gain a little bit of height, but then eventually it goes back down, right? What happens if you throw a paper airplane really, really hard?
It—
Yeah, it will— right. It's not the way— it's not the best way to make it go really far, right? So let's try it. I move this slider all the way to the right. Okay, and yeah, have you seen it do this? So you throw it so hard that it does a loop, right? And actually here in the model, it does— it looks like 2 or 3 loops. Maybe more, right, before eventually going down. Okay, if you throw it really hard and you throw it downward, right, then— okay, so it will— yeah, in this model at least, it will still do some loops here and go down. Anyway, okay. I think this is a fun example of the kinds of things that can be described by differential equations. And actually, it's pretty realistic even though it's very, very simple, right? Of course, we have much, much more sophisticated models of flight also based on differential equations, and I'll come back to one of those later. Okay, so just to show you a slightly more complicated model, This model describes the flow of water, say, in the ocean. It says shallow water equations, but the— but that actually refers to the idea that the wavelength of the waves is long compared to the depth of the water, which is true for, for instance, tsunamis in the ocean. Here, so here h is the depth of the water and u is the velocity. And these subscripts t and x denote differentiation. So now instead of— because I have so many derivatives that appear here, we get lazy and just use subscripts. So this is the rate of change of the depth with respect to time. And what this equation actually says, it simply says that the total amount of water is conserved. And this one says that the momentum of the water is conserved. Now, these equations are used, like I mentioned already, for instance, to model tsunamis. So this is an image from a computation modeling the 2004 Indian Ocean tsunami, which— and the red are waves above the normal height of the ocean, and the blue are waves below the normal height of the ocean. And you can see the tsunami wave out in the deep ocean is hundreds of kilometers long. Right? They're really big. And you can see some regions here along the coast of India and Sri Lanka and Malaysia where there are large waves. And in fact, there were. And they use these models, in fact, to predict. So they have buoys out in the ocean detecting when there's some disturbance, right? Usually due to an earthquake. And they take that data and run computer models. And And of course they have to run them faster than real time, right? Much faster, because you want to know where the tsunami is going to hit hard before it happens. And you don't want to— they're still quite conservative about this, and they usually evacuate people even when it's not necessary. But of course we'd like to know with much better accuracy when it's necessary to evacuate people and where to evacuate them from. And these models are what we can use to do it. But it's necessary to come up with very, very efficient algorithms because you want to run these models in a matter of minutes, right? Because in a matter of hours, it will be too late. And that's where the kind of work that I do comes into play. Okay, I mentioned earlier that I wasn't modeling the flow of the air over the wing of an airplane, but of course I could. And this involves other mathematical models also based on partial differential equations. I won't show you the equations here. I just will show you the kind of thing that you can learn from them. So, okay, this is a common thing that we do in, in computation. I want to study a shockwave hitting a spherical bubble, and this bubble has lower density than the air around it. Maybe it's a, it's a small Smoke bubble, right? And so because there's symmetry in this problem, I reduce it to a 2-dimensional problem. Okay, so you should think of this rectangle here being rotated out of the plane of the screen towards you and then back around, around as if this were the axis of a cylinder, right? So if you do that, then this half circle becomes a sphere, right? And that's what you're looking at. So So this is really a shockwave, which is here. It's going to move to the right and hit this smoke bubble, and we'll see what happens. So the material in the smoke bubble gets picked up and carried along and rolled into, you know, what looks like a little ball here, but if you rotate this around, right, then you get like a doughnut, a torus.
Right.
Okay, and this is called a smoke ring or a vortex ring, and you can see these things in real life. Here's just a video showing a demonstration of this kind of thing, right? So they've put, I think, nitrogen from dry ice in these buckets, and you can see when they, you know, hit it with a shockwave, which is what they're doing, right, it creates one of these smoke rings. So, and you can easily actually set up your own experiment like this. Okay, it's just a nice demonstration of fluid dynamics, and it's captured by the kind of models that we can develop and compute with. Okay, now I thought I would show an example of an airplane wing, but then I thought airplane wings are You know, too commonplace today. Here's something that maybe you haven't heard of or seen, and that's snakes that fly. Okay? So there's a particular species of snake, and they actually do this. They jump off high branches of trees in the jungle, and they're able to travel very long distances in the air using their body as a wing. The snake's body is shaped like an airplane wing. Okay, so can we model this? So this is not my own work. This is work by Anush Krishnan and Lorena Barba at Boston University. And so this is their computational mesh. Here is the— this is just a very simple model of the snake's flight. So they want to do 3 dimensions, but they're starting with 2 dimensions. So this is just a cross-section, like if you cut through the middle of the snake. This is what its body is shaped like. And you can see it looks very much like an airplane wing, if you know what airplane wings are shaped like. And now they're modeling the flow of air past it. So instead of seeing the snake move through the air, we're just staying with the snake and watching the air flow past it. So the snake is flying to the left.
Right.
And what you're seeing visualized here is the vorticity of the, of the air. Right. So it's It shows you how much it's swirling. So the blue is when it's swirling one direction, the red is when it's swirling the other direction. And what's changing between these simulations is what's called the Reynolds number. So this has to do with how fast the snake is moving through the air. Higher Reynolds number means it's moving faster. And this angle of attack, right? Now, they're not saying that the snake is attacking something. This is just the term for tilting an airplane wing to the horizontal.
Right.
And they found that when you angle it at about 35 to 40 degrees and you move fast enough, that you get suddenly— so you can see the behavior in this one is much more violent than in the previous ones. And this corresponds actually to the snake getting more lift. So they think this is more or less the kind of velocity and angle that snakes use to fly through the air. And again, what they're doing here is solving a system of partial differential equations. So these equations are called the Navier-Stokes equations. And you can get their paper, again it's on this archive server. Yeah, okay, so you can read about it. And okay, you'll need— well, yeah. You probably need more than just calculus. To understand this, you would want to at least have a course in differential equations to have some understanding of what's going on here. But even without that, if you wanted to, you can go and get the, the software that they developed to solve this, the computational methods, and download them yourself. Okay, and I won't wait for it to load. But anyway, I just want to point out that all of this stuff is out there for free in the open. You can, you can learn about anything you want. It's really an amazing, amazing thing. But you need to understand the mathematics. And if you want to do something with their code, you need to know how to program. You need to understand computation. Okay. So, again, I'm not going to go into any of my own research. Oh, I do want to mention the simulation that I showed of the smoke ring. That was performed with software that was written by Amal Al-Ghamdi, who was a graduate of KAU, who was a master's student with me. And we wrote 2 papers based on the work that she did. She had an extremely productive career as a student at KAUST. And it's really— it's been my pleasure actually to work with many Excellent students here from KAU. I've been very impressed, and I hope that we will get a lot more of you at KAUST in the future. I know, of course, now we have to compete with your own PhD programs here, but I hope that some of you will come in and study with us also. So the message that I want you to take away today and remember is that mathematics and computation are really languages that you have to understand If you want to understand the world in the way that mankind understands it today, and I think they will be— they are and will be the languages that enable technology and increased understanding in the future. Okay, and being fluent in these gives you access to a world that you otherwise wouldn't be able to access. That is interesting. Also, I hope I've shown fun and very important. So thank you. I don't know if we still have time for questions. Okay, thank you very much. Yeah, we'll open the floor for a few questions if you have any questions. We have— okay, thank you for your time. I want to ask you, are the modeling functions used parallel programming?
Sorry?
Are the modeling functions used parallel programming? Yes. So this one, I don't know whether it was run in parallel, but this simulation that I showed you, yeah, is the result of a parallel computation. And in fact, The thesis work of Amal Al-Ghamdi, who I mentioned, who came— who studied here at KU, her work was to take a serial code that we had that many people used and make it work in parallel. And actually, she made it work so well that it scales almost perfectly on the Shaheen supercomputer at KAUST. So you can run it on one processor on your desktop, and you can go run it on 65,000 processors on Shaheen using exactly the same program. You just change one command. But parallel computing is extremely important to solving these models. Of course, Google Translate, right? They have to process many billions, maybe trillions, I don't know, of bytes of data to develop those models. And they use a huge amount of parallel computing power to do so.
Thank you. شطر الطالبات في أحد عنده سؤال من عندكم؟ We are having problems sometimes with the modeling which is based only on statistical and mathematical model. Basically, as we have seen with the king-queen example, it reflects that there is some kind of percentage, error percentage, that we need to model. And basically, the way that we've done or we were able to handle this based on feeding the model with some kind of linguistic and cognitive input. My question here is, would it be interesting also to see if it's possible to see some learning equations that make examples possible?
Yeah, you mean incorporating more data from experts, say, into the model? Is that what you mean? Yeah.
That's one part. The other part is that I would like to see if you have got any learning equations in the algorithm.
Okay, so first I should say I'm sure that, or I would guess that you know much more about this problem than I do because As I said, I work purely in what I would say the principle-based models, and I just felt that if I was giving a general talk like this, I had to include the data-based models. So I had to learn something more than I did about them, and this was one that I picked. But I'm not an expert here. In the— I think that in the paper on arXiv that I linked to, they do actually Combine their model, this skip-gram model and another one, with other ways of learning, which I think are like what you're describing. But I don't want to say too much about it because I'm not an expert. But I would be very interested to discuss it with you. Really, I think, okay, if I had another lifetime, maybe I would Learn natural language processing, but you know I haven't been able to become an expert in it at all.
Thank you very much.
Thank you.
Thank you.
Thank you. Any other question from here? Anyone? Any question? Okay, شطر الطالبات. هل في سؤال تاني؟ Sister. شطر الطالبات قسم الرياضيات عندكم سؤال أو شطر الطالبات في الفصلية؟ أوكي، any any question from here؟ أوكي، thank you very much. We thank Doctor David Ketcheson for his time and his great presentation. We are very glad to meet you and hear from you today. Thank you very much.
More from David

HYDW08 | Prof. David Ketcheson | Solitary Water Waves Created by Variations in Bathymetry

Prof. David Ketcheson | Analysis and Modeling of Solitary Waves in Non-dispersive Models

Teaching Numerical Methods with IPython Notebooks 2 | SciPy 2014 | Aron Ahmadia, David Ketcheson

Teaching Numerical Methods with IPython Notebooks 1 | SciPy 2014 | Aron Ahmadia, David Ketcheson

Teaching Numerical Methods with IPython Notebooks 3 | SciPy 2014 | Aron Ahmadia, David Ketcheson

Practical Experience in Teaching Numerical Methods with IPython Notebooks|SciPy 2014|David Ketcheson

