kill(all)$

fluid : Why , div van tensor (cylindrical coordinates),version 1.0
peter.vlasschaert@gmail.com,10/06/2019

load packages
----------------------

load(lrats)$

see also : see website
===================
---------------------------------------------------------------------------------------------------------------------------
=> fluid  : divergence of tensor cylindrical coordinates( = tensor),version 1.0.
=> fluid : How to find differentation unit vector(cylindrical coordinates),version 1.0
----------------------------------------------------------------------------------------------------------------------------
before : tensor a = tensor σ

Why  ? 
======

tensor :  'second order ': σ.
-----------------------------------------

1e) notation : 'second tensor , "cylindrical coordinates"
===============================================

matrix notation  : cylindrical coordinates.
=============

Menu : Algebra : Generate Matrix

p1:genmatrix(lambda([i,j], a[i,j]), 3, 3);

cylindrical coordinates: 
1:r, 2:θ,3:z

p1a1:subst([1=r,2=θ,3=z],p1);

p1a2:[rr,rθ,rz,θr,θθ,θz,zr,zθ,zz];

p1b1:p1a1[1,1];
p1b2:p1a2[1];

p2a:makelist(concat(σ,p1a2[i]),i,1,length(p1a2));

simp, 'options'
----------------------

p2b1:[er*er,er*eθ,er*ez,eθ*er,eθ*eθ,eθ*ez,ez*er,ez*eθ,ez*ez];

p2b2:[er,er,er,eθ,eθ,eθ,ez,ez,ez];

p2b3:p2b1/p2b2;

second order : tensor 'σ'
=====================

tensor :σ
----------------

p2c1:makelist(p2a[i]*p2b2[i]*p2b3[i],i,1,length(p2b1));

math :dyadic representation of second order tensor.

p2c:σ = sum(p2c1[i],i,1,length(p2c1));

hulp :definition ( because direct evalaution in Maxima).
==============================================
otherwise : use option ,  simp : false,

p2c2:p2c1/p2b2;
p2c3:p2c1/p2b3;

differentation :::  unit vectors: see 'above'
----------------------------------------------------------------

1e) method
-----------------

p4:['diff(er,θ) = eθ,'diff(eθ,θ) = -er];

2e) method
------------------

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

p4a:lhs(p2c) = collectterms(expand(rhs(p2c)),eθ);

find :  Why component  ? 'eθ'
===========================

(eθ)^2
------------

p4a1:coeff(rhs(p4a),(eθ)^2);

p4a11:p4a1*eθ;

(eθ)
------------

p4a2:coeff(rhs(p4a),eθ);

cylindrical coordinates:gradf
--------------------------------------------

gradf : cylindrical coordinates
=========================

p5:gradf(m) := diff(m,r)*er+1/r*diff(m,θ)*eθ+diff(m,z)*ez;

p5a:gradf(p4a11+p4a2);

p5b:subst(p4,p5a);

eθ: components,missing 

p5c:expand(p5b);

p5c1:expand(p5c);

use rule:
rem :exit  eθ*eθ = 1,eθ*er = 0, scalar product.

p5c2:lratsubst([eθ*eθ =1,er*eθ=0],p5c1);

p5c3:expand(p5c2);

why : eθ component .
==================

p5d:part(p5c3,2);

Why component ez : missing.
================

1e) coef: ez
==========

p6a:coeff(rhs(p2c),ez);

2e) coef : ez^2
=============

p6b:coeff(rhs(p2c),ez^2);

p6b1:p6b*ez;

use : gradf
==========

p6c:gradf(p6a+p6b1);

use rule : 'p4'
===========

p6d:subst(p4,p6c);

rem :exit  eθ*eθ = 1,eθ*er = 0, scalar product.

p6e:lratsubst([eθ*eθ =1,er*eθ=0],p6d);

p6f:expand(p6e);

missing component why ez:

p6g:part(p6f,2);

Why component er : missing.
================

1e) coef: er
==========

p7a:coeff(rhs(p2c),er);

2e) coef : ez^2
=============

p7b:coeff(rhs(p2c),er^2);

p7b1:p7b*er;

use : gradf
==========

p7c:gradf(p7a+p7b1);

use rule : 'p4'
===========

p7d:expand(subst(p4,p7c));

use rule:
rem :exit  eθ*eθ = 1,eθ*er = 0, scalar product.

p8e:lratsubst([eθ*eθ =1,er*eθ=0],p7d);

suppose :by definition.