|
The image is constructed using a two dimensional Gabor wavelet.
Late labs are not accepted. You are encouraged to work in groups of no more than 3 people, though you can work alone.
On your title page, clearly mark
Monday, February 28th - Wednesday, March 2nd.
This lab contains 10 exercises that have to be completed. The lab does not require writing a formal report but written justifications of the solutions to the exercises must be handed in. Please see section "Report" in the end for a description of the expected format of your lab presentation.
Some graphs in this lab instruction may not come out well when printed. You may want to look at some of the graphs directly from the webpage for optimal quality.
The next section will go through the three different types of plots and discuss their uses.
Fig. 1. A surface plot of
f(x,y)=1-(sin2(x)+y2)
|
A physical interpretation of f(x,y) is given by the following example. Let us say that we are considering a metal plate in the xy-plane. Imagine that the temperature varies throughout the plate. The temperature distribution can then be desribed as a function f(x,y) such that the temperature at a certain point in the plate is obtained by simply plugging in the coordinates of the point into the function. The value of the function at these coordinates gives the temperature at this point. Geometrically, the temperature distribution can now be "visualized" by plotting the surface that f(x,y) generates.
Both the surface aspect and "temperature" aspect of the function f(x,y) will be carefully explored in the exercises below.
Fig. 2. A contour plot of
f(x,y)=1-(sin2(x)+y2).
|
In practice, most contour plots are created by choosing a set of equally spaced constants. This means that a contour plot is typically generated by choosing constants C=1, 2, 3, 4, 5 rather than choosing C=1, 10, 11, 12.47890, 200. You can assume that all contour plots generated in this lab use a set of equally space constants.
Geometrically, points on the same contour line all have the same elevation in the xy-plane. Physically, if f(x,y) describes the temperature distribution, then points on the same contour line all have the same temperature in the xy-plane, so-called iso-terms. You might also come to think of weather maps which are nothing else than contour plots of the pressure distrubution over some area. In this case contour lines represents a curves with identical pressure (iso-bars).
| Definition (gradient). The gradient of f(x,y) at a point (x0,y0) is the vector obtained by evaluating the partial derivatives of f at (x0,y0). |
Note that the gradient is a vector. We can interpret the gradient in the following way. The gradient vector points in the direction of most rapid increase of f. In other words, if f(x,y) is interpreted as a surface, the gradient points in the direction of steepest slope uphill. The length (or magnitude) of the gradient measures how steep this "steepest slope" is. If the length of the gradient is relatively long, then the slope is relatively steep and if the gradient vector is shorter than the slope is less steep. If we want to find the direction of steepest slope downhill rather than uphill, we simply take the opposite direction of the gradient (multiply the gradient with -1). Another property of the gradient at a point (x0,y0) is that it always points orthogonal to the contour line (or level curve) through this point.
We can let a computer compute the gradients at a large number of points in the xy-plane. This will create a gradient field plot.
Fig. 3. A gradient field plot of
f(x,y)=1-(sin2(x)+y2).
|
In Fig. 3 above, notice how the lengths of the gradient vectors are longer near the lines y=-1 and y=1 indicating a steeper slope at these points. Also notice that the gradients along the line x=0 do not have any component in the horizontal direction, indicating that along this line, the surface is locally flat in the (horizontal) x- direction but curved in the (vertical) y-direction. Compare these observations to the surface in Fig. 1 and the contour plot in Fig. 2.
Note that according to our resolution in Fig. 2 (i.e., the number of contour lines we plot) there are no more local maxima/minima in the surface in our region (although it seems like if we would stretch the region, we may found some more). However, the subtle point is that if we would ask the computer to plot more contour lines, small local maxima/minima may turn up. Hence, we can only find local maxima/minima that are "big" enough to appear on the contour plot with our resolution.
We see from Fig. 1 that at roughly (-1.5,0) and (1.5,0) we have a point where the surface is locally flat, but is curved concave up in the x-direction and concave down in the y-direction. When this happens, we have what is called a saddle point. You can see what the saddle points look like in a contour plot by studying Fig. 2.
| Fourier's law. Let the temperature distribution in a plate be given by f(x,y). Let G be a vector indicating in what direction and with what rate heat is flowing in the plate. Let K be a positive constant (thermal conductivity measured in J/(m s K) ). Then the heat flow is given by the following law:
|
This law was formulated by one of the most famous mathematicians of all time, the French Joseph Fourier (1768-1830) who besides being famous for initiating Fourier analysis (the foundation for signal processing and solutions to many partial differential equations), also is known for working with Napoleon.
| Fick's fist law. Let the concentration of a substance in a volume be given by f(x,y,z) (unit= mol/m3). Let j be a vector indicating in what direction and with what rate (unit=mol/(m2s) ) the substance is diffusing. Let D be a positive constant (diffusion constant measured in m2/s). Then the diffusion of the substance is given by the following law: |
| Relation between electric fields and electric potentials.
Let the electric potential in a plane be given by f(x,y). Let E be a vector indicating the direction and strength of the electric field. Then the electric field is given by
|
A relatively large magnitude of the vector E indicates a relatively strong field, which means that a charged particle moves relatively fast where the magnitude is large.
| Relation between graviational fields and gravitational
potentials. Let the gravitational potential in a plane be given by f(x,y). Let F be a vector indicating the direction and strength of the gravitational field. Then the gravitational field is given by
|
A relatively large magnitude of the vector F indicates a relatively strong field, which means that a particle moves relatively fast where the magnitude is large.
| Exercise 0. Read the Background above! |
| Exercise 1. Using some mathematical software, such as Mathematica, plot the function f(x,y)=e-(x2+y2/2)cos(4x) +e- 3( (x+0.5)2+y2/2 ) in the region -3 < x < 3, -5 < y < 5. Use plot range 0 < f(x,y) < 0.001 . This gives a most surprising surface! The purpose of this exercise is to learn how to plot surfaces and the only answer you need to give for this exercise is to read the secret message in the appearing plot and hand in the plot. |
The surface in the previous exercise is generated using "wavelets", which is a class of functions of rapidly growing importance in applied mathematics. It can be used for image processing and is a very efficient tool for image compression which is extremely important today when more and more images are stored and transferred electronically. In fact, the technique using wavelets for image processing is so new so most existing software use older methods, but the next generation of image processors will probably use wavelets.
| Exercise 2. Give a geometrical argument based on a surface plot why the function
does not have a limit at (x,y)=(1,2). Hint: In Mathematica, the absolute value is given by the command Abs[ ]. Use, e.g., PlotPoints->50 to get a good view of this surface. See also the text book Chapter 12.2. |
| Exercise 3. a) Make a contour plot of the function f(x,y)=x in the region -1 < x < 1, -1 < y < 1. Print the plot and hand it in. (No justification needed for this exercise.) b) Make a gradient field plot of the function f(x,y)=x in the region -1 < x < 1, -1 < y < 1. Print the plot and hand it in. (No justification needed for this exercise.) c) Compare the two plots from a and b above. How are the gradients and contour lines related for this function? (Give the answer, but no justification is necessary.) d) Make a contour plot of the function f(x,y)=x2+2y2 in the region -1 < x < 1, -1 < y < 1. Print the plot and hand it in. (No justification needed for this exercise.) e) Make a gradient field plot of the function f(x,y)=x2+2y2 in the region -1 < x < 1, -1 < y < 1. Print the plot and hand it in. (No justification needed for this exercise.) f) Compare the two plots from d and e above. How are the gradients and contour lines related for this function? (Give the answer, but no justification is necessary.) The conclusion you should arrive at will be true for any (differentiable) function f(x,y). |
| Exercise 4. Associate the right gradient field ( a, b or c) to the surface below. Justify your answer. |
|
Surface |
Alternative a |
Alternative b |
Alternative c
|
| Exercise 5. Based on the two figures below which show the contour plot and gradient field plot of the temperature distribution in a plate, describe qualitatively the temperature distribution in the plate.
|
||
Contour plot of the temperature distribution in a
plate. |
Gradient field plot of the temperature distribution in a plate.
(Same plate as to the left.) |
| Exercise 6. The surface below illustrates the temperature distribution in a plate.
Imagine that you are an ant running around on the plate. Describe a) how you experience the temperature changing as you run over the plate parallel to the x-axis at a few different y-levels. The gradient field plot below illustrates the temperature distribution in a plate (different from the one above). The gradients are not very clear, but all arrows are of the same length, pointing in the same directions (upwards). Imagine that you are still an ant running around on the plate. Describe b) how you experience the temperature changing as you run over the plate parallel to the x-axis at a few different y-levels and c) how you experience the temperature changing as you run over the plate parallel to the y-axis at a few different x-levels. For all problems when you are an ant, compare your experiences to the respective plots, i.e., you have to justify your answers to the above questions by referring to features in the plots. |
| Exercise 7. In this problem you are still an ant. You have to cross a plate in the region -2 < x < 2, -5 < y < 5. The temperature in the plate varies according to the function f(x,y)=3+sin2(y)(1-x2). You have to cross the plate from some point along the left edge (x=-2) to some point along the right edge (x=2). However, the plate is dangerously hot at some places so you'd better carefully plan your route before you go. Use any plot(s) you like to determine your route. However, mark your route on either a contour or gradient field plot. As always, justify your route and include all graphs that you used to plan your route. |
You may now stop being an ant.
| Exercise 8. Using gradient field plots, describe how heat will flow according to Fourier's law if the current temperature distribution is given by f(x,y)=1-3x2-y2 in the region -5 < x < 5, -5 < y < 5. |
| Exercise 9. a) The electric potential around a single charge (a mono-pole) is given by f(x,y)=1/(x2+y2)1/2. Plot the eletric field in the region 0.01 < x < 0.1, -0.05 < y < 0.05. Mark the path that a negatively charged particle will follow if put into the field at (x,y)=(0.02,0.025). b) The electric potential around two opposite charged particles (a dipole) is given by f(x,y)=cos(arctan(y/x))/(x2+y2). Plot the electric field in the region 0.01 < x < 0.1, -0.05 < y < 0.05. Mark the path that a negatively charged particle will follow if put into the field at (x,y)=(0.02,0.025). c) Explain in a sentence or two the qualitative difference between the fields. Hint: Use the option Frame->True to see the coordinate values. |
| Exercise 10. The function that describes the gravitational potential from the Milky Way galaxy, at coordinates (x,y)=(0.0), and the (invented) galaxy Suluclac located at (x,y)=(1,0) which is two times more massive than our own galaxy, is given by a) Plot the gravitational field given by this potential. Let us assume that some aliens have abducted you and stopped the spaceship to throw you off at coordinates (x,y)=(0.5,-0.75). Will you make it back to the Milky Way, or will you end up in Suluclac as gravity starts to pull you? Sketch your trajectory on the plot and justify it. b) Now plot the same field as above in the region -1 < x < 2, -1 < y < 1. Before you were thrown off the spaceship you kindly asked the aliens to throw off your Calculus book as well, but only when the spaceship was at a position such that the book would never make it back to the Milky Way. Mark the region on the plot where you recommend the alien to throw off your book. Hint: Look at the hint for Exercise 9. |
Exercise 1. Include plot of the surface. (No justifications
necessary for Exercise 1.)
Exercise 2. Include a plot of the
surface. Justify (referring to the plot) why no limit exists at
(x,y)=(1,2)
Exercise 3. Include plots for a,b,d and e.
Answer c and f. (No justifications necessary for Exercise 3.)
Exercise 4. Give answer
(a, b or c). Justify in a few sentences your answer by referring to features in
the plot(s).
Exercise 5. Answer all questions in the list given in
the exercise. Justify all answers by referring to features in the plot.
Exercise 6. Answer a,b and c and justify all answers in terms of
features in the plots.
Exercise 7. Include a contour or gradient
field plot with a route marked. Explain why your route is healthy for your ant
by referring to any plots you used. Include any plots you refer to.
Exercise 8. Include a gradient field plot for the function.
Describe the heat flow according to Fourier's law by referring to features in
the plot.
Exercise 9. Include plots of both fields, with the
requested paths marked. Justify your paths by referring to the relation between
potential and field and features in the plots. Describe the differences in the
fields.
Exercise 10. Include plots for both exercises with trajectory
(for a) and region (for b) marked. Justify your trajectory/region by referring
to the relation between potential and field and features in the plots.
There are quite a few plots to include. To save the trees, please try to print several plots together by pasting several plots into the same document.
By now you probably say "what does a few sentences of justification mean"? Below follows a sample example.
| Sample exercise . Based on the two figures below which show the contour plot and gradient field plot of the temperature distribution in a plate, describe qualitatively the temperature distribution in the plate.
|
|
Contour plot of the temperature distribution in a
plate. |
Gradient field plot of the temperature distribution in a plate.
(Same plate as to the left.) |
| Sample solution. From the gradient field plot we see that the temperature is increasing towards (0,0) since all gradients point towards that point (and gradients always point in the direction of steepest increase). Hence there is an absolute max at (0,0). From the gradient plot we observe that all gradients point inwards, so the temperature must decay as we move outwards towards the edges. We see that towards the edges, no more contour lines occur which indicates that the temperature distribution evens out towards the edges. There are no more closed contour lines, which means that according to our resolution, we have no more local extreme points. |
You must type your report. The report you hand in should follow this format:
Lab created by Kristian Sandberg. Last modified by Juliet Hougland.