Three-dimensional plots of functions of two variables
Plots of three-dimensional surfaces
We have seen that Mathematica is very useful for making plots of functions of one variable. In this lesson we explore
some of Mathematica's capabilities for plotting functions of two variables.
As an example, we will consider the quantum mechanical problem of a particle in a two-dimensional box, i.e., quan-
tum particle confined in two dimensions between "walls" that correspond to regions of infinite potential energy.
Solution of the Schrödinger equation for this system gives the quantized energies:
En , n = In + n M2 ,
1 2 1 2 8 mL
where m is the mass of the particle, h is Planck's constant, L is the length of the box (assumed to be the same in the
x and y directions, and n and1n are q2antum numbers that are restricted to the positive integers (1, 2, 3,...). The
corresponding wavefunctions are:
2 n1px n2py
yn1, 2Hx, yL = Lin( L ) sin( L ).
According to the Born interpretation of the wavefunction, y 2 is the probability density of the quantum particle, i.e.,
y dxdy is the probability of finding the particle within dxdy of the point (x,y).
In the following, we'll plot a couple of the wavefunctions and the corresponding probability densities with x and y in
units of L (i.e., we set L = 1 in the above equation) using the Plot3D command, which is analogous to the Plot
command for functions of one variable:
_, y_D := 2 [email protected]
Pi xD [email protected]
H* plot using replacement rules to set the values of n1 and n2 *L
@x, yD ê. 8n1 Ø 1, n2 Ø 1