$$ \newcommand{\RR}{\mathbb{R}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\CC}{\mathbb{C}} \newcommand{\NN}{\mathbb{N}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\EE}{\mathbb{E}} \newcommand{\HH}{\mathbb{H}} \newcommand{\SO}{\operatorname{SO}} \newcommand{\dist}{\operatorname{dist}} \newcommand{\length}{\operatorname{length}} \newcommand{\uppersum}[1]{{\textstyle\sum^+_{#1}}} \newcommand{\lowersum}[1]{{\textstyle\sum^-_{#1}}} \newcommand{\upperint}[1]{{\textstyle\smallint^+_{#1}}} \newcommand{\lowerint}[1]{{\textstyle\smallint^-_{#1}}} \newcommand{\rsum}[1]{{\textstyle\sum_{#1}}} \newcommand{\partitions}[1]{\mathcal{P}_{#1}} \newcommand{\erf}{\operatorname{erf}} \newcommand{\ihat}{\hat{\imath}} \newcommand{\jhat}{\hat{\jmath}} \newcommand{\khat}{\hat{k}} \newcommand{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}} \newcommand{\smat}[1]{\left(\begin{smallmatrix}#1\end{smallmatrix}\right)} $$

Assignment 6

Problems

Heatshields on Rockets

You are working with several research teams at NASA who are trying to understand and model the heat flow along the nose cone of a rocket during re-entry. Below is a picture from a real simulation of this just for context (though you do not need this picture to solve the problem)

Waves of hot and cold on a nose-cone for a rocket traveling at hypersonic speeds.

You and your team use the heat equation as a model of this: if \(x\) is the distance along the nose cone (starting with \(x=0\) at the tip) and \(t\) is the time, then the temperature \(H(x,t)\) of the metal at point \(x\) and time \(t\) satisfies the equation

\[\frac{\partial H}{\partial t} = \lambda^2 \frac{\partial ^2 H}{\partial x^2}\]

Where \(\lambda\) is a positive constant that depends on the metal you choose to make the nose of the rocket out of (larger values of \(\lambda\) means that it conducts heat faster, smaller values mean it conducts heat slower).

Your team of atmospheric scientists tell you that during re-entry waves of plasma will be crashing over the nose cone, heating it up in a complicated pattern. Once this portion of the flight is over, the temperature distribution along the nose cone is expected to look like

Temperature distribution (as a function of \(x\) along the nose cone) at time \(t=0\).
  • Explain the heat equation in words: how does it relate the change in heat over time to the distribution of heat in the \(x\) direction? Using the heat equation, draw a picture of what the heat distribution on the nosecone will after a short time. Explain your graph: why did you draw it like this?

Your team of theorists find an exact solution to the heat equation describing these plasma waves: it looks like this

\[H(x,t)=e^{-\lambda^2 t}\sin(\lambda x)\]

(You don’t have to turn this in, but it’s a good idea to verify this is a solution to the heat equation, by taking the derivatives on both sides and seeing the results are equal!)

Your team of mechanical engineers says that the materials they have built the nose cone out of have \(\lambda = 4\), but their measurement is only accurate to within \(\pm 0.1\). The rocket team plans to measure the temperature at the location \(x=\pi/2\) as a function of time. However, because the rocket is vibrating during re-entry, they can only measure position to within \(\pm 0.05\).

  • Use error analysis to figure out how far off the actual temperature reading might be from the predicted theoretical value by \(H(x,t)\) at \(t=0\).

\[dH = H_x dx + H_\lambda d \lambda\]

Level Sets & The Gradient

Below are depictions of three functions \(f,g,h\colon\mathbb{R}^2\to\mathbb{R}\). In the first, I have given you a picture of the level curves of \(f(x,y)\). In the second, I have drawn the gradient of \(g\). In the third, I have drawn a graph of \(h\). Your job is to practice translating between these three modalities of understanding a multivariate function.

  • Draw a sketch of the gradient of \(f\), and explain in a sentence or two your diagram: why did you draw the arrows you did?
  • Draw a sketch of the level sets of \(g\), and explain in a sentence or two your diagram: why did you draw the curves you did?
  • For \(h\), you can choose: either draw me a diagram of the level sets of \(h\), or the gradient of \(h\). Explain in a sentence why your sketch looks like it does.

Directional Differentiation

A small bug is flying through the air in a room, where the temperature distribution (in degrees Celsius) is given by a scalar function \(T\colon \mathbb{R}^3\to\mathbb{R}\) \[T(x,y,z)=xy+yz+xyz-(x^2+y^2)\] The bug’s motion is modeled by a parametric curve \(\vec{c}\colon\mathbb{R}\to\mathbb{R}^3\): \[\vec{c}(t)=\left(1+t,\,\,\frac{t^2}{2}-1,\,\,\frac{1}{3}+t+\frac{t^3}{3}\right)\]

  • What is the temperature where the fly is at \(t=2\)?
  • How quickly is the temperature changing in the direction of the fly’s motion at \(t=2\)?

The fly is seeking out a plate of warm food in the room to land on, and evolution has endowed the fly with a simple strategy that works: at a given point \(\vec{p}\) in space, the fly should attempt to turn and fly towards the nearest warm object (that is, in the direction in which temperature in increasing the quickest).

  • From its position at \(t=2\), what (unit vector) direction should the fly head to approach the food most efficiently?
  • What is the angle between the current fly’s flightpath and this new optimal direction?

Solutions

Heatshields

The heat equation describes how a function measuring the heat of an object varies in both \(x\) and \(t\). It sets the first time derivative of \(H\) equal to (a positive multiple of) the second space derivative of \(H\). First derivatives measure the rate of change, and second derivatives measure concavity, so this equation says

The rate of change of \(H\) in time is proportional to the concavity of \(H\) in the \(x\) direction.

We can use this to understand qualitatively what happens over time: where a functions concavity is positive, the equation says \(\partial_tH\) is positive, so \(H\) is increasing. Similarly, if the concavity is negative, then \(H\) must be decreasing. Looking at the plot, this means the peaks (maxima, so negative concavity) are decreasing and the minima are increasing, so the temperature is evening out over time.

The heat equation causes \(H\) to even out over time.

For the error analysis, we need to compute \(H_x\) and \(H_\lambda\):

\[H_x=\frac{\partial}{\partial x}e^{-\lambda^2 t}\sin(\lambda x) = e^{-\lambda^2 t}\lambda \cos(\lambda x)\]

Now we need to evaluate this at the point we are interested in: \(\lambda = 4, x=\pi/2,\) and \(t=0\).:

\[H_x = e^{4^2\cdot 0}\cdot 4 \cdot \cos(4 \frac{\pi}{2})= 1\cdot 4\cdot 1=4\]

Similarly we need to find \(H_\lambda\) and evaluate at the values of interest. Since \(\lambda\) shows up twice in our formula, we are going to need to use the product rule:

\[H_\lambda = \frac{\partial}{\partial \lambda}e^{-\lambda^2 t}\sin(\lambda x)=-2\lambda e^{-\lambda^2 t}\sin(\lambda x)+e^{-\lambda^2 t}x\cos(\lambda x)\]

\[\begin{align*}H_\lambda &= -2\cdot 4\cdot e^{-4\cdot 0^2}\sin\left(0\cdot\frac{\pi}{2}\right)+e^{-4\cdot 0^2}\cdot \frac{\pi}{2}\cdot \cos\left(4\frac{\pi}{2}\right)\\ &= -2\cdot 4\cdot 1\cdot 0 + 1\cdot \frac{\pi}{2}\cdot 1\\ &=\frac{\pi}{2} \end{align*}\]

Thus we now know how to estimate the potential error \(dH\) in a heat measurement caused by our uncertainty in the material parameter \(\lambda\) and the sensor position \(x\):

\[\begin{align*} dH &= H_x dx + H_\lambda d\lambda\\ &= 4 dx + \frac{pi}{2} d\lambda\\ &= 4(0.05)+\frac{\pi}{2}(0.1)\\ &=0.35707\ldots \end{align*}\]

Thus, if our measurement is more than \(0.36\) or so away from the theoretical prediction, we know there’s an error in our experiment or theory somewhere!

Level Sets & The Gradient

In this problem the key is to remember the following facts about the gradient:

  • The gradient points in the direction of steepest increase of the function
  • The gradient is orthogonal to level sets of the function

And the following facts about level sets of a function:

  • Near a max or a min, level sets look like concentric circles
  • Near a saddle, level sets make an “X” shape.

In the first part of the problem, we are given the level sets and asked to draw the gradient. We automatically know the gradient vectors will be perpendicular to the level sets, and since the level sets come with a legend telling us which ones are high valued and which ones are low, we can see the direction. I started by drawing a couple gradient vectors directly on the level set sketch, and used these as a guide to fill in the rest:

Drawing the gradient from level sets

Next we started with a plot of the gradient and needed to draw level sets. First we notice there is one spot where the gradient is pointed inwards, and one spot where its pointed outwards in every direction. Since the gradient always points towards the steepest increase, these are a max and min respectively. And, we know maxes and mins are surrounded by concentric circle level sets. Second, we can see the gradients all point in approximately the same direction across the middle of the image, so the level set there is approximately linear. From this, we can fill in the rest by making sure they never cross (making a saddle) or close up to form any other families of circles (making a new max or min):

Drawing level sets given the gradient.

Finally we are given a picture of a graph in 3D and told to draw its gradient or its level sets. I’ll draw the level sets: if you want to draw the gradient you can follow the procedure we did above to convert my picture. The first thing we notice is the function graphed has two maxes and a saddle. So, let’s label those and then draw what the nearby level sets look like:

The local level sets near critical points provide a very helpful guide.

We also see by looking farther down the function that the level sets must eventually become circles, so we add one of these too. Then we can just fill everything in, by making sure the level sets never cross or close off to form more families of circles:

The finished level set plot.

Directional Differentiation

At \(t=2\) we can find the fly’s location by just plugging in \(2\) to the parametric curve:

\[\vec{c}(2)=\left(1+2,\frac{2^2}{2}-1,\frac{1}{3}+2+\frac{2^3}{3}\right)=\left(3,1,5\right)\]

To find the temperature here, we then plug this into \(T(x,y,z)\):

\[T(\vec{c}(2))=T(3,1,5)=(3)(1)+(1)(5)+(3)(1)(5)-(1^2+3^2)=13\]

To find how quickly the temperature is changing in the direction of the fly’s motion, we first need to find this direction. That means finding the unit vector in the direction of \(\vec{c}^\prime(2)\).

\[\vec{c}^\prime(t)=\langle 1,t,1+t^2\rangle\] \[\vec{c}^\prime(2)=\langle 1,2,5\rangle\]

\[\|\vec{c}^\prime(2)\|=\|\langle 1,2,5\rangle\|=\sqrt{1^2+2^2+5^2}=\sqrt{30}\]

Thus the unit vector in the direction of the fly’s motion is

\[v=\left\langle\frac{1}{\sqrt{30}},\frac{2}{\sqrt{30}},\frac{5}{\sqrt{30}}\right\rangle\]

To find the rate temperature is changing in this direction, we need to find the directional derivative. This is computed using the gradient vector \[D_v T = \nabla T \cdot v\]

So we next need to find the gradient at the fly’s position:

\[\nabla T = \langle y+yz-2x,x+z+xz-2y,y+xy \rangle\]

And evaluating at the fly’s position \((3,1,5)\) gives

\[\nabla T(3,1,5)=\langle 1+5-6,3+5+15-2,1+3\rangle=\langle 0,21,4\rangle\]

Dotting this with the direction vector gives the directional derivative we seek:

\[\langle 0,21,4\rangle\cdot \left\langle\frac{1}{\sqrt{30}},\frac{2}{\sqrt{30}},\frac{5}{\sqrt{30}}\right\rangle = \frac{42}{\sqrt{30}}+\frac{20}{\sqrt{30}}=\frac{62}{\sqrt{30}}\approx 11.32\]

Thus,the rate of change of temperature is 11.32 degrees per second

Next, the direction \(\vec{d}\) where temperature is increasing fastest is the direction of the gradient, so we just need to divide \(\nabla T\) by its magnitude:

\[\|\nabla T\|=\|\langle 0,21,4\rangle\|=\sqrt{457}\]

\[\vec{d}=\left\langle0,\frac{21}{\sqrt{457}},\frac{4}{\sqrt{457}}\right\rangle\]

And finally, to find the angle the fly should turn to head in this direction, we can use the dot product! We already have the unit vector \(v\) in the fly’s direction, and the unit vector \(d\) in the direction of fastest increase in temperature. So

\[\cos\theta = v\cdot d = \frac{42}{\sqrt{30}\sqrt{457}}+\frac{20}{\sqrt{30}\sqrt{475}}=\frac{62}{\sqrt{13710}}\approx 0.529\]

Taking the inverse cosine, we find that \(\theta=1.0127\) radians, or approximately 58 degrees.