 So, good morning everyone and welcome to today's lecture. So, in the previous few classes we looked at a few problems in different coordinate systems. So, we derived the equations in the Cartesian coordinates, but very soon we found ourselves having to deal with a spherical bubble or a cylindrical jet of fluid in which case the ideal coordinate system was no longer the Cartesian coordinate system and we moved into cylindrical coordinates and spherical. And there when we had to use the gradient operator and the divergence, we realized that those operators don't have the same form as they do in the Cartesian. So, naturally the question will arise as to how one can derive these operators in a coordinate system of choice. More specifically a question was raised by one of y'all as to why the gradient operator for example in cylindrical coordinates has a certain form, but the divergence which is the gradient dotted with a vector has a entirely different form. So, what we will do in the first half of the classes is actually look at the theory underlying these curvilinear coordinate systems and how one can derive systematically all the operators, all the vectorial operators. The second half of the class we will continue with the previous lecture where we looked at perturbation theory and solve a simple problem which y'all have which y'all are quite comfortable with, but we will give a new spin to things. So, to start off to make it easier to understand I will work with a specific case of cylindrical coordinates and then we can generalize that later on. So, on one hand we have the Cartesian set of coordinates which we are familiar with. Of course here I am maintaining the right hand system of x cross y equal to z and on the other hand for specific example we have the cylindrical coordinates. So, on the x y plane I now have a radius r, this theta would actually be negative. So, I am measuring theta in the anticlockwise direction. So, actually I should not put it that way. So, the fundamental idea about having different coordinate systems is that there should be a one to one mapping between all the points in this space and all the points in that space and that is totally reasonable because the space is the same we are just choosing a different reference frame. So, what that means is if I have a point here whose coordinates are x, y and z they should get mapped to a unique point which will in fact be the same point in space but having a different representation as r theta z and this can be mapped back and forth. So, naturally the starting point is to understand what this mapping is or in other words if I have the x, y, z coordinates how do I get the r theta z and then things will follow from that. So, in the case of cylindrical coordinates that is quite straight forward. So, x is simply r cos theta, y is r sin theta and z of course remains as z. So, when we are working with a new coordinate system the first step is to always get the mapping. So, if you have a cylindrical jet and you envision this coordinate system the first thing to do is to get this mapping. There are some cases where you will want to instead of having a jet you may want to have a torus which means that you have a cylinder which also curves. So, in that coordinate system you can also proceed in the similar fashion but you will have to start with a different mapping. So, the even z will get mapped. Now, this is the mapping where I am able to write x as a function of r theta z and y as a function of r theta z and so on. So, z of course remains z. So, we just focus on x and y r theta because z is just identity map. Now, as I asserted if we can go forward we have to go backward. So, there will be the inverse mapping where I can write r in terms of x and y. So, usually we require that as well in the calculations. So, that we can write down and you all can work it out with me. So, here r should be just x square plus y square root and theta is of course tan inverse of y by x and of course z remains z. So, this you would be familiar with and there is no mystery there. Now, what this means in terms of representing vectors and the Navier-Stokes equations is what we look at. So, here we know how to represent any point. So, any scalar function defined here will easily get mapped to this reference frame because we know how to go from x, y, z coordinates to r theta z. Now, the next step is when you are dealing with vectors is apart from the magnitude of course you have a direction. So, the question is if I know the direction of a vector here, how do I represent that in the cylindrical coordinate system? Or in other words, if I have a vector pointing in the x direction for example, then here the vector is simply i cap. But if I look at it here, then that vector will be in some r and some theta direction or it will be a combination of the unit vectors in r and theta. So, that is why we need to understand how the unit vectors follow from when we make the coordinate system transition. So, of course in Cartesian, I will just draw it again. The unit vectors are straight forward. You have E x cap whose magnitude 1 of course in the x direction and y you have E y and z you have E z. When we come to the cylindrical coordinate system, you have one unit vector in this z direction same as before. The odd unit vector as you know is pointing in the radial direction. And theta is actually, so if I draw a kind of a circle here, theta will actually be tangential to that circle. So, at any point, the unit vectors at this point are radially outward, tangential to the circle, which is E theta and then z, E z vertically up. Now, the point here and the crucial reason why the operators change and have different forms is that as I move around in the Cartesian space, the unit vectors do not change. But the unit vectors in the cylindrical coordinate system actually keep changing as I move around. So, for example, if I am located at this point, then my E r vector is this guy here and E theta is this guy pointing perpendicular to E r. But when I move from here to here, you see that my direction of the unit vector E r has now changed. So, has the E theta vector. But in the same thing if I did here in Cartesian space, I would get Ex E y and it would still remain Ex E y, there is absolutely no change. Of course, it will displace the origin, but that is not what we are looking at. We are looking at the direction of the vectors and they remain the same, whereas here they change. So, the question is to understand how these unit vectors change with position and that is the first step and then we can look at deriving the gradient operator. So, to understand that, we need to be able to write down the vector say E r in terms of Ex E y and Ex E z, that is the main step. And we would like to do that because we know that these vectors do not change. So, if we can represent E r in terms of these then we can understand how it is changing. So, for that we need to have the basic idea that unit vectors are tangential to coordinate lines. And lines here in general could be a curve, just the nomenclature that has developed. So, what this means is that it tells us what exactly the E r vector is for example. So, the E r vector is in fact some unit vector that is tangential to the radial coordinate line. So, what I mean by a coordinate line? A coordinate line is a curve in space along which any two of the coordinates are constant. So, the radial coordinate line is the curve along which theta and z are constant or only r varies. So, that is quite clear because along this line which I am asserting to be the radial coordinate line, you see that only r will change whereas theta has a constant value and of course, z has a constant value. So, similarly you can find that the theta coordinate line is a line along which only theta changes which are simply the concentric circles in the plane of the board and z of course, are different planes. So, this kind of a picture you would have had intuitively in your mind. So, now we are just formalizing that as coordinate lines. I am sorry the z coordinate line is are not planes they are just the z direction that comes out. So, in XYZ the coordinate lines are simply the Cartesian axis themselves, but in the cylindrical frame it is slightly different. So, you have the radial line then of course, this tangent e theta along which only theta changes basically it is the circle and then you have just this z vector pointing out of the plane. So, mathematically we can use this form that we have to represent any coordinate line. Similarly at the radial coordinate line it can be represented as x is of course, I will leave it in the general form some function of r because you know r is changing. However, theta has a constant right and z is a constant. Similarly the y coordinate along the radial coordinate line will be given by this where again you have to put theta a constant and z a constant and the same is true for z. So, what this tells me is that if I want to find one of my radial coordinate lines all I have to do is come to this mapping give some constant value for theta may be 45 or in terms of radians pi by 2 or pi by 4 and then z you give some value may be 3 and now you just vary r and it will trace out the coordinate curve. In this case it is the trivial radial line, but in a more complicated system if you cannot figure it out visually you can always do this and understand what exactly the coordinate line is. So, you can figure the same thing out for theta and z. So, having established that the next question is we are coming back to is what is the unit vector. So, a real inspection will tell us that the unit vectors as I have said here I have already written that down. The unit vectors are tangential to the coordinate lines. So, that means that all we have to do to find out the unit vector er is to find a tangent a unit tangent to the radial coordinate line. Now the reason why I have written it in this form is that this gives us a particularly easy way to find the tangent. So, if you look a little closely at this figure I mean at these 3 equations what you will realize is that it is nothing, but an explicit representation of a curve which means that I have given you the x the y and the z coordinates in terms of 1 parameter in which case this is r and we know from basic theory of calculus that I can find the tangent which I will call t to the surface which is given by this explicit relationship by simply taking the derivative. So, what we are doing here is the x, y and z coordinates are changing only with the variable r and if you want to find the tangent all you need to do is take the small infinitesimal distance that gets propagated as I change r by a small value and that will naturally lead to the different components of my tangent vector. So, that is quite straight forward to do because we remember we know what x hat is what the y mapping is what the z mapping is. So, all we need to do is just take this derivative and we will get t and now er is simply t by its modulus or its absolute value so I can get a unit vector. So, proceeding in the same way we can find out e theta and easy and that would be quite easy pun intended. So, what we will do is apply this formula to calculate er and e theta and then take the next step. Alright, so let us work out er so the first is just the derivative of x with respect to r a policy I should have put partial derivatives is in general they are functions of any of r theta and z alright so er dx by dr so that is simply cos theta so this is cos theta e x plus sin theta e y and of course because the derivative of z with r is 0 so that means that my er unit vector lies only in the xy plane which is consistent of course. Now e theta and this is possibly the unit vector which was the least obvious when you first encounter the polar plane so now we can calculate that even if we could not intuit it. So, now we have to take the derivative with theta so you will get am I done here no so I need to divide by the magnitude so I will do that and but that is simply r so essentially what happens is that the r's cancel out so I will just get minus sin theta x and easy is of course easy right so here we have our 3 unit vectors er e theta easy in terms of the unit vectors in the Cartesian reference frame so that is the crucial point of proceeding with any coordinate transformation so now we can go to the next step which is to try and relate it the other way round which means can I get e x e y easy in terms of er e theta so that is not too difficult because what we have here is a system of 3 linear equations right with 3 unknowns so all I have to do is invert it and I will get e x e y and easy in other words what I have done here is saying something like y is equal to a x where y is the 3 cylindrical unit vectors and x vector is simply the Cartesian vectors so I just have to say that x is a inverse y where this a will have this cos theta sin theta and the other terms so you can work that out but since this is relatively simple we can write down a solution by inspection which is what I will do now so maybe I will give you all a minute to tell me what e x is in terms of er and e theta sorry so you are saying sin theta er plus cos theta I mean agreement so you can of course check here I do not think this is going to work out just double check that so according to me right so of course I will do the easy part first which is to say ez is ez so of course let us look at it again what I what I know for sure is that the left hand side right hand side should be er so naturally e x has should have a cos theta term so I can retain the er guy so if I put cos theta here I think that works out right so if I substitute e x here I will get cos square theta er and here e y will give me sin square theta er so er remains and you will find that the other terms cancel off fine so now we have represented back and forth just as we had the forward and backward mapping for the points we now have that mapping for the unit vectors as well and that puts us in a good position because we can now calculate how the vectors er e theta easy change as we move around space in the cylindrical coordinate system so let us look at the er vector so I will draw it here again for reference so we have er now here if I look at a point I have e theta here in the cylindrical coordinate system is that 0.1 0.2 so at 0.1 my vector er is here so our schematic shows us that as I move as I move along r for example and my vectors do not change so as I move along r er remains the same right and e theta also sort of remains the same because I will just have right so e theta and er and easy do not change with r however theta is a troublesome guy because as I move in theta you will find that my er vector has changed instead of pointing horizontally it is now pointing at some inclined angle so definitely the er has changed with theta e theta of course also has changed now instead of going vertically it is now going at some oblique angle so I know that schematically my unit vectors are going to change with theta so let us see if we can calculate that from what we have just derived let us look at the derivative with respect to r for starters of er or let us just make it more interesting and directly jump to theta so we are looking at the derivative of the unit vector er with theta and now it is extremely useful to use what we have derived here because I know that ex and ey do not change so I can substitute er as in using my relationship here into that derivative calculate the derivative and come back so let us put er this representation into the derivative and tell me what the derivative is in ex and ey but that we can see from here is nothing but e theta so now we have the neat result that the derivative of the er vector as I move in theta is simply e theta so you can do the same thing for e theta with respect to theta and tell me what you get minus er of course the unit vector in the z direction in this case does not change I will just write this over there because I may need it in the future so I will store that away okay and now we are in a position to begin our investigations into the vector operators so let us start with the gradient of a scalar so since we are going to be calculating gradients of pressure in this course I will just take p so we know that the gradient of pressure in the Cartesian coordinate system is simply doh p by doh x e x and the question is how do I relate this to its representation in the cylindrical coordinate system so the first idea that we need to have is a vector is a vector as a vector so what that means is that just like you have a point in physical space that point is not going to change regardless of how you are going to you know view the system whether cylindrical or Cartesian in the same way when you have a vector entity that is a entity that does not depend on how you look at it which means that whether I represented in Cartesian or whether I represented in cylindrical those forms have to mean the same thing in terms of magnitude and in terms of direction so what I am looking to do when I am translating to cylindrical is really find out how to write this guy in terms of r derivatives of r theta z in terms of the unit vectors e r e theta e z while maintaining its original structure and what it really is so that in this case will involve two things first of all I need to transform e x e y e z into the representation of e r e theta and e z and that I already have over there so we have covered that but then the problem is I have derivatives with x and I will want to represent p as a function of r and theta so I need to rewrite the derivatives in x as derivatives in r and derivatives in theta so once we do those two things and put them together we should get our gradient form in cylindrical coordinates so we will do that I will demonstrate it for x now so dp by dx can be written of course as dp by dr into dr by dx plus and for the sake of completeness so I have just applied the chain rule of multivariable calculus and now we know r is a function of x right here so we can substitute that derivative and proceed some of you all might be tempted to calculate dx by dr from this relationship and then inverted and put that in so you are welcome to try I have done it in the past and of course not met with success because you cannot actually do that what you need to do is actually write r out as a function of x and y which means that at this step I really need the inverse mapping and that can be a bit of a pain because generally you have x related to r and theta in most practical situations that is the easy mapping to get to invert it may not always be possible so this is something I will come to later but right now we are lucky enough to have the inversion so we can proceed so let us calculate dr by dx so I will do this one for you so then the 2s go off and this is nothing but r so I will just get minus x by r in the same way I can get the derivative of tan inverse m is 1 upon 1 plus m square right if you use derivative of tan inverse m is 1 upon 1 plus m square which I looked up yesterday and then of course if I look at y by x I will get y by x square the negative sign so this is just minus y by r square so you can plug that in and we will find out that is a derivative with respect to r alright now I do not really want to keep r hanging around so what I will do is use sorry I mean I would want x to be hanging around because I want to convert everything into r and theta so I will use x is r cos theta here so I will simply get minus cos theta right and here I will put y is r sin theta so I will get so now we can put that back in is that the minus why is that right sorry yeah yeah correct yeah yeah so it is just positive you are saying sorry yeah so similarly we can write out doh p by doh y in this case we will just focus on this I need doh p by doh theta here so doh p by doh y we can write out can someone tell me doh r by doh y? Doh p by doh r into sin theta doh p by doh theta into cos theta by r so now that we have found the derivatives in terms of r and theta what is left for us to do is to now plug it back into this formula so we have doh p by doh x so that I have here so let us put this entire term there and then use my ex formulation that I have over here and substitute everything together and let us see what we get further I mean the first doh p by doh x star into something funny yeah so where was I yeah I was doh p by doh theta and we just need to substitute that in there and I will get maybe I should just do this systematically has someone done this essentially we need to just substitute I mean just multiply doh p by doh x with ex that comes out there so what that will give me is doh p by doh r so cos theta with ex gives me cos square theta and then the second term will be doh p by doh r cos theta with minus sin theta e theta right and then doh p by doh theta I have minus sin theta by r I will get cos theta e r and then doh p by doh theta times minus sin theta by r so that sin square theta by r e theta right so that is fine so you can see here that I have these two terms sorry you know those two terms yeah we are fine here actually there is no problem so this is what we have for doh p by for this first get now we do the same thing over here right and proceed so it is this plus this is e r alright now we do the same thing here so just calculate doh p by doh y e y by substituting from there so you will see I will get doh p by doh r sin theta into sin theta e r correct so I will get doh p by doh r sin square theta e r right that comes from the first term sorry that comes from here right with e r then the second term gives me doh p by doh theta cos theta sin theta by r right that comes from the sorry that comes from the last term right so I have doh p by doh theta cos theta sin theta by r and then you can carry it out so since we are running short of time I will just show you the calculus works out so if I look at the e r terms that I have so far you will see these two guys which basically amount to right because cos square theta plus sin square theta becomes 1 then you will find that the troublesome term which was this guy because I mean this is not there you know in the final formula e r so that just cancels off with the guy here and if you continue for the next two terms you will find another cos square theta term that comes for this that is in fact here see if I multiply this with this I will get doh p by doh r cos square theta by r so that will combine with the sin square theta by r so I will get plus 1 by r doh p by doh theta alright so what we have done here is started with the gradient representation in the Cartesian coordinate system which was the one which you are familiar with then rewrote the derivatives in x, y and z in terms of derivatives and r and theta using the I mean using calculus and then because we had the representations of e x, e y, e z in terms of e r and eta we simply substitute that back in and ultimately what comes out is the form of the gradient in the cylindrical coordinate system so that you can do the same thing in spherical coordinates or any other coordinate system and you will be able to derive what the gradient acting on a scalar is so this is how we got the form for the gradient so now that we have this let us look at the divergence of a vector and see what is it exactly that is different over there. So now we move on to del dot v where v is a vector in general but we will be calculating it with a velocity or del dot n where n is the normal vector for the normal stress boundary condition so now that we have the gradient operator and the gradient operator by itself is in fact the same as gradient of p so this is just doh by doh r e r alright and this has to be dotted with v r e r plus v theta e theta plus v z also if you look back at the form for e r and e theta which you will have in your notes you will find that e r dot e r is equal to 1 whereas e r dot e theta is equal to 0 and so on. So even the r theta z coordinate system is also orthonormal just like x, y, z so that means that when we apply the dot product we only need to consider the e r dot e r terms e r e theta dot e theta terms so e r dot e theta will go to 0. So if you just look at it that may tell you that all I will get is doh by doh r v r plus 1 by doh by doh v theta doh by doh z v z which looks exactly like gradient p but we know that is wrong. So the difference that comes in here is that my e r e theta and e z vectors are not constant. They are also functions of r theta and z which means when I operate on them I do not only operate on the component I must also operate on the unit vector itself. So I will just take the term which makes a difference so we know that nothing changes with r basically. So when r acts on any of the unit vectors it causes no change. So there there is no mystery I will just get it straight forward. So this will come by operating taking the dot product of this with everything else because doh by doh r of e theta remains e theta and e theta dotted with e r will give me 0. Now let us come to the second term. So here I will get 1 by r let us look at this guy here doh v r by doh theta e theta dot e r right I am operating this on this. So first I go I am going to operate the derivative so here I will use the product rule. So I first differentiate v r and e r remains out here. The second guy of course will be where I differentiate e r now and v r comes out right 1 by doh by doh theta and this whole thing is dotted with e theta. Now here is the catch that the derivative of e r with e theta is not 0 it is in fact e theta right. So this term becomes v r by r e theta dot e theta and this is non-zero. So I have another term here so this guy gets added in and that is how you get doh v r by doh r sorry this is e r dot e r doh v r by doh r plus v r o r and this is that additional term that comes up from the divergence. Now if I move on you will find that I will have to operate the derivatives on the remaining coordinates and then I will just get the rest of it is the same of course nothing much happens in the z direction. So this is how we calculate the divergence and this is why you get some additional terms that crop up here purely because of the change of the unit vector e r in this case with theta. Now the nice thing is that if you proceed you will find the same thing happening when you go to the del square v. So another challenge is to calculate the laplacian of the velocity vector which is a vector and this is what comes in all the viscous terms. So you will find in cylindrical coordinates that the viscous terms also have a slightly different form. So what we need to do here is realize that del square is some simply the dot product of 2 gradient operators del dot del and then act this del square once we calculated on v. But here there is again the same complication that when I this del square will involve some derivatives basically dou square by dou r square and so on. So you will have to operate not only on v r but also on e r. So when I have the 1 by r square dou square by dou theta square term right this has to act on v r e r plus v theta e theta. So I do not only get the second derivative of v r I should also take the second derivative of e r and see what I get. So this term will give me some components along e theta and so on which is why you get these additional terms in even the viscous part of the equation. So you can possibly look at doing that yourself and comparing it with the cylindrical coordinate equations in any book and that should give you confidence about you know working through these calculations. So what I have shown you here today is a sort of I mean mechanistic approach based on the rudimentaries of calculus and what the vectors really mean. So that gives a nice understanding of the problem but there is a much more elegant treatment in the book by Newell I think it is vector analysis so dover publication so you can get it quite easily and what he does is he derives a series of formulas which can very easily be implemented on a computer for example. So with Mathematica I can actually get all the equations in any desired coordinate system by using those formulas and the basis of the formulas also quite nice and very powerful application of the Einstein notation so that allows you to easily generalize what we have done here for cylindrical coordinates. So I suggest that you work out the Laplacian and for these derivative calculations you can try to use Mathematica that will make things easier and if you are feeling particularly adventurous you can do the same thing for spherical coordinates.