MTH 212: Vector fields and Line Integrals of Vector Fields.

Example 1: 2D spin vector field.

VectorPlot[{-y,x},{x,-2,2},{y,-2,2}]

Example 2: 2D radial vector field.

VectorPlot[{x,y},{x,-1,1},{y,-1,1}]

Example 3: 3D vector field.

VectorPlot3D[{-x^2,-y^2,-z^2},{x,-1,1},{y,-1,1},{z,-1,1}]

Example 4: 3D vector field.

VectorPlot3D[{x,y,z},{x,-1,1},{y,-1,1},{z,-1,1}]

Example 5: 3D gradient field.

(*Temperature T at a point (x,y,z) in a region of space *)
T[x_,y_,z_]:= 100-x^2-y^2-z^2; 
gradT[x_,y_,z_]:= Grad[T[x,y,z],{x,y,z}]; gradT[x,y,z]
VectorPlot3D[{-2x,-2y,-2z},{x,-1,1},{y,-1,1},{z,-1,1}]

Example 6: Work done by a force field along a helix curve.

r1[t_]:= {Cos[t],Sin[t],t/6};
M1[x_,y_,z_]:=2y; N1[x_,y_,z_]:=3x; P1[x_,y_,z_]:=x+y; 
F1[x_,y_,z_]:={M1[x,y,z],N1[x,y,z], P1[x,y,z] };
Show[ParametricPlot3D[r1[t],{t,0,2Pi},PlotStyle->{Thick,Blue}],
VectorPlot3D[F1[x,y,z],{x,-1,1},{y,-1,1},{z,-1,1}]
]
(* work integral*)
workintegrand=F1[Cos[t],Sin[t],t/6].r1'[t]//FullSimplify
Integrate[workintegrand,{t,0,2Pi}]

Example 7: Plotting a vector field and a curve in the plane.

g[t_]:=Cos[t]; h[t_]:=Sin[t];
r2[t_]:= {g[t],h[t]};
M2[x_,y_]:=x-y; N2[x_,y_]:=x;
F2[x_,y_]:= {M2[x,y],N2[x,y]};
Show[VectorPlot[F2[x,y],{x,-2,2},{y,-2,2}],
ParametricPlot[r2[t],{t,0,2Pi},PlotStyle->Red]]

Computing Circulation

circulationintegrand1=F2[g[t],h[t]].r2'[t]//FullSimplify
Integrate[circulationintegrand1,{t,0,2Pi}]

Computing Flux

fluxintegrand1=M2[g[t],h[t]]*h'[t]-N2[g[t],h[t]]*g'[t]//FullSimplify
Integrate[fluxintegrand1,{t,0,2Pi}]

Example 8: Another example: the shear vector field with the same curve as in Example 7.

M3[x_,y_]:= y;
N3[x_,y_]:=0;
F3[x_,y_]:= {M3[x,y],N3[x,y]};

Show[VectorPlot[F3[x,y],{x,-2,2},{y,-2,2}],
ParametricPlot[r2[t],{t,0,2Pi},PlotStyle->Red]]

Computing Circulation

circulationintegrand2=F3[g[t],h[t]].r2'[t]//FullSimplify

Integrate[circulationintegrand2,{t,0,2Pi}]

Computing Flux

fluxintegrand2=M3[g[t],h[t]]h'[t]-N3[g[t],h[t]]g'[t]//FullSimplify

Integrate[fluxintegrand2,{t,0,2Pi}]