> #sfb Apr 04, 2002 > # Test next Thursday > # Some problems from the book > with(linalg):with(plots): > #19.2 #2 -- S is the surface x+y+z=1 over rect x=0..2, y=0..3 orientated upward > F:=[x,y,z];f:=1-x-y;#So the surface is defined as z = f(x,y) > surf:=plot3d(f,x=0..2,y=0..3,axes=BOXED):surf; > field:=fieldplot3d(F,x=0..2,y=0..3,z=-4..1,grid=[4,4,4],color=black):field; > display(surf,field); > dA:=[-Diff('f',x),-Diff('f',y),1]; > dA:=[-diff(f,x),-diff(f,y),1]; > Int('F_dot',A=S..'flux'); > Fsurf:=subs(z=f,F); > integrand:=dotprod(Fsurf,dA,orthogonal);integrand:=x+y+(1-x-y); > Int('F_dot',A=S..'flux')=int(int(integrand,x=0..2),y=0..3); > #19.2 #11 S is the hemisphere x^2+y^2+z^2=9 z>=0 oriented upward > F:=[x*z,0,y]; > f:=sqrt(9-x^2-y^2); > surf:=plot3d(f,x=-3..3,y=-3..3,axes=BOXED):surf; > field:=fieldplot3d(F,x=-3..3,y=-3..3,z=0..3,grid=[4,4,4],color=black):field; > display(surf,field); > dA:=[-diff(f,x),-diff(f,y),1];Fsurf:=subs(z=f,F); > integrand:=dotprod(Fsurf,dA,orthogonal); > #integrate x^2+y over x^2+y^2<=9 > int(int(((r*cos(t))^2+r*sin(t))*r,r=0..3),t=0..2*Pi); > #Use the sphere formula > Fsurf:=subs({x=3*sin(h)*cos(t),y=3*sin(h)*sin(t),z=3*cos(h)},F); > dA:=[sin(h)*cos(t),sin(h)*sin(t),cos(t)]; > integrand:=dotprod(Fsurf,dA,orthogonal); > int(int(integrand*9*sin(h),h=0..Pi/2),t=0..2*Pi); > #19.review #16 S is the cone z = sqrt(x^2+y^2) over quarter of unit circle in 1st quad orientated upward > F:=[x^2,y^2,z];f:=sqrt(x^2+y^2);dA:=[-diff(f,x),-diff(f,y),1];Fsurf:=subs(z=f,F); > integrand:=dotprod(Fsurf,dA,orthogonal); > int(int(r*(-(r*cos(t))^3/r-(r*sin(t))^3/r+r),r=0..1),t=0..Pi/2); > #20.4 #8 verify Stokes Thm, S is z=1-x^2-y^2,z>=0 orientated upward > F:=[y,z,x]; > curlF:=curl(F,[x,y,z]); > X:=cos(t);Y:=sin(t);Z:=0; > R:=[X,Y,Z]; > dr:=diff(R,t); > Fline:=subs({x=X,y=Y,z=Z},F); > lineIntegrand:=dotprod(Fline,dr,orthogonal); > Int(F_dot,'r'=C..line)=int(lineIntegrand,t=0..2*Pi); > f:=1-x^2-y^2; > Gsurf:=subs(z=f,curlF); > dA:=[-diff(f,x),-diff(f,y),1]; > surfIntegrand:=dotprod(Gsurf,dA,orthogonal); > Int('F_dot',A=S..'flux')=int(int(surfIntegrand,x=-sqrt(1-y^2)..sqrt(1-y^2)),y=-1..1); > Int('F_dot',A=S..'flux')=int(int(subs({x=cos(t),y=sin(t)},surfIntegrand)*r,r=0..1),t=0..2*Pi); > #Old Test, Same F, S is z=2*x+3*y over x=0..2, y=0..3 [Use Stokes to compute line int] WE must compute the surface integral, the flux > F;curlF; > f:=2*x+3*y;dA:=[-diff(f,x),-diff(f,y),1];Gsurf:=subs(z=f,curlF);surfIntegrand:=dotprod(Gsurf,dA,orthogonal); > int(int(surfIntegrand,x=0..2),y=0..3); > #C_1 > X:=t;Y:=0;Z:=2*t;R:=[X,Y,Z]; > dr:=diff(R,t);Fline:=subs({x=X,y=Y,z=Z},F);lineIntegrand:=dotprod(Fline,dr,orthogonal); > int(lineIntegrand,t=0..2); > #Old Test, Use Diverence Thm, V is cylinder x^2+y^2<=1,0<=z<=3, S is boundary of V, compute flux int > F:=[x*y^2,x*z^2,x^2*z]; > diverge(F,[x,y,z]); > int(int(int(r^2*r,r=0..1),z=0..3),t=0..2*Pi); >