Vector Field Flow through and around a Circle

Manipulate[
Show[VectorPlot[field@@{x,y},{x,-3,3},{y,-3,3},VectorColorFunction->"DarkRainbow",StreamStyle->None,VectorPoints->18,VectorStyle->Thickness[0.005],VectorScale->{Medium,Small,Automatic},PlotRange->{{-3.2,3.2},{-3.2,3.2}},Epilog->{GrayLevel[0.3],Thickness[0.005],Circle[center,1]}],PlotLabel->Column[{
Row[{"flow across the circle: "
,Quiet[Integrate[(field@@{Cos[t]+center[[1]],Sin[t]+center[[2]] }).normal[t],{t,0,2 Pi}]]}],
Row[{"flow around the circle: ",
Quiet[Integrate[(field@@{Cos[t]+center[[1]],Sin[t]+center[[2]] }).tangent[t],{t,0,2 Pi}]]}]
}],
LabelStyle->Directive[Bold]],
{{center,{0,0}},{-2,-2},{2,2},Locator},{{field,{#1,#2}&,"choose field"},{{#1,#2}&->TraditionalForm@{x,y},{-#1,-#2}&->TraditionalForm@{-x,-y},{#2,-#1}&->TraditionalForm@{y,-x},{-#2,#1}&->TraditionalForm@{-y,x},
{#1^2-#2^2,#1+#2}&->TraditionalForm@{x^2-y^2,x+y},
{ #2^2,#1+#2}&->TraditionalForm@{ y^2,x+y},
{#1^2,#2^2}&->TraditionalForm@{x^2,y^2},
{1,#1^2+#2^2}&->TraditionalForm@{1,x^2+y^2}
},PopupMenu},
ControlPlacement->Top,Initialization:>(
tangent[t_]=D[{Cos[t],Sin[t]},t];
normal[t_]={tangent[t][[2]],-tangent[t][[1]]};
)]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Vector Field Flow through and around a Circle" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/VectorFieldFlowThroughAndAroundACircle/

Contributed by: Gosia Konwerska

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »