Learning Objectives
- Students will understand the mechanics of plotting functions of the form $z=f(x,y)$
- Students will get practice using tables and plots simultaneously.
- Students will get practice evaulating functions of two variables.
Instructions
Open Excel and create a new spreadsheet. Label the top row starting in cell
B1
with the values $-3,-2,\dots,2,3.$ Label the leftmost column starting at cellA2
with the same values. The column labels will correspond to x-values, the row labels will correspond with y-values. (You may want to label your y-values in decreasing order to make your graph resemble the typical xy-axes.)We are now going to populate our table with the function values $f(x,y)=-1+8e^{\frac{-x^2-y^2}{9}}$.
In cell B2, enter the formula
=-1+8*EXP((-1/9)*(B$1^2+$A2^2))
. Copy this across each cell in your table. (Excel should make the associated changes as you drag the formula across.) (If you’re having issues, make sure there’s not a space before the=
sign!)Select cells
B2
throughH8
. Then, click Home > Conditional Formatting > Color Scales. Click any of the color scales. This creates a “heat map” of our function. Larger values get colored with one color, smaller values get colored with another.This essentially is a 7x7 pixel plot of the function $f(x,y)$. In small groups, answer the following questions:
- Suppose we wanted to increase the resolution of our image by a factor of two in both the $x$ and the $y$ directions. so that the spacings are $\delta x = \delta y = 0.5$ instead of $1$. How many pixels would your new image use? Compare this with how many new calculations you would have to do to draw the trace $z=f(x,0)$ (i.e. the $y=0$ trace).
- Compare and contrast graphing functions of one variable and two variables. What takes more work? What produces cooler graphs? Why does one take more work than the other?
- Now, imagine you need to build an “image” with a resolution of 1920x1080px. (aka “Full HD” or “1080p”) How many pixels are contained in this image? Do you think it is feasible to do this “by hand”, using our method?1
Use one or more of the plotting tools on the Resources Page to make a 3D plot of our function $f(x,y)=8e^{\frac{-x^2-y^2}{9}}$. How do the features of your plot compare to the features of the the 3D plot?
Food for thought: your phone/computer do this 60–120 times per second whenever the display is on! ↩︎