Flow Across a Surface (Flux)
Recall that the normal vector at a point on a level curve was the gradient vector at that point.
The gradient of a "level surface" will give us the normal now.
Consider g(x,y,z)=z-f(x,y). g=c gives "level surfaces". All we care about is g=0.
The gradient will still give the normal:
The gradient of g(x,y,z) is
-Dxf i -Dyf j + 1 k
or
{-Dxf,-Dyf,1}.
The unit normal is given by
{-Dxf,-Dyf,1}/|| {-Dxf,-Dyf,1} ||
Example
In[50]:=
v[x_,y_,z_]:={x,y,z}
f[x_,y_]:=1-x^2-y^2
g[x_,y_,z_]:=z-(1-x^2-y^2)
In[51]:=
grad3[g][x,y,z]
Out[51]=
{2 x, 2 y, 1}
In[52]:=
n=grad3[g][x,y,z]/norm3[grad3[g][x,y,z]]
Out[52]=
2 x 2 y
{---------------------, ---------------------,
2 2 2 2
Sqrt[1 + 4 x + 4 y ] Sqrt[1 + 4 x + 4 y ]
1
---------------------}
2 2
Sqrt[1 + 4 x + 4 y ]
In[53]:=
Simplify[v[x,y,f[x,y]].n]
Out[53]=
2 2
1 + x + y
---------------------
2 2
Sqrt[1 + 4 x + 4 y ]
In[54]:=
Dx=D[f[x,y],x]
Dy=D[f[x,y],y]
Out[54]=
-2 x
Out[55]=
-2 y
In[56]:=
dA=Sqrt[1+Dx^2+Dy^2]
Out[56]=
2 2
Sqrt[1 + 4 x + 4 y ]
In[57]:=
Simplify[(v[x,y,f[x,y]].n)*dA]
Out[57]=
2 2
1 + x + y
In[58]:=
Integrate[1+x^2+y^2,{x,-1,1},
{y,-Sqrt[1-x^2],Sqrt[1-x^2]}]
Out[58]=
3 Pi ---- 2
Something you might have noticed while doing the example was the cancellation of the dA with ||normal vector||.
The unit normal is given by
{-Dxf,-Dyf,1}/|| {-Dxf,-Dyf,1} ||,
while dA is
dA=Sqrt[1+Dxf^2+Dyf^2] dydx
Notice that dA=|| {-Dxf,-Dyf,1} || dydx
So, surface integral v.n dA=double integral v.{-Dxf,-Dyf,1} dydx
or equivalently:
The surface integral v.n dA = double integral (-v1Dxf-v2Dyf+v3) dydx