用Maple把Laplace算子从直角坐标系转为球坐标系形式

详细的结果和推导:


https://en.wikipedia.org/wiki/Laplace_operator


http://skisickness.com/2009/11/20/


http://mathworld.wolfram.com/LaplacesEquationSphericalCoordinates.html


http://planetmath.org/derivationofthelaplacianfromrectangulartosphericalcoordinates


方法之一


restart;
f:=g(r,theta,phi);
tx :=sin(theta)*cos(phi)*diff(f,r)+((cos(theta)*cos(phi))/r)*diff(f,theta)-(sin(phi)/(r*sin(theta)))*diff(f,phi);
tx2:=expand(sin(theta)*cos(phi)*diff(tx,r)+((cos(theta)*cos(phi))/r)*diff(tx,theta)-(sin(phi)/(r*sin(theta)))*diff(tx,phi));
ty :=sin(theta)*sin(phi)*diff(f,r)+((cos(theta)*sin(phi))/r)*diff(f,theta)+(cos(phi)/(r*sin(theta)))*diff(f,phi);
ty2:=expand(sin(theta)*sin(phi)*diff(ty,r)+((cos(theta)*sin(phi))/r)*diff(ty,theta)+(cos(phi)/(r*sin(theta)))*diff(ty,phi));
tz := cos(theta)*diff(f,r)-(sin(theta)/r)*diff(f,theta);
tz2 := expand(cos(theta)*diff(tz,r)-(sin(theta)/r)*diff(tz,theta));
del := tx2+ty2+tz2:
del := algsubs( cos(theta)^2=1-sin(theta)^2, del ):
del := expand(algsubs( cos(phi)^2=1-sin(phi)^2, del ));

方法之二


restart;
uu:=u(sqrt(x^2+y^2+z^2),arccos(z/sqrt(x^2+y^2+z^2)),arctan(y,x));
ux:=diff(uu,x):
uy:=diff(uu,y):
uz:=diff(uu,z):
uxx:=diff(ux,x):
uyy:=diff(uy,y):
uzz:=diff(uz,z):
Lapu:=simplify(uxx+uyy+uzz):assume(r,positive);
Lapu:=simplify(subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z = r*cos(theta),arctan(sin(theta)*sin(phi),sin(theta)*cos(phi))=phi,arccos(cos(theta))=theta,Lapu),trig):
Lapu:=subs(arctan(sin(theta)*sin(phi),sin(theta)*cos(phi))=phi,arccos(cos(theta))=theta,Lapu):
Lapu:=algsubs(-1+cos(theta)^2=-sin(theta)^2,Lapu):
Lapu:=expand(Lapu);

类似可以比照写出Mathematica符号计算代码,但是,在微积分符号计算和微分方程符号计算方面, maple性能更佳.

你可能感兴趣的:(函数,Maple)