load(ctensr)$ load(itensor)$ /*load("contrib/tensor/tentex.lisp")$*/ (bothcases:false,metric:G)$ M(L1,L2):=H([],[L2[1]])*H([],[L2[2]])/(4*%pi) -1/(8*%pi)*G([],L2)*G([i1,i2])*H([],[i1])*H([],[i2])$ ST(L1,L2):=-g(L1,L2)*P([])+nu([])*(g([],[L2[1],N]) *covdiff(V([],[L2[2]]),N)+g([],[L2[2],N])*covdiff(V([],[L2[1]]),N))$ show(M([],[i,j])+ST([],[i,j]))$ ("the Navie-Stokes equation for the viscous axisymmetric azimuthal MHD flow")$ (metric:G,navie:comp([],[I])= lorentz(canform(rho([])*D_t([])*V([],[I])- covdiff(ST([],[I,J])+M([],[I,J]),J))),show(navie))$ ("Now generate equations for ctensr")$ exp:generate(canform(navie))$ bothcases:true$ (Omega:[R,phi,z],depends(P,[R,z]))$ ("Now define the ccoordinate representation for velocity and magnetic field. The magentic field is expressed through potentials A,B")$ (V:[0,r*U,0],dim:3,depends(U,[R,z]))$ (depends([A,B],[R,z]),H:[-diff(A,z),B/R^2,1/R*diff(R*A,R)])$ (lg:matrix([1,0,0],[0,R^2,0],[0,0,1]),ug:invert(lg),constant(nu))$ christof(false)$ ("evaluate the generated eqs")$ (MCS:mcs,LG:lg,UG:ug,DIM:3,ev(exp))$ ("Now look the equation for the angular velocity")$ expand(ratsimp(ratexpand(comp[2]))); ("the balance of the momentum on the hieght")$ expand(ratsimp(ratexpand(comp[3]))); ("the radial balance of the momentum")$ expand(ratsimp(ratexpand(comp[1])));