Application Center - Maplesoft

App Preview:

Flux integrals

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Sec19.3FluxIntegrals.mws

>

Computing Flux Integrals

Worksheet by Mike May, S.J.- maymk@slu.edu

Section 19.3

> restart:

Chapter 19 deals with flux integrals. It seems worthwhile to go through using Maple to set up and evaluate flux integrals over a parameterized surface. We will walk through a step by step procedure, then procude new procedures that do everything in one command.

A step by step example

First we need to define a vector field that we want to integrate, the parameterized surface we are integrating over, and the limits on the parameters. For the example we will start with the vector field [0, 0, 1]. Then the flux integral will be the area of the shadow 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;

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 a 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 := plots[fieldplot3d](vfield,x=-5..5,y=-5..5,z=-5..5,
grid=[5, 5, 5]):
paramsurf := plot3d(surface,trange, srange):
plots[display]({vfieldplot, paramsurf}, axes=boxed);

[Maple Plot]

Our second step is to set up the flux integral

> Int(Int((vfield*[Diff(surface,t)*X*Diff(surface,s)]), trange), srange);

Int(Int([0, 0, 1]*[Diff([4*t*cos(s), 2*t*sin(s), t*...

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 := [subs(x=surface[1],y=surface[2],z=surface[3], vfield[1]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[2]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[3])]:
print(`the funtion on the surface is `, paramfield);

`the funtion on the surface is `, [0, 0, 1]

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 := diff(surface, t):
tanvecs := diff(surface, s):
print(`the t-tangent vector to the surface is `, tanvect);
print(`the s-tangent vector to the surface is `, tanvecs);

`the t-tangent vector to the surface is `, [4*cos(s...

`the s-tangent vector to the surface is `, [-4*t*si...

The fifth step is to take the cross product of those tangent vectors to get a normal vector.

> normvector := linalg[crossprod](tanvect, tanvecs);

normvector := vector([0, -4*sin(s)^2*t-4*cos(s)^2*t...

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.

> integrand := simplify(linalg[dotprod](paramfield, normvector, orthogonal)):
print(`The integrand is `, integrand);

`The integrand is `, 8*t

Finally we can evaluate the integral. We do have Maple evaluate the integral in steps.

> Int(Int(integrand, trange), srange);
Int(int(integrand, trange), srange);
int(int(integrand, trange), srange);

Int(Int(8*t,t = 0 .. 2),s = 0 .. 2*Pi)

Int(16,s = 0 .. 2*Pi)

32*Pi

>

Exercise

1) Let F be the field [x, y, z]. Let S be the surface z = x^2 + y^2 with z 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 approach

For 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 := plots[fieldplot3d](vfield,xrange, yrange, zrange,
grid=[5, 5, 5]):
paramsurf := plot3d(surface,trange, srange):
plots[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 :=
[subs(x=surface[1],y=surface[2],z=surface[3], vfield[1]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[2]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[3])]:
print(`the vector field on the surface is `, paramfield);
tanvect := diff(surface, t):
tanvecs := diff(surface, s):
print(`the t-tangent vector to the surface is `, tanvect);
print(`the s-tangent vector to the surface is `, tanvecs);
normvector := linalg[crossprod](tanvect, tanvecs):
print(`the normal vector to the surface is `, normvector);
integrand := simplify(
linalg[dotprod](paramfield, normvector, orthogonal)):
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;

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);

[Maple Plot]

`the vector field `, [x, y, z]

`the surface `, [s*cos(t), s*sin(t), s^2], ` with `...

Int(Int([x, y, z]*[Diff([s*cos(t), s*sin(t), s^2],t...

`the vector field on the surface is `, [s*cos(t), s...

`the t-tangent vector to the surface is `, [-s*sin(...

`the s-tangent vector to the surface is `, [cos(t),...

`the normal vector to the surface is `, vector([2*s...

`The integrand is `, s^3

Int(Int(s^3,t = 0 .. 2*Pi),s = 0 .. 2)

Int(2*s^3*Pi,s = 0 .. 2)

`the integral is `, 8*Pi

Exercises

2) Let F = [y, x, 0] and S(s,t) = [3sin(t), 3cos(t), s+1] with 0 t 2Pi and 0 s 1. Find the flux of the vector field through the surface.

>

3) Let F = [z, y, 2x] and Sis the cone z = sqrt(x^2 + y^2) with z 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.)

>

Let F = [xyz, x+y+z, x^3y^2z] and let G be the curl of F.

Compute the flux of G through S

>

Explain why this nice result is not surprising.

>

Just the result please

It 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 :=
[subs(x=surface[1],y=surface[2],z=surface[3], vfield[1]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[2]),
subs(x=surface[1],y=surface[2],z=surface[3], vfield[3])]:
tanvect := diff(surface, t):
tanvecs := diff(surface, s):
normvector := linalg[crossprod](tanvect, tanvecs):
integrand := simplify(
linalg[dotprod](paramfield, normvector, orthogonal)):
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;

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);

8*Pi

>

Exercise 5) 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.

>

>

>

>