LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnExamples from Wednesdaydiv and curl in VectorCalculusI) Using vector calculus to find divergence and curlFirst load the VectorCalculus packagewith(VectorCalculus);You then want to set the coordinate system and name the coordinates. I will do standard Cartesian 3D.I also set the BasisFormat command to false because I like vector format ratehr than linear combination format.SetCoordinates(cartesian[x,y,z]);
BasisFormat(false);Next you define a VectorField. This is a data type used by the commands in the package.vf := VectorField(<x, x^2*y, z*y*z>);
Now the commands are straightforward.Del.vf;
Curl(vf);
Divergence(vf);LinearAlgebra[CrossProduct](Del, vf);Plotting Polar FunctionsThe question was asked about graphing functions converted to polar format.func:= (x, y) -> x^2*y/(x^2+y^2);makepolar := g -> simplify(subs({x=r*cos(theta), y=r*sin(theta)}, g));polarfunc := makepolar(func(x,y));plot3d(func(x,y),x=-1..1, y=-1..1, style=patchcontour, axes=boxed);plot3d([r,theta, polarfunc], r=0..1, theta=0..2*Pi, coords=cylindrical, style=patchcontour, axes=boxed);LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0Yn