Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168728
Image: ubuntu2004

Find the flux of the vector field F(x,y,z)=<x3,x2y,x2z>\vec F(x,y,z)=\,\lt x^3,x^2y,x^2z \gt\, through the cylinder x2+y24x^2+y^2 \le4, 0z30 \le z \le 3


We use the general form of the cylinder: x2+y2a2x^2+y^2 \le a^2, 0zb0 \le z \le b so a=4=2a=\sqrt{4}=2 and b=3b=3  

We will integrate over the surfaces: Part 1: Cylinder + Part 2: Bottom + Part3: Top. Then we will check our answer with the Part 4: Divergence Theorem (aka Gauss-Ostrogradsky).


Surface 2 is the top of the cylinder S. We want SFdS\iint_S \vec F \,d \vec S

a=2; b=3; var ('u v'); var('x y z')

As always, we ran the SOLVER first (below) and then used that information to get the graphs here.

Graph 1: We use the parameterization of S that we get below to graph the surface. We split it up so we could "see" the orientation.

s=vector((a*cos(u),a*sin(u),v)) top=vector((v*cos(u),v*sin(u),b)) S=parametric_plot3d(s,(u,0,2*pi),(v,0,b),color='white',opacity=.1,plot_points=[20,20]) S1=parametric_plot3d(top,(u,0,pi/2),(v,0,a),color='blue',opacity=.7,plot_points=[20,20]) S2=parametric_plot3d(top,(u,pi/2,pi),(v,0,a),color='red',opacity=0.7,plot_points=[20,20]) S3=parametric_plot3d(top,(u,pi,3*pi/2),(v,0,a),color='green',opacity=0.7,plot_points=[20,20]) S4=parametric_plot3d(top,(u,3*pi/2,2*pi),(v,0,a),color='yellow',opacity=0.7,plot_points=[20,20]) show(S+S1+S2+S3+S4)

Graph 2: Our integrand from below is: 3v3cos2(u) 3v^3 \, cos^2(u). We translate this to: bv3cos2(u) b \,v^3 \, cos^2(u)

Click and drag to rotate. Notice that the arrows are not all the same length. We scale the vectors by vs.

As always, to get the arrows, we use the parameterization of S to get the "base point" and then use "base point" plus (n\vec n \cdot Integrand) to get the "end point". 

vs=20 tx=text3d("x",(0,-a-.18,0)) ty=text3d("y",(a+2,0,0)) vf=sum([sum([arrow3d((d*cos(c),d*sin(c),b),(d*cos(c)+0,d*sin(c)+0,b+b*d^3*cos(c)^2/vs), color=hue((c+8)/8), width=0.8) for c in [0..2*pi,step=pi/8]]) for d in [0..a,step=a/3]]) show(S+S1+S2+S3+S4+tx+ty+vf)

Preparation for using the SOLVER. 

We parameterize the surface with 2 parameters and find a unit vector n\vec n normal and pointing out from the surface.

Work particular to this problem: 

== Remember that we parameterize a disk (xp)2+(yq)2R2(x-p)^2+(y-q)^2 \le R^2 with x=vcos(u)+px=vcos(u)+p and y=vsin(u)+qy=vsin(u)+q. We set z=bz=b.

== Remember we have a=4=2a=\sqrt{4}=2 and b=3b=3.

== So: {x=vcos(u)y=vsin(u)z=bu [0,2π]v[0,a]\left\{ \begin{array}{l}x = v \cos(u) \\y = v\sin(u)\\z = b\end{array} \right.\,\,\,\,\,u \in [0,2\pi ] \,\,\,\,v \in [0,a]

== By examination, we see: n=<0,0,1>\vec n=<0,0,1>   (That is, the vector pointing straight up.)


SOLVER

Step 1: We define S\vec S, n\vec n and F\vec F. Changes with problem; input your parametrization of Sf and your vector n.

Sf=vector((v*cos(u),v*sin(u),b)) n=vector((0,0,1)) F=vector((x^3,x^2*y,x^2*z))

Step 2: The program finds the partial derivatives.

Sprime_u=diff(Sf,u) view(Sprime_u)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-v \sin\left(u\right),\,v \cos\left(u\right),\,0\right)
Sprime_v=diff(Sf,v) view(Sprime_v)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\cos\left(u\right),\,\sin\left(u\right),\,0\right)

Step 3: The program checks whether our parameterization is "orientation-preserving" or not. Check that we get 1 or -1. 
If we get 0 here, we need to change the point, e.g. (u=2.0,v=2.0). Use "real" values with decimal points. (If we get something other than +1, -1 or 0, we have made an error in step 1.)

npar=Sprime_u.cross_product(Sprime_v) np=sign((n.dot_product(npar))(u=1.0,v=1.0)) view(np)
\newcommand{\Bold}[1]{\mathbf{#1}}-1

Step 4: The program defines a standard sage function for "change of variables" for a 2-variable parametrization (surface).

The program changes the variables of F\vec F.

def changevar(f, eqn, newvar1,newvar2): return f.substitute(eqn)
F=changevar(F,x==Sf[0],u,v) F=changevar(F,y==Sf[1],u,v) F=changevar(F,z==Sf[2],u,v) view(F)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(v^{3} \cos\left(u\right)^{3},\,v^{3} \sin\left(u\right) \cos\left(u\right)^{2},\,3 \, v^{2} \cos\left(u\right)^{2}\right)

Step 5: Then program finds the mixed product and multiplies it by the orientation from step 3.

M=matrix(([F[0],F[1],F[2]],[Sprime_u[0],Sprime_u[1],Sprime_u[2]],[Sprime_v[0],Sprime_v[1],Sprime_v[2]])) Int=np*M.determinant() view(Int)
\newcommand{\Bold}[1]{\mathbf{#1}}3 \, v^{3} \sin\left(u\right)^{2} \cos\left(u\right)^{2} + 3 \, v^{3} \cos\left(u\right)^{4}

Step 6: Then program computes the integral (flux). Changes with problem - we must put in our intervals of integration.

integral(integral(Int,(u,0,2*pi)),(v,0,a))
\newcommand{\Bold}[1]{\mathbf{#1}}12 \, \pi


So our flux over the cylinder is: SFdS=12π\iint_S \vec F \,d \vec S = 12 \pi.  For general constants a and b, we have SFdS=a4bπ4\iint_S \vec F \,d \vec S = \frac{a^4b \pi}{4}

Now we must do the integral over the bottom of the cylinder, but this is easy as we need only change z=b with z=0 and n=<0,0,1>\vec n=<0,0,-1>. Then we will check our answer with the divergence (Gauss') theorem.

vs=20 tx=text3d("x",(0,-a-.18,0)) ty=text3d("y",(a+2,0,0)) vf=sum([sum([arrow3d((d*cos(c),d*sin(c),b),(d*cos(c)+0,d*sin(c)+0,b+b*d^3*cos(c)^2/vs), color=hue((c+8)/8), width=0.8) for c in [0..2*pi,step=pi/8]]) for d in [0..a,step=a/3]]) show(S+S1+S2+S3+S4+tx+ty+vf)