gibson:teaching:spring-2018:math445:lab9

This shows you the differences between two versions of the page.

— |
gibson:teaching:spring-2018:math445:lab9 [2018/04/10 06:56] (current) gibson created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Math 445 lab9: a gentle rain falls on Monte Sol ====== | ||

+ | The function | ||

+ | \begin{eqnarray*} | ||

+ | h(x,y) = 2 e^{-(x-1)^2 - (y-1)^2} + e^{-(x+1)^2 - y^2} | ||

+ | \end{eqnarray*} | ||

+ | is a rough scale model of a pair of small mountains named Monte Sol and Monte Luna on the outskirts of Santa Fe, New Mexico. Monte Sol, the bigger of the two mountains is about 200 meters high above the plain, so the scale is 1 = 100 meters. | ||

+ | |||

+ | In this lab you will use vector calculus, 3D graphics, and numerical integration of differential equations to explore how water flows when a gentle rain falls on the mountains. | ||

+ | |||

+ | |||

+ | **Problem 1.** Make a surface plot of Monte Sol and Monte Luna. It should look something like this. | ||

+ | |||

+ | {{:gibson:teaching:spring-2015:math445:montesol.png?direct&400|}} | ||

+ | |||

+ | |||

+ | **Problem 2.** In a gentle rainstorm, water will flow down the mountains in the direction of steepest descent, i.e. along the negative of the gradient of $h$. Find the gradient of $h$ using elementary calculus, then make an $x,y$ plot with both contours of the mountain height $h$ and a quiver plot showing the direction of flow of rainwater. It should look something like this. | ||

+ | |||

+ | {{:gibson:teaching:spring-2015:math445:montesol_quiver.png?direct&400|}} | ||

+ | |||

+ | |||

+ | **Problem 3.** Superimpose on your previous plot the path $\vec{x}(t)$ of a raindrop that falls at | ||

+ | $\vec{x}(0) = (x_0,y_0) = (0.9,0.9)$. We're assuming the velocity of the raindrop as it drips down is proportional to the negative of the gradient of the height. That is, $\vec{v} = -c \vec{\nabla} h $, | ||

+ | where $\vec{v} = d\vec{x}/dt$ is the $x,y$ velocity of the raindrop. For convenience set $c=1$ (this won't change the path). Then compute the path of the raindrop numerically using //forward Euler time-stepping//, | ||

+ | |||

+ | \begin{eqnarray*} | ||

+ | \vec{x}(t+\Delta t) = \vec{x}(t) + \Delta t \, \vec{v}(\vec{x}(t)) | ||

+ | \end{eqnarray*} | ||

+ | |||

+ | The above formula is accurate only if the time step $\Delta t$ is small. The value $\Delta = 0.1$ is small enough for the given system. (You can experiment with larger and smaller time steps if you like.) | ||

+ | |||

+ | |||

+ | {{:gibson:teaching:spring-2015:math445:montesol_path.png?direct&400|}} | ||

+ | |||

+ | **Problem 4.** Then show the path of the raindrop in 3d, superimposed on the surface plot. You will need to use Matlab's ''plot3'' function. | ||

+ | |||

+ | {{:gibson:teaching:spring-2015:math445:montesol_path3d.png?direct&400|}} | ||

+ | |||

+ | **Problem 5.** Recompute the plot of problem 3 using Matlab's ''ode45'' numerical integration function instead of forward Euler. | ||

+ | |||

+ | **Problem 6.** Plot the paths of 100 raindrops that fall randomly on the mountains. Show the hundred raindrop paths on both the contour plot and the 3d surface plot. |

gibson/teaching/spring-2018/math445/lab9.txt ยท Last modified: 2018/04/10 06:56 by gibson