Flow Along a Curve

Consider a vector field v={v1,v2}=v1(x,y) i + v2(x,y) j.

Think of a small (infinitesimal) piece of curve again. The flow of v along the small piece of curve is in the direction of the unit tangent to the curve and is v times the small piece of arc length (the bigger the piece of curve, the more flow!). Adding these infinitesimal pieces up (integrating!) yields flow across the curve:

Integral of v.Tds

By the way, if the curve f(x,y) is already parametrized as r(t)={x(t),y(t)}, then r'(t)={x'(t),y'(t)} is the tangent vector, so the unit tangent vector must be
T(t)={x'(t),y(t)}/||{x'(t),y(t)}||
(Remember the vectorcalc1 notebook?)

Combining this with ds=||r'(t)|| dt yields
v.T ds = v.r'(t) dt


  Clear[v,f,r,flow]
  v[x_,y_]:={x^2,-y^2}
  f[x_,y_]:=x^2+y^2-9


  r[t_]:={3 Cos[t],3 Sin[t]}


  T=r'[t]/norm[r'[t]]


  Simplify[T]


  integrand=(v[r[t][[1]],r[t][[2]]].T) norm[r'[t]]


  Simplify[%]


  flow=Integrate[integrand,{t,0,2 Pi}]

Up to 2D Flows