Kapitel 27
Gradient, Divergenz und Rotation
> restart:
> sf := f(x,y,z):
> vf := [fx(x,y,z), fy(x,y,z), fz(x,y,z)]:
>
> with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> grad( sf, [x,y,z] );
> grad( x+x*y*z^2, [x,y,z]);
> diverge( vf, [x,y,z]);
> diverge( [y*sin(x), x*cos(y), z], [x,y,z] );
> curl( vf, [x,y,z] );
> convert(%, matrix);
> curl( [z*sin(x), z*sin(y), sqrt(x^2+y^2)], [x,y,z] ):
> convert(%,matrix);
> vf:=[r*cos(phi),r*sin(phi),r]:
> diverge(vf, [r,phi,z], coords=cylindrical);
> alias(R=R(r,theta,phi), Theta=Theta(r,theta,phi), Phi=Phi(r,theta,phi)):
> curl( [R, Theta, Phi], [r,theta,phi], coords=spherical):
> convert(%,matrix);
> grad( f(u,v,z), [u,v,z], coords=ellcylindrical): convert(%,matrix);
> potential( [x,y^2,z^3], [x,y,z], 'p');
> p;
> grad(p, [x,y,z]);
> vecpotent( [y^2+z^2, x^2+z^2, x^2+y^2], [x,y,z], 'v');
> convert( map(simplify,v), matrix );
> curl(v, [x,y,z]);
> restart: with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> f:=[exp(x), cosh(y), sinh(z)];
> int(int(int( diverge(f,[x,y,z]), x=0..a), y=0..a), z=0..a);
> simplify(%);
> convert(%,exp);
>
> f:=[-3*y,3*x,z];
> n:=[0,0,1];
> dotprod(n,curl(f,[x,y,z]));
> int( int( 6, x=-sqrt(1-y^2)..sqrt(1-y^2)), y=-1..1);
> with(plots):
Warning, the name changecoords has been redefined
> fieldplot( [x*y^2, y*x^2], x=-1..1, y=-1..1);
> fieldplot( [ Re(sin(x+I*y)), Im(sin(x+I*y)) ], x=0..Pi, y=-1..1, axes=boxed);
> gradplot( sin(x*y), x=-1..1, y=-1..1, arrows=SLIM);
> fieldplot3d( [x,y,z], x=-1..1, y=0..Pi/2, z=0..Pi/2,
> orientation=[131,71], axes=boxed, grid=[5,5,5],
> arrows=SLIM, color=black);
>