Vector and Index Notation

Motivation

  • All Engineering tasks are three-dimensional problems.
  • Often we try to simplify the problem by neglecting some component of the system, or exploiting a symmetry to reduce its dimensionality.
  • For example, for the flow of a fluid between two plates (top-right), we ignore the direction into the plane (the problem is now 2D), then we assume the flow doesn't change in the $x$-direction (now a 1D problem).
  • For problems with an axis of symmetry, such as annular flow (bottom-right) we can often ignore the rotational component ($\theta$) and axial component ($z$).

Motivation

  • However, we must start from a 3D description, as some problems are fully three-dimensional and need to be treated using a general approach.
  • In this course, all systems reduce to one dimension, but the basics of later 3D problems are being taught which can be solved using CFD (see later courses).
  • We need to be fluent in the language/notation of three dimensional problems.
  • The natural mathematical language for describing three dimensional problems is that of Matrices and Vectors.

Representations

  • You should be familiar by now with vector notation.
  • A position vector, $\boldsymbol{r}$, is the direction and distance to a point, relative to some origin .
  • A velocity vector, $\boldsymbol{v}$, is the direction and speed an object is travelling.
  • The common definition of all vectors is that it is an encoding of a direction and a magnitude!
  • You also need an origin for vectors to make sense, even for velocity.
  • Q: How fast are you moving sitting in your seat?
  • A: 0 mph relative to the seat, 1000 mph relative to the centre of the earth, 67 000 mph relative to the sun, 490 000 mph relative to our galaxy centre, $10^9$ mph relative to the cosmic background radiation.

Representations: Rectangular

  • There are many ways a vector can be represented…
  • For a position vector, we can write coordinates: \begin{align*} \boldsymbol{r} = \left[x,y,z\right] \end{align*}
  • This is the most trivial Cartesian or rectangular coordinate representation, but we could pick any number of other coordinate systems.
  • For example, on a sphere like the earth, we might use latitude, longitude, and altitude. \begin{align*} \boldsymbol{r}=\left[\text{lat},\,\text{lon},\,\text{alt}\right] \end{align*}
  • We don't usually use these as they're a bit archaic, but we do use radians and meters.

Representations: Spherical

  • This angular coordinate system is called spherical or polar coordinates and is useful for systems where there is a point symmetry . \begin{align*} \boldsymbol{r} = \left[r,\theta,\phi\right] \end{align*}
  • For example, this coordinate system is useful for understanding a burning spherical(ish) piece of coal, or a spherical(ish) solid falling in a liquid.
  • More about symmetry later in the course, but there is one more coordinate system to introduce…

Representations: Cylindrical

  • In cylindrical coordinates, we have a rotation $\theta$ about the axis $\boldsymbol{z}$: \begin{align*} \boldsymbol{r} &= \left[r, \theta, z\right] \end{align*}
  • This coordinate representation is the most useful for systems where we have a rotational symmetry, such as a pipe.
  • But regardless of the representation we use (Cartesian, cylindrical, spherical/polar), the same information of direction and magnitude is always encoded.
  • Spherical and cylindrical coordinates are collectively grouped together as curvelinear coordinate systems, and defining operations in these coordinate systems is problematic as they change depending on the coordinate system.

Representations: Cylindrical

  • If we don't want the basic operations to change1, the position vector may be defined as follows: \begin{align} \boldsymbol{r}=r_r\,\hat{\boldsymbol{r}}+ r_\theta\,\hat{\boldsymbol{\theta}} + r_z\,\hat{\boldsymbol{z}} \end{align}
  • You should note that $r_\theta\neq\theta$, but instead is distance of the vector $\boldsymbol{r}$ projected along the unit vector $\hat{\boldsymbol{\theta}}$ illustrated in the diagram.
  • It is not particularly convenient to work with this coordinate frame as $\hat{\boldsymbol{\theta}}$ and $\hat{\boldsymbol{r}}$ ALSO depend on your coordinates, so we derive everything in rectangular coordinates (which are easy) and use look-up tables for other coordinate systems.
1 Dimensional Analysis: To prove that basic operations MUST change, consider the units of each term of $\boldsymbol{r}\cdot\boldsymbol{r}=r_r^2+r_\theta^2+r_z^2$. Units of terms that are added together must have the same units but they are inconsistent if ${r}_r=r$ (length), ${r}_\theta=\theta$ (angle), and $r_z=z$ (length), thus the usual definition of the dot product does not apply when $\boldsymbol{r}$ is represented as $\left[r,\,\theta,\,z\right]$.

Humerous(?) interlude

A mathmatician, a physicist, and an engineer were each given the same red rubber ball and told to find the volume.

  • The mathmatician carefully measured the diameter and evaluated a triple integral.
  • The physicist filled a beaker with water, put the ball in the water, and measured the total displacement.
  • The engineer looked up the model and serial numbers in his red-rubber-ball table.
Cartesian/Rectangular coordinates (from the exam datasheet)
where $s$ is a scalar, $\bm{v}$ is a vector, and $\bm{\tau}$ is a tensor. \begin{align*} \nabla s = \nabla_i s &= \left[\frac{\partial\,s}{\partial x},\, \frac{\partial\,s}{\partial y},\, \frac{\partial\,s}{\partial z}\right] \\ \nabla^2 s = \nabla_i\nabla_i s &=\frac{\partial^2\,s}{\partial x^2} + \frac{\partial^2\,s}{\partial y^2}+ \frac{\partial^2\,s}{\partial z^2} \\ \nabla\cdot\bm{v} =\nabla_i v_i &= \frac{\partial\,v_x}{\partial x} + \frac{\partial\,v_y}{\partial y}+ \frac{\partial\,v_z}{\partial z} \\ \nabla \cdot \bm{\tau} &= \nabla_i\, \tau_{ij} \\ \left[\nabla \cdot \bm{\tau}\right]_x &= \frac{\partial\,\tau_{xx}}{\partial x} + \frac{\partial\, \tau_{yx}}{\partial y} + \frac{\partial\, \tau_{zx}}{\partial z} \\ \left[\nabla \cdot \bm{\tau}\right]_y &= \frac{\partial\,\tau_{xy}}{\partial x} + \frac{\partial\, \tau_{yy}}{\partial y} + \frac{\partial\, \tau_{zy}}{\partial z} \\ \left[\nabla \cdot \bm{\tau}\right]_z &= \frac{\partial\,\tau_{xz}}{\partial x} + \frac{\partial\, \tau_{yz}}{\partial y} + \frac{\partial\, \tau_{zz}}{\partial z} \\ \bm{v}\cdot \nabla \bm{v} &= v_i\,\nabla_i\,v_j \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_x &= v_x\frac{\partial\,v_x}{\partial x} + v_y\frac{\partial\,v_x}{\partial y} +v_z\frac{\partial\,v_x}{\partial z} \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_y &= v_x\frac{\partial\,v_y}{\partial x} + v_y\frac{\partial\,v_y}{\partial y} +v_z\frac{\partial\,v_y}{\partial z} \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_z &= v_x\frac{\partial\,v_z}{\partial x} + v_y\frac{\partial\,v_z}{\partial y} +v_z\frac{\partial\,v_z}{\partial z} \end{align*}
Cylindrical coordinates (from the exam datasheet)
where $s$ is a scalar, $\bm{v}$ is a vector, and $\bm{\tau}$ is a tensor. All expressions involving $\bm{\tau}$ are for symmetrical $\bm{\tau}$ only. \begin{align*} \nabla s &= \left[\frac{\partial\,s}{\partial r},\, \frac{1}{r}\frac{\partial\,s}{\partial \theta},\, \frac{\partial\,s}{\partial z}\right] \\ \nabla^2 s &=\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial s}{\partial r}\right) + \frac{1}{r^2}\frac{\partial^2\,s}{\partial \theta^2}+ \frac{\partial^2\,s}{\partial z^2} \\ \nabla\cdot\bm{v} &= \frac{1}{r}\frac{\partial}{\partial r}\left(r\, v_r\right) + \frac{1}{r}\frac{\partial\,v_\theta}{\partial \theta}+ \frac{\partial\,v_z}{\partial z} \\ \left[\nabla \cdot \bm{\tau}\right]_r &= \frac{1}{r}\frac{\partial}{\partial r}\left(r\,\tau_{rr}\right) + \frac{1}{r}\frac{\partial\, \tau_{r\theta}}{\partial \theta} - \frac{1}{r} \tau_{\theta\theta} + \frac{\partial\, \tau_{rz}}{\partial z} \\ \left[\nabla \cdot \bm{\tau}\right]_\theta &= \frac{1}{r}\frac{\partial \tau_{\theta\theta}}{\partial \theta} + \frac{\partial\, \tau_{r\theta}}{\partial r} + \frac{2}{r} \tau_{r\theta} + \frac{\partial\, \tau_{\theta z}}{\partial z} \\ \left[\nabla \cdot \bm{\tau}\right]_z &= \frac{1}{r}\frac{\partial }{\partial r}\left(r\,\tau_{rz}\right) + \frac{1}{r}\frac{\partial \tau_{\theta z}}{\partial\theta} + \frac{\partial\, \tau_{z z}}{\partial z} \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_r &= v_r \frac{\partial v_r}{\partial r} + \frac{v_\theta}{r}\frac{\partial v_r}{\partial \theta} - \frac{v_\theta^2}{r}+v_z\frac{\partial v_r}{\partial z} \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_\theta &= v_r \frac{\partial v_\theta}{\partial r} + \frac{v_\theta}{r}\frac{\partial v_\theta}{\partial \theta} + \frac{v_r\,v_\theta}{r} + v_z \frac{\partial v_\theta}{\partial z} \\ \left[\bm{v}\cdot \nabla \bm{v}\right]_z &= v_r \frac{\partial v_z}{\partial r} + \frac{v_\theta}{r}\frac{\partial v_z}{\partial \theta}+v_z \frac{\partial v_z}{\partial z} \end{align*}

Check out the back of the questions booklet for the exam data sheet.

Operations

  • Hopefully the past two slides scared you enough that you're motivated to learn about vector operations and what they mean.
  • So lets define some vector operations/mathematics for them and discuss how they change in different coordinates.
  • We write the magnitude (or length) of a vector, $\boldsymbol{r}$, as $\left|\boldsymbol{r}\right|$.
  • In a rectangular coordinate system, we use a 3D version of Pythagoras' theorem1: \begin{align*} \boldsymbol{r} &= \left[x,y,z\right] & \left|\boldsymbol{r}\right| &= \sqrt{x^2+y^2+z^2} \end{align*}
  • In a cylindrical coordinate system Pythagoras' theorem gives: \begin{align*} \boldsymbol{r} &= \left[r, \theta, z\right] & \left|\boldsymbol{r}\right| &= \sqrt{r^2 + z^2} \end{align*}
  • In a spherical coordinate system, only one component has units of length and we have: \begin{align*} \boldsymbol{r} &= \left[r, \theta, \phi\right] & \left|\boldsymbol{r}\right| &= r \end{align*}
  • I don't want you to derive these, I'm just driving home that you need to be careful about your coordinate systems! We will rely on look-up tables to keep us straight2.
1 The proof is very elegant, just consider only two dimensions at first, then rotate so that the 2D diagonal is one of your triangle sides along with another, as-yet unconsidered, dimension. Repeated application of the 2D pythagoras theorem gives you the N-dimensional generalisation.
2 If you are not satisfied and want to understand this properly or simply enjoy mathematics, take a look at the math appendix to Transport Phenomena by Bird, Stewart, and Lightfoot.

Unit Vectors

  • Once we know the magnitude of a vector, we can generate a vector in the same direction, but with a unit length: \begin{align*} \hat{\boldsymbol{r}} = \frac{\boldsymbol{r}}{\left|\boldsymbol{r}\right| } \end{align*}
  • $\hat{\boldsymbol{r}}$ is a unit vector (a vector of length 1) pointing in the same direction as $\boldsymbol{r}$.
  • Unit vectors are really handy when you only want to encode direction (ignoring magnitude).
  • I've used them on the diagram on the right to indicate the directions the vector $\boldsymbol{r}$ would move in each of the coordinates (both Cartesian and cylindrical).

Other Operations

  • Again, noting that the following definitions only apply for Cartesian coordinates:
  • Vector addition/subtraction is straightforward: \begin{align*} \boldsymbol{a}\pm\boldsymbol{b}=\left[ \begin{matrix} a_x \\ a_y \\ a_z \end{matrix}\right] \pm \left[ \begin{matrix} b_x \\ b_y \\ b_z \end{matrix}\right] = \left[ \begin{matrix} a_x \pm b_x \\ a_y \pm b_y \\ a_z \pm b_z \end{matrix}\right] \end{align*}
  • The dot (or scalar) product is also well known: \begin{align*} \boldsymbol{a}\cdot\boldsymbol{b}=\left[ \begin{matrix} a_x \\ a_y \\ a_z \end{matrix}\right] \cdot \left[ \begin{matrix} b_x \\ b_y \\ b_z \end{matrix}\right] = a_x b_x + a_y b_y +a_z b_z \end{align*}
  • It gives the product of the angle between two vectors and their lengths, but physically it is often used to measure one vector against another. E.g., $\bm{a}\cdot\hat{\bm{b}}$ is actually the length of $\vec{a}$ in the direction of $\hat{\vec{b}}$!

Other Operations

  • The final operation is the dyadic product, which creates a matrix out of two vectors: \begin{align*} \boldsymbol{a}\boldsymbol{b} = \left[\begin{matrix} a_x b_x, & a_x b_y, & a_x b_z\\ a_y b_x, & a_y b_y, & a_y b_z\\ a_z b_x, & a_z b_y, & a_z b_z\\ \end{matrix} \right] \end{align*} This operation appears once in the momentum balance equation, unfortunately that equation is used all the time. We'll talk about its physical meaning later when its introduced.
  • These are enough vector notation basics to get us started, but you may have noticed that the notation is quite clumsy.
  • It takes quite a lot of work to write out what the result of a single dyadic operation is, imagine if we actually tried to do some maths/calculus with it!
  • We would like a more compact notation to work in, one which lets us write everything above in just a couple of symbols.
  • The best notation would be more clear than vector notation, but still only use a few symbols, letting you easily work out complicated statements.

Index Notation

  • It turns out that one of Einstein's lesser known achievements was that he invented a very convenient notation for vectors, called index notation .
  • His idea was this: you often perform dot products and it is quite convenient to write it using a summation operator: \begin{align*} \boldsymbol{a}\cdot\boldsymbol{b} &= a_x b_x + a_y b_y +a_z b_z\\ &=\sum_{i=x,y,z} a_i b_i \end{align*}
  • But the true genius of Einstein was revealed when he realised he wouldn't even need to write the sum symbol, $\sum_{}$ !
  • He realised that every time there is a sum, there is a repeated index (the $i$ appears twice in the expression).
  • So he said just forget to write the sum there if the index is repeated! \begin{align*} \boldsymbol{a}\cdot\boldsymbol{b}=\sum_{i=x,y,z} a_i b_i\equiv a_i b_i \end{align*}

Index Notation

  • But this means whenever an index is not repeated, it is a so-called free index , or index you can pick or choose.
  • For example, what does a simple vector look like in index notation? \begin{align*} \boldsymbol{a} = a_i \end{align*}
  • The index $i$ is not repeated, so we know that we have the choice to pick its value, thus there are three separate values here, i.e., this is a vector.
  • What about vector addition? \begin{align*} \boldsymbol{a}+\boldsymbol{b} = a_i + b_i \end{align*}
  • A small extension is needed here: Indices are only summed over if they are repeated within a single multiplicative term. Thus the above result is a vector and there is no implicit sum (as expected for the sum of two vectors).
  • If we want the $x$ value of the (vector) result, we just set the free index to $i=x$ : \begin{align*} \left[\boldsymbol{a}+\boldsymbol{b}\right]_x = a_x + b_x \end{align*}

Index Notation

  • A more complicated example: lets take the following expression: \begin{align*} \left(\boldsymbol{a}\cdot\boldsymbol{b}\right)\boldsymbol{c} = \sum_{i=x,y,z} a_i b_i \left[ \begin{matrix} c_x \\ c_y \\ c_z \end{matrix}\right] \end{align*}
  • We can drop the sum over $i$ as it is a repeated index, but what to do about $\boldsymbol{c}$ ? We just leave it as a new free index $j$ : \begin{align*} \sum_{i=x,y,z} a_i b_i \left[ \begin{matrix} c_x \\ c_y \\ c_z \end{matrix}\right] \equiv a_i b_i c_j \end{align*}
  • As the $j$ index is free (only appears once in a multiplicative term), it means this result is a vector, and the components are obtained by setting $j=x,y,z$ !

Index Notation

  • You have to be careful that certain terms have the correct free indices, for example: \begin{align*} \boldsymbol{a}+\boldsymbol{b}\neq a_i + b_j \end{align*}
  • But these mistakes are easy to spot, as each multiplicative term in the expressions we work with should have exactly one of every free index.
  • Technically, it doesn't matter which letter you use as the free index either: \begin{align*} (\boldsymbol{a}\cdot\boldsymbol{b})\boldsymbol{c} &= a_i b_i c_j\\ &= a_j b_j c_i\\ &= a_k b_k c_j\\ &=… \end{align*}
  • But you must be consistent in the order of the free indices when converting, i.e. \begin{align*} \boldsymbol{A} = A_{ij} \neq A_{ji} \end{align*}

Index Notation

To recap:

  • An expression with no free indices is a scalar: \begin{align*} \boldsymbol{a}\cdot\boldsymbol{b} = a_i b_i \end{align*}
  • An expression with one free index per additive term is a vector: \begin{align*} \boldsymbol{a} + \boldsymbol{b}= a_i + b_i \end{align*}
  • An expression with two free indices is a matrix, e.g. \begin{align*} \boldsymbol{A} &= A_{ij} \\ \boldsymbol{a}\boldsymbol{b} &= a_i b_j = \left[\begin{matrix} a_x b_x, & a_x b_y, & a_x b_z\\ a_y b_x, & a_y b_y, & a_y b_z\\ a_z b_x, & a_z b_y, & a_z b_z\\ \end{matrix} \right] \end{align*}
  • In general, an expression with $X$ free indices is an $X$-order tensor.

Index Notation

  • There is one common vector operation which is quite awkward to describe in index notation.
  • The cross product, denoted using $\boldsymbol{a}\times\boldsymbol{b}$ , is an operation that is unique to 3D problems. It is defined as follows: \begin{align*} \boldsymbol{a}\times\boldsymbol{b} = \left[\begin{matrix} a_y b_z - a_z   b_y\\ a_z b_x - a_x   b_z\\ a_x b_y - a_y   b_x \end{matrix} \right] = \boldsymbol{\mathrm{\epsilon}}_{ijk} a_j b_k \end{align*}
  • The index notation representation relies on the use of the Levi-Civita symbol ($\boldsymbol{\mathrm{\epsilon}}_{ijk}$ ), which is a 3rd-order tensor:
  • Fortunately, we will not need to use this operation often in this course (1 occurrence, not on an exam). I'm just putting it here for completeness.

Index Notation

  • The last topic to discuss regarding vector notation is vector calculus.
  • This is a rich topic, which we can only skim in the time we have.
  • In particular, we will focus on the del (or vector differential) operator, $\nabla$ (this is also the greek symbol nabla).
  • This is the vector equilivent of a derivative and is defined in Cartesian coordinates as follows: \begin{align*} \nabla =\left[\frac{\partial}{\partial x},\frac{\partial}{\partial y},\frac{\partial}{\partial z}\right] \end{align*}
  • We can also define it in index notation, but first we have to define the generic position vector: \begin{align*} \boldsymbol{r} =\left[x,y,z\right] \end{align*}
  • And then we can write the del operator in index notation: \begin{align*} \nabla =\frac{\partial}{\partial r_i} \end{align*}

Index Notation

  • To help us understand what the del operator is, we'll look at the 1,2 and 3 dimensional versions.
  • In 1D, if we have a function $f(x)$ , then $\nabla f=\frac{\partial f}{\partial x}$ , and it is the slope of the function.
  • In 2D, if we have a function $g(x,y)$ , then $\nabla g=\left[\frac{\partial g}{\partial x}, \frac{\partial g}{\partial y}\right]$ . This is a vector which points in the direction of the steepest increasing slope, with a magnitude equal to the slope (arrows).
  • So if you're standing on a slope, and calculate the vector $\nabla altitude$ , it is a vector in the direction of uphill with a length proportional to the gradient.

Index Notation

  • In 3D, the best analogy for the del operator is to think of a bottle of perfume in a large room.
  • After some time of the bottle being opened, there is a concentration gradient of perfume in the air with the strongest smell at the source/bottle.
  • The vector $\nabla c(x,y,z)$ , where $c$ is the concentration (or smell) at your location in the room, will point in the direction of the bottle of perfume.
  • The magnitude, $\left|\nabla c(x,y,z)\right|$ will equal to how quickly the scent increases in strength as you approach the bottle.
  • We will find the del operator very useful in the following lectures as a way of simplifying our equations.

Learning Objectives

  • To understand the representations of vectors and that they encode directions and magnitudes.
  • To be aware of Cartesian, cylindrical and spherical coordinate systems.
  • To know that each vector operation is defined differently for different coordinate systems.
  • To know the magnitude, dot, dyadic and cross products for Cartesian systems.
  • To be able to work in Einstein's index notation!
  • To know the definition of the del operator in Cartesian systems and its index notation form.