kill(all)$

maxima: how to use table :calculation grad,div,curl  ,'cylindrical coordinates',version 1.0
peter.vlasschaert@gmail.com, 01/09/2021

ref:
==
new: 01/09/2021:maxima:differential volume element cylindrical coordinates for pde construct ,version 1.0
download  (Maxima,code)       :maximavolumedifferentialdatacylindcoordversion12021
download  (Maxima,png)         :mamaximavolumedifferentialdatacylindcoordversion12021outp
book
====
(1) schaum 's outline series : Theory and Problems of Vector Analysis  ( general coordinate systems)

general packages,option
====================

load(lrats)$

packages vector (used :curl(A)),see 'below'
=============

load(vect)$

table :cylindrical coordinates (differential)
======================

cym:matrix(
		["surface",	"direction",	"incremental","scale factor","unit vector"],
		[dz·dθ·r,	r,	dr,dr/dr,er],
		[dr·dz,	θ,	dθ·r,dθ·r/dθ,eθ],
		[dr·dθ·r,	z,	dz,dz/dz,ez]
	);

rem:r*dθ =[length]

cym1:args(cym);

cyt:table_form(cym)$

mathematics : →h : scale factors  (1)
(r,θ,z)  → (hr,hθ,hz)=(1,r,1)

gradient : incremental from table 'cyt'

gr1:∇(Φ)=1/cym[2,4]*'diff(Φ,r)*cym[2,5]+1/cym[3,4]*'diff(Φ,θ)*cym[3,5]+1/cym[4,4]*'diff(Φ,z)*cym[4,5];

gr2:∇(Φ)=sum(1/cym[i,4]*'diff(Φ,cym[i,2])*cym[i,5],i,2,4);

find : divergence :divergent cylindrical coordinates = ∇.vec(A)
----------------------------------------------------------------------------------
vec(A) =vector(A)

fist step : relation  unit vector ( dot product)
==================================

depends(er,θ);
depends(eθ,θ);

depends(eθ,θ);

why :no change direction : depends(er,r),depends(ez,z) are not dependent 
→  diff(ez,z)=0  ,diff(er,r)=0

m1:[er*er=1,eθ*eθ=1,ez*ez=1,er*eθ=0,er*ez=0,er*ez=0];
m2:[diff(er,θ)=eθ,diff(eθ,θ)=-er];
m:append(m1,m2);

second step :vec(A)

depends(Ar,r);
depends(Aθ,θ);
depends(Az,z);

mv:vec(A)=Ar*er+Aθ*eθ+Az*ez;

q1:div(A)=subst([Φ=rhs(mv)],rhs(gr2));

q2:lhs(q1)=ev(rhs(q1),diff);

q3:lhs(q1)=expand(rhs(q2));

q4:lhs(q1)=subst(m1,rhs(q3));

q5:lhs(q1)=subst(m2,rhs(q4));

q6:lhs(q1)=expand(lratsubst(m1,rhs(q5)));

rem  :

q7:1/r*'diff(r*Ar) =expand(1/r*diff(r*Ar));

q7a:subst([del(r)=1],q7);

rem : m2

cartesian unit vector
(ii,jj,kk)
explain : m2,from above.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1e) step : relation unit vector (ii,jj,kk)
-------------------------------------------------

mc1:[ii*ii=1,jj*jj=1,kk*kk=1,ii*jj=0,jj*kk=0,ii*kk=0];

2e) step : mathematical relation
--------------------------------------------

mx:er= cos(θ)*ii+sin(θ)*jj;

reverse(mx);

position :er→θ  ,e0→θ+90

mx1:eθ=subst([θ=θ+π/2],rhs(mx));

3e) step :differentation :er & eθ  with respect θ
----------------------------------------------------------------

m1xa :diff(mx,θ);

m1xb :facsum(diff(mx1,θ));

4e) step : proof  'm2'
----------------------------

m1xx:[reverse(mx),reverse(mx1)];

m1xaa:lratsubst(m1xx,m1xa);

m1xbb:lratsubst(m1xx,m1xb);

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Computation Curl(A) = ∇x A
=======================

load(vect)$

declare(A,nonscalar)$

qq:curl(A);

don't write curl not as Curl

 qq1:express(qq);

assume(r>0);

scalefactors:cylindrical coordinates transformation
========================================

scalefactors([[r*cos(θ),r*sin(θ),z],r,θ,z])$

vector: point  vec(ρ) =r*cos(θ)*ii+r*sin(θ)*jj+z*kk; →[r*cos(θ),r*sin(θ),z]

qqq:express(qq);

s1:[A[r]=Ar,A[θ]=Aθ,A[z]=Az];

qqq1:subst(s1,qqq);

suppose: below

depends(Aθ,z);

rem d(r)/dz =0;

qqq2:'diff((Aθ*r),z)=diff((Aθ*r),z);

qqqa:expand(lratsubst([qqq2],qqq1));

other way

ordergreat(er,eθ,ez)$

"∇xA="=qqqa[1]*er+qqqa[2]*eθ+qqqa[3]*ez;

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------