{VERSION 5 0 "IBM INTEL NT" "5.0" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0
1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0
0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 256 "MS Sans Serif" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }
{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1
258 "MS Sans Serif" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1
259 "MS Sans Serif" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1
260 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 1 14 0
0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 14 0 0 0 0 0 1 0 0
0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }
{CSTYLE "" -1 264 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1
265 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "MS Sans Se
rif" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "MS Sans Serif
" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "MS Sans Serif"
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "MS Sans Serif" 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "MS Sans Serif" 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "MS Sans Serif" 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "T
imes" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }
{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1
2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Title" -1 18 1
{CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12
12 1 0 1 0 2 2 19 1 }{PSTYLE "Heading 3" -1 256 1 {CSTYLE "" -1 -1 "Ti
mes" 1 14 0 0 0 1 1 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }}
{SECT 0 {PARA 18 "" 0 "" {TEXT -1 34 "Surface Integrals of Scalar Fiel
ds" }}{PARA 18 "" 0 "" {TEXT -1 20 "Using Maple and the " }{TEXT 256
8 "vec_calc" }{TEXT -1 8 " Package" }}{PARA 0 "" 0 "" {TEXT -1 77 "Thi
s worksheet shows how to compute surface integrals of scalar fields us
ing " }{TEXT 257 5 "Maple" }{TEXT -1 9 " and the " }{TEXT 258 8 "vec_c
alc" }{TEXT -1 33 " package. As examples we compute" }}{PARA 0 "" 0 "
" {TEXT 260 28 "* The Net Charge on a Sphere" }}{PARA 0 "" 0 "" {TEXT
261 47 "* The Mass and Center of Mass of a Rubber Sheet" }{TEXT 262 0
"" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 "To s
tart the " }{TEXT 259 8 "vec_calc" }{TEXT -1 41 " package, execute the
following commands:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "resta
rt;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "libname:=\"C:/mylib/
vec_calc7\", libname:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "wi
th(vec_calc): vc_aliases:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
39 "with(linalg):with(student):with(plots):" }}}{EXCHG {PARA 0 "> " 0
"" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT 264 26 "The Net \+
Charge on a Sphere" }{TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1
75 "The charge distribution on the surface of a semiconductor sphere o
f radius " }{XPPEDIT 18 0 "15*cm;" "6#*&\"#:\"\"\"%#cmGF%" }{TEXT -1
13 " is given by " }{XPPEDIT 18 0 "density := [2*sin(theta)+3*cos(phi)
*cos(theta)-2*sin(phi)];" "6#>%(densityG7#,(*&\"\"#\"\"\"-%$sinG6#%&th
etaGF)F)*(\"\"$F)-%$cosG6#%$phiGF)-F16#F-F)F)*&F(F)-F+6#F3F)!\"\"" }
{TEXT -1 1 " " }{XPPEDIT 18 0 "coul/(cm^2)" "6#*&%%coulG\"\"\"*$%#cmG
\"\"#!\"\"" }{TEXT -1 7 " where " }{XPPEDIT 18 0 "phi;" "6#%$phiG" }
{TEXT -1 43 " is the polar angle measured down from the " }{XPPEDIT
18 0 "z;" "6#%\"zG" }{TEXT -1 10 "-axis and " }{XPPEDIT 18 0 "theta;"
"6#%&thetaG" }{TEXT -1 68 " is the azimuthal angle measured counterclo
ckwise from the positive " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 53
"-axis. We want to find the net charge on the sphere." }}{PARA 0 ""
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 87 "We first make some a
ssumptions on the variables which will facilitate the integrations:" }
}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "interface(showassumed=0);
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "assume(0<=phi,phi<=Pi,0<=theta,
theta<=2*Pi);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "about(phi,theta);
" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "Then we define the density:"
}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "density:=2*sin(theta)+3*c
os(phi)*cos(theta)-2*sin(phi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
358 "Some places the charge is positive and some places the charge is \+
negative. To visualize this we make a spherical plot of the density. \+
We take the radius to be 20 plus the density so that the radius will \+
be positive. (The number 20 is arbitrary.) Then the charge is positi
ve when the radius is bigger than 20, and negative when the radius is \+
less than 20." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 126 "dens_plot
:=sphereplot(20+density,theta=0..2*Pi,phi=0..Pi, color=density, scalin
g=constrained, orientation=[15,75]): dens_plot;" }}}{EXCHG {PARA 0 ""
0 "" {TEXT -1 326 "We also set the color equal to the density. Then t
he color is blue, violet or red when the density is positive, and the \+
color is green, yellow, orange or red when the density is negative. I
t is still not easy to see where the charge is positive or negative. \+
So we plot a gray spherical grid and display it with the density:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "sph_plot:=sphereplot(20,thet
a=0..2*Pi,phi=0..Pi, color=grey, style=wireframe): " }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 72 "display(\{sph_plot,dens_plot\}, scaling=c
onstrained, orientation=[15,75]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
172 "The charge is positive when the plot is above the grid and negati
ve when the plot is below the grid. Try rotating the graph by clickin
g in the plot and dragging the mouse." }}{PARA 0 "" 0 "" {TEXT -1 89 "
We are now ready to compute the net charge which is the surface integr
al of the density: " }{XPPEDIT 18 0 "Int(density,S) = Int(Int(density*
Jacobian,theta = 0 .. 2*Pi),phi = 0 .. Pi);" "6#/-%$IntG6$%(densityG%
\"SG-F%6$-F%6$*&F'\"\"\"%)JacobianGF./%&thetaG;\"\"!*&\"\"#F.%#PiGF./%
$phiG;F3F6" }{TEXT -1 161 ". The Jacobian is the length of the coordi
nate normal which we now proceed to compute. Since the radius is 15, \+
the spherical coordinate system on the sphere is" }}}{EXCHG {PARA 0 ">
" 0 "" {MPLTEXT 1 0 66 "Rsph:=[15*sin(phi)*cos(theta),15*sin(phi)*sin
(theta),15*cos(phi)];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "The tang
ent vectors are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "R[theta
]:=diff(Rsph,theta);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "R[p
hi]:=diff(Rsph,phi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "So the no
rmal vector is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "N:= R[the
ta] &x R[phi];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "and the length \+
of the normal is " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "lN:=le
n(N); simplify(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "Maple does \+
not simplify this to the simplest form. So we enter it by hand:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "lN:=15^2*sin(phi);" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "So the net charge is" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "Muint(density*lN,theta = 0 .. 2*Pi,
phi = 0 .. Pi); Charge:=value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
59 "Another way to compute this surface integral is to use the " }
{TEXT 266 18 "Surface_int_scalar" }{TEXT -1 23 " command (or its alias
" }{TEXT 267 3 "Sis" }{TEXT -1 11 ") from the " }{TEXT 268 8 "vec_cal
c" }{TEXT -1 135 " package which works directly with the parametrized \+
surface and the scalar function. The surface must be a function of it
s parameters:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "Rsphf:=MF(
[theta,phi],Rsph);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 "and the sc
alar must be a function of position. Looking at the formula for the d
ensity, we convert to spherical coordinates:" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 117 "densityf:=MF([x,y,z], 2*y/sqrt(x^2+y^2) + 3*z/s
qrt(x^2+y^2+z^2)*x/sqrt(x^2+y^2) - 2*sqrt(x^2+y^2)/sqrt(x^2+y^2+z^2));
" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "We check the restriction to t
he sphere agrees with the given function:" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 45 "dens2:=simplify(densityf(op(Rsph))); density;" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "I had some difficulty getting Mapl
e to show that these two are equal, but this works:" }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 52 "simplify(dens2*sqrt(1-cos(phi)^2)-density
*sin(phi));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "We are now ready t
o compute the integral for the charge:" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 70 "Sis(densityf,Rsphf,theta = 0 .. 2*Pi,phi = 0 .. Pi); \+
Charge:=value(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}
{SECT 0 {PARA 4 "" 0 "" {TEXT 263 0 "" }{TEXT 265 33 "The Mass and Cen
ter of Mass of a " }{TEXT -1 12 "Rubber Sheet" }}{EXCHG {PARA 0 "" 0 "
" {TEXT -1 61 "A rubber sheet is stretched across a circular ring of r
adius " }{XPPEDIT 18 0 "R = 3;" "6#/%\"RG\"\"$" }{TEXT -1 1 " " }
{XPPEDIT 18 0 "cm;" "6#%#cmG" }{TEXT -1 117 " and a weight is placed i
n the middle which pulls it downward. Consequently the sheet has the \+
shape of the graph of " }{XPPEDIT 18 0 "z = 2-2^(2-(x^2+y^2)/9);" "6#/
%\"zG,&\"\"#\"\"\")F&,&F&F'*&,&*$%\"xGF&F'*$%\"yGF&F'F'\"\"*!\"\"F1F1
" }{TEXT -1 5 " for " }{XPPEDIT 18 0 "x^2+y^2 <= 9;" "6#1,&*$%\"xG\"\"
#\"\"\"*$%\"yGF'F(\"\"*" }{TEXT -1 52 ". Since it has been stretched \+
down, its density is " }{XPPEDIT 18 0 "rho = 3+(x^2+y^2)/9;" "6#/%$rho
G,&\"\"$\"\"\"*&,&*$%\"xG\"\"#F'*$%\"yGF,F'F'\"\"*!\"\"F'" }{TEXT -1
1 " " }{XPPEDIT 18 0 "gm/(cm^2);" "6#*&%#gmG\"\"\"*$%#cmG\"\"#!\"\"" }
{TEXT -1 116 " which is less in the middle and more at the edge. We w
ant to find the mass and center of mass of the rubber sheet." }}{PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "We start by par
ametrizing the sheet in cylindrical (or polar) coordinates:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "R:=MF([r,theta],[r*cos(theta
),r*sin(theta),2-2^(2-r^2/9)]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
11 "and plot it" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 117 "plot3d(
R(r,theta), r=0..3, theta=0..2*Pi, scaling=constrained, style=PATCHCON
TOUR, shading=ZHUE, orientation=[0,70]);" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 27 "Then we define the density:" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 32 "rho:=MF([x,y,z], 3+(x^2+y^2)/9);" }}}{EXCHG {PARA 0 "
" 0 "" {TEXT -1 12 "The mass is " }{XPPEDIT 18 0 "M = Int(rho,S);" "6#
/%\"MG-%$IntG6$%$rhoG%\"SG" }{XPPEDIT 18 0 "` ` = Int(Int(rho(R)*abs(N
),r = 0 .. 3),theta = 0 .. 2*Pi);" "6#/%\"~G-%$IntG6$-F&6$*&-%$rhoG6#%
\"RG\"\"\"-%$absG6#%\"NGF//%\"rG;\"\"!\"\"$/%&thetaG;F7*&\"\"#F/%#PiGF
/" }{TEXT -1 48 ". So we next evaluate the density on the curve:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "rhoR:=simplify(rho(op(R(r,th
eta))));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Then we compute the t
angent and normal vectors:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
23 "Ru:=diff(R(r,theta),r);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
31 "Rtheta:=diff(R(r,theta),theta);" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 16 "N:=Ru &x Rtheta;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
30 "So the length of the normal is" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 21 "lN:=simplify(len(N));" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 16 "Thus the mass is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 64 "M:=Muint(rhoR*lN, r=0..3, theta=0..2*Pi); value(%); M:=evalf(%);
" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "So the mass is about 130 " }
{XPPEDIT 18 0 "gm;" "6#%#gmG" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 16 "By symmetry the " }{XPPEDIT 18
0 "x;" "6#%\"xG" }{TEXT -1 6 "- and " }{XPPEDIT 18 0 "y;" "6#%\"yG" }
{TEXT -1 49 "-components of the center of mass are zero. The " }
{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 18 "-component is the " }
{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 34 "-moment divided by the mass
. The " }{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 39 "-moment is found \+
by adding a factor of " }{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 124 " \+
(in terms of the curve) inside the integral. The center of mass is th
en found by dividing the first moments by the mass. " }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "Muint(rhoR*lN*R(r,theta)[3], r=0..3
, theta=0..2*Pi); zmom:=evalf(%);" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 12 "zcm:=zmom/M;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "
So the center of mass is at" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
14 "CM:=[0,0,zcm];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Another way
to compute this surface integral is to use the " }{TEXT 269 18 "Surfa
ce_int_scalar" }{TEXT -1 23 " command (or its alias " }{TEXT 270 3 "Si
s" }{TEXT -1 11 ") from the " }{TEXT 271 8 "vec_calc" }{TEXT -1 98 " p
ackage which works directly with the parametrized surface and the scal
ar function. The mass is:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
51 "Sis(rho,R, r=0..3, theta = 0 .. 2*Pi); M:=evalf(%);" }}}{EXCHG
{PARA 0 "" 0 "" {TEXT -1 12 "To find the " }{XPPEDIT 18 0 "z;" "6#%\"z
G" }{TEXT -1 42 "-moment we need a function whose value is " }
{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0
"" {MPLTEXT 1 0 18 "z0:=MF([x,y,z],z);" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 7 "So the " }{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 11 "-mome
nt is:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "Sis(rho*z0,R, r=0
..3, theta = 0 .. 2*Pi); zmom:=evalf(%);" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 8 "and the " }{XPPEDIT 18 0 "z;" "6#%\"zG" }{TEXT -1 36 "-com
ponent of the center of mass is:" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 12 "zcm:=zmom/M;" }}}}}{MARK "0 0" 0 }{VIEWOPTS 1 1 0 1
1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }