Computing Flux IntegralsWorksheet by Mike May, S.J.- maymk@slu.eduEdited by Russell Blyth - blythrd@slu.edurestart:with(plots):with(LinearAlgebra):We use Maple to set up and evaluate flux integrals over a parameterized surfaces. We will walk through a step by step procedure, then produce new procedures that do everything in one command.A step by step exampleFirst we define a vector field that we want to integrate, the parameterized surface we integrate over, and the limits on the parameters. For the example we start with the vector field [0, 0, 1]. Then the flux integral will be the area of the shadow of the surface on the x-y plane.vfield := <0,0,1>;
surface := <4*t*cos(s), 2*t*sin(s), t*sin(s)>;
trange := t=0..2;
srange := s=0..2*Pi;Evaluating the flux integral can be broken into seven steps:1) Graph the vector field and the parameterized surface to see what it looks like. (Not required, but useful.)2) Set up the flux integral.3) Replace x, y, and z in the vector field with the expressions in s and t on the surface.4) Find the tangent vectors to the surface obtained by differentiating with respect to s and t.5) Find a normal vector to the surface by taking the cross product of the tangent vectors.6) Find the integrand of the flux integral by taking the dot product of the vector field and the normal vector.7) Evaluate the integral.The first step is to look at a graph of the vector field and the parameterized surface.vfieldplot := fieldplot3d(vfield,x=-5..5,y=-5..5,z=-5..5,
grid=[5, 5, 5]):
paramsurf := plot3d(surface,trange, srange):
display({vfieldplot, paramsurf}, axes=boxed);Our second step is to set up the flux integral.Int(Int((vfield.[Diff(surface,t)*X*Diff(surface,s)]), trange), srange);The third step is to replace x, y, and z in the vector field with the parameterizations of x and y at the appropriate point on the surface.paramfield :=
<eval(vfield[1],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[2],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[3],{x=surface[1],y=surface[2],z=surface[3]})>:
print(`the function on the surface is `, paramfield);The fourth step is to take the derivative of the parameterized surface with respect to the parameters s and t. This gives us two tangent vectors to the surface.tanvect := map(diff,surface,t):
tanvecs := map(diff,surface,s):
print(`the t-tangent vector to the surface is `, tanvect);
print(`the s-tangent vector to the surface is `, tanvecs);The fifth step is to take the cross product of those tangent vectors to get a normal vector.normvector := CrossProduct(tanvect, tanvecs);The sixth step is to evaluate the dot product in the integrand and simplify. At this point we have reduced the flux integral over a surface to an ordinary iterated integral over a section of a plane.paramfield;
normvector;
simplify(paramfield.normvector);integrand := simplify(paramfield. normvector):
print("The integrand is ", integrand);Finally we can evaluate the integral. We have Maple evaluate the integral in steps.Int(Int(integrand, trange), srange);
Int(int(integrand, trange), srange);
int(int(integrand, trange), srange);Exercise1. Let F be the field [x, y, z]. Let S be the surface z = x^2 + y^2 with z \342\211\244 4. (You probably want to parameterize the surface in terms of r and theta.) Compute the flux integral of F through S by hand. Then use Maple to check your calculations at each step.An automated approachFor convenience we block the code for those seven steps into two procedures we can use, one for plotting, and one for setting up the integral and evaluating. We also set up a black box procedure that evaluates without showing all the steps.surfaceplot := proc(vecfield, path, trange, srange,
xrange, yrange, zrange)
local vfieldplot, paramsurf;
vfieldplot := fieldplot3d(vfield,xrange, yrange, zrange,
grid=[5, 5, 5]):
paramsurf := plot3d(surface,trange, srange):
display({vfieldplot, paramsurf}, axes=boxed);
end:
fluxintegral:= proc(vecfield, surface, trange, srange)
local intval, paramfield, tanvect, tanvecs, normvector, integrand;
print("the vector field ", vecfield);
print("the surface ", surface, " with ", trange, " and ", srange);
print(Int(Int((vfield.[Diff(surface,t)*X*Diff(surface,s)]), trange), srange));
paramfield :=
<eval(vfield[1],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[2],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[3],{x=surface[1],y=surface[2],z=surface[3]})>:
print("the vector field on the surface is ", paramfield);
tanvect := map(diff,surface,t):
tanvecs := map(diff,surface,s):
print("the t-tangent vector to the surface is ", tanvect);
print("the s-tangent vector to the surface is ", tanvecs);
normvector := CrossProduct(tanvect, tanvecs):
integrand := simplify(DotProduct(paramfield, normvector, conjugate=false)):
print("the normal vector to the surface is ", normvector);
print("The integrand is ", integrand);
print(Int(Int(integrand, trange), srange));
print(Int(int(integrand, trange), srange));
intval := int(int(integrand, trange), srange);
print("the integral is ", intval);
end:With these procedures defined we can define a vector field and a parameterized surface and find the flux integral.vfield := <x, y, z>;
surface := <s*cos(t), s*sin(t), s^2>;
trange := t=0..2*Pi;
srange := s=0..2;surfaceplot(vfield, surface, trange, srange,
x=-3..3, y=-3..3, z=-1..5);
fluxintegral(vfield, surface, trange, srange);Exercises2. Let F = [y,x,0] and S(s,t) = [3sin(t), 3cos(t),s+1] with 0 \342\211\244 t \342\211\244 2Pi and 0 \342\211\244 s \342\211\244 1. Find the flux of the vector field through the surface.3. Let F = [z, y, 2x] and S is the cone z = sqrt(x^2 + y^2) with z \342\211\244 2. Find the flux of the vector field through the surface.4. The command linalg[curl](F, [x, y, z]); computes the curl of the vector F with respect to x, y, and z.
Let S be the sphere of radius 2. Describe S as a parameterized surface. (Think spherical coordinates.)Let F = [xyz, x+y+z, x^3y^2z] and let G be the curl of F.Compute the flux of G through SExplain why this nice result is not surprising.Just the result pleaseIt is also useful to have a procedure that simply evaluates the flux integral.fastfluxintegral:= proc(vecfield, surface, trange, srange)
local intval, paramfield, tanvect, tanvecs, normvector, integrand;
paramfield :=
<eval(vfield[1],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[2],{x=surface[1],y=surface[2],z=surface[3]}),
eval(vfield[3],{x=surface[1],y=surface[2],z=surface[3]})>:
tanvect := map(diff,surface,t):
tanvecs := map(diff,surface,s):
normvector := CrossProduct(tanvect, tanvecs):
integrand := simplify(DotProduct(paramfield, normvector,
conjugate=false)):
intval := int(int(integrand, trange), srange);
end:vfield := <x, y, z>;
surface := <s*cos(t), s*sin(t), s^2>;
trange := t=0..2*Pi;
srange := s=0..2;fastfluxintegral(vfield, surface, trange, srange);Exercise5. Repeat Exercise 4 with a closed surface of your choice and a vector field that is the curl of a nontrivial vector field of your choice.LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0Yn