 Good, fantastic. In this lecture, which I'm actually going to divide up into smaller lectures because quite a bit of work we need to get here, we're going to look at motion. Motion of a particle along a path. In healthcare, that might be the flow through an archery. It might be any kind of motion that you can imagine in science. We can work out. We can work out the velocity. We can work out acceleration. All sorts of issues. The forces involved with that talk, etc, etc. If we just know a little bit more about motion. Now we're going to introduce, first of all, all the libraries. It's all the ones that you are familiar with now from SMPI. I'm going to import all these functions from SMPI.physics.vectorLibrary. I'm going to import everything from ipython.core.display. I'm going to import the image function, always with the filter warnings, almost always with a future print function, just so that you can run a Python 3.x code in versions 2.x. So let's run that. Everything is loaded. I initialize pretty printing and I ignore filter warnings. As always with vectors, I've got to set a reference frame. I'm going to use an xy coordinate system. Therefore, I call it c. I can call it whatever I want and I attach this reference frame to the computer variable c. And I'm also introducing a mathematical symbol t. So it is no longer a computer variable t, but a mathematical symbol t. We've seen how that works. Now before we can look at motion, we have to look at arc length. Motion travels over path. And for you to work out anything relating to that motion, you've got to know what the length of that path is. So image is what I introduced here from ipython.core.display. So I can just use it. It takes one argument file name equals and then in quotation marks, the image file, the PNG file, which in this instance I'm referencing directly. So it's got to be stored in the same folder as this ipython notebook. There we go. So imagine this here is just a graph of a function. And if I go from one point to the other and I just use Pythagorean Theorem, I can say that this path here between those points is almost equal to this. And to do that, it's quite easy. Let me just introduce this new image here, delta s, which is here by the Pythagorean Theorem. The length of this is just the square root of delta x squared plus delta y squared. Simple Pythagorean Theorem. I can be very clever with my algebra. I can take out delta x all squared out as a common factor. So if I'm redistributing this in there, in there, I'm going to be back there. If I have two expressions multiplied by each other, the square root of all of those would be just multiplying the square root of these two individually. And the square root of delta x squared is this delta x. So that's on its own. And the square root of this. Now we know from before, we know that if I want to look at the actual length of s, that's almost going to be the sum of i equals 1 to n over many, many tiny little segments. And if I take the limit as n goes to infinity of this, I am left with the integral. So very easily, if I have a function f of x equals y, I can express arc length like this. That's very easy to do. But we're dealing with vectors and we do parameterize things. So we can't have y dx. We're going to have expressions in terms of dt of time. So it's not difficult to do. I'm going to show you it's written in various textbooks. It's written in 110 different ways. Don't get confused between these. I'm just going from time equals 0 to time equals n. And at time equals 0, I'll call a n time, the final time will call b. So I'm just going from point a to point b and divvying that up into various small little sections of time so that the time delta t going from one little time spot to the next would just be the n time minus the initial time divided by how many little of these little sections of time I have. So if I look at a tiny little segment arc segments, it's almost going to be the following. Very easy to see that it will be, as far as vectors are concerned, so I don't have f of x equals y, but I have r equals the x of t and the y of t. So I'm going to go from one little x at t i minus 1 till the next t, the difference of that square plus the difference of this square. I'm still stuck here with basically the Pythagorean theorem. Introducing this slope at certain point for parameterized function. Remember if I had a vector function r equals the x of t and the y of t, if I were to take the derivative, I take the derivative of each of those separately. In other words, I can write it like this. It's that delta x there over delta t, just as we've done before, but I'm making a tiny little one so that is the derivative just doing algebraic manipulation, taking this denominator to the other side. I'm left with this x of t and it's there. It can now be written as x prime of t at some spot times delta t and the same goes for y prime of t. So I can just replace these two with these two over here. In other words, my arc length is basically going to be this. I can take delta t squared out as a common factor, bring it out all together. Nothing sinister there. Taking the limit as n goes to infinity of all these segments and this is what I'm left with. So if we're really looking for arc length for vector-based expressions, it's going to be the definite integral going from a to b of this is basically velocity squared and velocity squared. Add them together again Pythagorean theorem dt. Very easy to expand this just to add the third. Dimension z of t there and usually this is one way that you'll see it written in the books not as a function of t but as a function of u, but u equals from t0 to u equals t. So this is the other way that you might see it. Sometimes also it's not written as the x of t, y of t and z of t or u written as the f prime of u, the g prime of u and the h prime of u all exactly the same thing. So don't worry too much there. What we're interested in if we take the derivative of s with respect to t. So it's distance divided by time which is a speed. Now velocity remember is actually speed which is a magnitude plus a direction but if I take its magnitude it is just speed. It is just speed so if I just showed you another way to rewrite this what I am basically doing let's run that yeah there we go it's the derivative of an integral so if you take the derivative of an antiderivative it cancels out so there we go that speed is just the square root of what we have there. So let's have a little bit of an example while you can pause and just really look at this it's really easy just to to to consider this. So we have this position vector in three space there's our x of t our y of t and our z of t and we go from a point time equals one to point time equals Euler's number. So let's introduce that as a vector we know how to do this now we've set our reference frame we've set t as a computer variable so we can just make as a mathematical variable we can make this computer variable which I chose to call R sub t and I'm just printing it to the screen there if I ran this you see beautifully 2t in the that unit direction unit vector direction natural log in that and t squared in that I can take the derivative of that very simply by calling the dot div function on this with respect to t in the c reference frame and there I have a 2 1 over t 2t you'll notice that being the first derivative of each of those components we've done this before now I'm going to go a slightly laborious route to do this just to show you that we're just going to do one of these so we need the first first derivative squared and the second derivative squared the third derivative squared and we're taking the square root of all of that of that which is called the integrand we're now going to take the antiderivative or the definite integral and going from a to b with respect to t so let's do that so I'm just divvying it up again so the two I'm just calling v of x so velocity in the x direction y direction z direction I'm taking it directly from there the two the 1 over t and the 2t there they are I'm squaring them and then my expression is going to be the addition of all of those squared and the integrand that thing that I'm going to integrate is the square root of that expression that I have there now now just to show you what that expression was instead of the integrand so if I wrote integrand there integrand there we go integrand through autocomplete remember that it's going to be the square root of all of that I don't want to show you that I just want to show you the expression and there's a reason why I'm going to do that the the reason is if I take the integrate now there's integrate up there it's one of the functions in senpai if I were to integrate this integrand now remember the integrand's the part with the square root on it it takes the following arguments first of all it takes what needs to be integrated the integrand which is what I had there and then comma then this with respect to going from here to there and this is how you do e to the just e you say exponent to the power one anything to the power one assist itself now if you were to run that I used this example specifically to show you python cannot do this integral it actually gets stuck if python gets stuck or senpai gets stuck very beautifully it just rewrites the integral for you and you see exactly there what it was the reason why I printed the expression to the screen for you here is just to show you or to remind you of the fact that you can simplify this sometimes if you simplify this plug it back in there then python or senpai can do the integral so let's just consider simplifying this I can first thing I can do is just get a common denominator which I've done there this is the way senpai would write it it'll take the denominator outside so there's my numerator there's my denominator so that's just a simplification of the inside and if you closely look at this part that can certainly be rewritten as the following this this I'm doing in my head I'm not asking senpai to do this although there are ways to do it and we'll get into that later I'm just showing the algebra that takes part that that's just happening in my head so that's 2t square plus one if I square that I'm left with that but remember I'm actually taking the square root of that so my integrand is going to be this the square root of this and the square root of something squared over that squared is just that over that that's all I'm left with and I'm going to call that my new integrand if I now integrate this new integrand which is just a simplification of what I had up there perhaps this time senpai can do that integrand and it can do that definite integral and the answer is just E squared very easy to do so don't get too involved with this this was just some algebra in my head just because senpai couldn't do this and this is just a long way I showed you just to show you you can sit back stop the video relax look over this just to see how how I constructed doing doing this but they certainly shorter pieces of code you can write to do that but at least you understand what happens now to get to speed the dstt how to get to that using using senpai in the next lecture I want to just calculate a position and velocity given acceleration first we had given position we took the first derivative to get velocity and we took its first derivative or the second derivative position we got acceleration but what if I give you acceleration you have to work your way back and you can well imagine when we worked worked our way from position to velocity and acceleration we took derivatives so again from acceleration back to velocity back to position that's obviously going to take the antiderivative or in the examples we're going to do obviously the definite integral looking forward to that