itensor, ic_convert for continuity equation



Dear all,
I made an error I already in the equation definition so thank a lot to
Mr Pipin for the prompt correction.
I saw that the code as it was proposed is giving a strange result,
basically something like

            d                 d
 rho ((---------- (q )) (-- ([x, y, z])) + ...   (I hope you can understand it)
          d[x, y, z]   3    dz

which didn't mean anything to me

I changed the instruction

depends([rho,p,q,T],[ct_coords, t])

with

depends([rho,p,q,T],[x,y,z, t])

which then gives the expected result:

          drho      drho      drho    d         d         d
       q  ---- + q  ---- + q  ---- + (-- (q ) + -- (q ) + -- (q )) rho
         3  dz     2  dy     1  dx     dz   3    dy   2    dx   1


I would have liked to keep the instruction referring to "ct_coords" as
it is more general and, changing coordinate system, easier to deal
with.
Even if I can get the right result I would like to know the logic
behind this behaviour: does anybody know it?

Regards

Fabio


> Message: 5
> Date: Tue, 12 Jan 2010 22:23:26 +0800
> From: Valery Pipin <pip at iszf.irk.ru>
> Subject: Re: [Maxima] itensor, ic_convert for continuity equation
> To: maxima at math.utexas.edu
> Message-ID: <201001122223.26538.pip at iszf.irk.ru>
> Content-Type: Text/Plain; ?charset="iso-8859-1"
>
> The right code is
> derivabbrev:true$
> load(itensor)$
> load(ctensor)$
> ct_coordsys(cartesian3d)$
> cmetric()$
> christof(all)$
> depends([rho,p,q,T],[ct_coords, t])$
> imetric: g$
> eq:ishow( s = ?covdiff((rho([],[]) * q([],[a])),a))$
> ic_convert(eq);
> s: [0,0,0]$
> %th(2), ev;
>
> Look at itensor8.dem
> I belive that there should be a demo for the ?Navie-Stokes equations aswell
>
>> Dear all,
>> I am trying to get the Navier Stokes equation into MAXIMA using the
>> tensorial packages.
>> I am starting by writing the continuity eq
>>
>> d rho / d t ?+ (rho v^ i )_{ ,j } = 0
>>
>> or in latex
>> \frac{\partial \rho}{\partial t} + (\rho v^i)_{,j} ? (
>> http://tinyurl.com/ydxd6pc )
>>
>> The idea is to start with "itensor" and then convert it to "ctensor"
>> defining the metrics in order to arrive to a final equation in a
>> defined coordinate system.
>>
>> derivabbrev:true$
>> load(itensor)$
>> load(ctensor)$
>> ct_coordsys(cartesian3d)$
>> cmetric()$
>> christof(mcs)$
>> depends([rho,p,q,T],[ct_coords, t])$
>> imetric: g$
>> eq: ishow( s([a],[]) = ?covdiff((rho([],[]) * q([a],[])),b))$
>> ic_convert(eq);
>> s: [0,0,0]$
>> %th(2), ev;
>>
>> I get::
>> ?"Improper indices in - rho([], []) q([%3], []) ichr2([a, b], [%3])
>> ? ? ? ? ? ? ? ? ? ? ? ? + rho([], []) q([a], [], b) + rho([], [], b) q([a],
>> ?[]) -- an error. ?To debug this try debugmode(true);"
>>
>> I use the same indices both in LHS and RHS and "s" is a dummy var to
>> give value zero to the LHS. it is basically the same thing done in
>> "Maxima Digest, Vol 41, Issue 37" message 5 by Viktor T. Toth.
>> Do you know where I am wrong?
>>
>> Regards
>>
>> Fabio
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>
>