Purpose:
The purpose of this experiment is to
learn how to make plots of functions of several variables of the type:
1. Contour
maps,
2. Surface
plots; and,
3. Animations.
Equipment
and Chemicals:
A connection through X windows to the
campus RS-6000 running the PV-WAVE graphics program.
Directions:
See the instructor for directions on
how to connect to the RS-6000 and load PV-WAVE.
Calculations:
PLOTTING
A TWO-DIMENSIONAL FUNCTION
The following commands are for plotting
the function, , on a xy-grid of
points. Note that the $ symbol is used for line
continuation.
1.
At the WAVE> prompt type the following commands:
wave> x =
findgen(101)/5 - 10
wave> y = x
wave> z =
fltarr (101,101)
wave> for i
= 0, 100 do begin & $
- for
j = 0, 100 do begin & $
- z
(i,j) = 0.5*x(i)*x(i) + 0.5*y (j)*y(j)
wave> surface,
z
note:
(a) a variable
like x is written as x (i) on a grid, and likewise for y
(b) lines are
continued by using a $
2. Describe
the figure that is drawn and print it out.
3. Make a
contour plot of the function by typing:
wave> contour,
z
4. Describe
the figure that is drawn and print it out.
MAKING
A MOVIE!!
WAVE> navigator
.
.
read in `wf' which is a file containing lines
.
WAVE>
WAVE> wf2 = reform(wf, 16, 16, 25)
WAVE>
WAVE> window, 1, xsize=300, ysize=300, title='movie'
WAVE> surface, wf2(*,*,0)
WAVE>
WAVE> tek_color
WAVE> frames=bytarr(300,300,25)
WAVE>
WAVE> for i = 0, 24 do begin surface, $
- color=9,
$
- wf2(*,*,i),
zrange=[0,0.30] & $
- frames(0,0,i)=tvrd(0,0,!d.x_vsize,
$
- !d.y_vsize)
& end
WAVE>
WAVE> movie, frames, order=0
WAVE>
5. Describe
the movie that is drawn.
6. Use the
above commands to make contour and surface plots of the following functions and
print them out:
(a)
(b)