next up previous contents
Up: Computational Labs in Mathematica Previous: Line Integrals

Divergence and Stokes Theorem

Objectives

In this lab you will explore how Mathematica can be used to work with divergence and curl.

Initialization

First some setup so we can do the vector stuff:

      Needs["Calculus`VectorAnalysis`"]
This loads the routines for divergence (Div) and curl (Curl) among other things.

Divergence

Here's a problem from the book (number 6 on page 1027): Use the Divergence theorem to evaluate

displaymath478

if tex2html_wrap_inline480 and S: boundary of cube tex2html_wrap_inline484 , tex2html_wrap_inline486 , tex2html_wrap_inline488 . Here's how we solve it:

       F={x^2 z, -y, xyz}
       divF = Div[F]
       Integrate[Integrate[Integrate[divF,{x,0,a}],{y,0,a}],{z,0,a}]
which should give an answer of tex2html_wrap_inline490 .

Stokes Theorem

Here's a problem from the book (number 8 on page 1033): Verify Stokes Theorem where tex2html_wrap_inline496 and S: tex2html_wrap_inline500 , tex2html_wrap_inline502 . First the surfaces integral

displaymath492

       F={z-y,x-z,x-y}
       curlF = Curl[F]
       S=z+x^2+y^2-4;
       n=Grad[S]
       curlFdotn=Simplify[curlF.n/.{z->4-x^2-y^2}]
       Integrate[Integrate[curlFdotn,{x,-Sqrt[4-y^2],Sqrt[4-y^2]}],{y,-2,2}]
Now the line integral

displaymath493

       r={2 Cos[t],2 Sin[t],0}
       dr=D[r,t]
       Fdotdr=F.dr/.{x->2 Cos[t],y->2 Sin[t],z->0}
       Integrate[Fdotdr,{t,0,2 Pi}]



James Powell
Fri Feb 14 12:47:33 MST 1997