Base ortonormal para o
Sistema de coordenadas Esféricas
por
Milton Procópio de Borba
> restart:
> with(linalg):
> with(student):
> with(LinearAlgebra):
Warning, the protected names norm and trace have been redefined and unprotected
Warning, the assigned name GramSchmidt now has a global binding
> R:= sqrt(x*x+y*y+z*z);
> Phi:=arctan(y/x);
> Theta:=arctan(sqrt(x*x+y*y)/z);
> v:=[x,y,z];
> vr:=grad(R,v);
> vf:=grad(Phi,v);
> vt:=grad(Theta,v);
> vr:=simplify(evalm(vr));
> vf:=simplify(evalm(vf));
> vt:=simplify(evalm(vt));
> mr:=simplify(sqrt(vr[1]^2+vr[2]^2+vr[3]^2));
> mf:=simplify(sqrt(vf[1]^2+vf[2]^2+vf[3]^2));
> mt:=simplify(sqrt(vt[1]^2+vt[2]^2+vt[3]^2));
> er:=simplify(evalm(vr/mr));
> ef:=simplify(evalm(vf/mf));
> et:=simplify(evalm(vt/mt));
Recomeçando:
> er:=convert(er, list);
> ef:=convert(ef, list);
> et:=convert(et, list);
> assume(r>0);
> er:=simplify(subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta), er),trig):
> ef:=simplify(subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta), ef),trig):
> et:=simplify(subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta), et),trig):
> assume( sin(theta)>0):ef:=normal(subs(-1+cos(theta)^2=-sin(theta)^2,ef)):
> et:=normal(subs(1-cos(theta)^2=sin(theta)^2,et)):
> alias('theta'=theta):alias('r'=r):
> e[r]=er;
> e[phi]=ef;
> e[theta]=et;
> der:=evalm(diff(er,phi)*d[phi]+diff(er,theta)*d[theta]);
> def:=evalm(diff(ef,phi)*d[phi]+diff(ef,theta)*d[theta]);
> det:=evalm(diff(et,phi)*d[phi]+diff(et,theta)*d[theta]);
> M[1,2]:=simplify(dotprod(der,ef,'orthogonal'),trig);
> M[1,3]:=simplify(dotprod(der,et,'orthogonal'),trig);
> M[2,3]:=simplify(dotprod(def,et,'orthogonal'),trig);
> for i to 3 do M[i,i]:=0:
> for j to 3 do
> if i>j then M[i,j]:=-M[j,i] fi;
> od:
> od;
> matrix(3, 3, (i,j) -> M[i,j]);
>