ecterrab

14540 Reputation

24 Badges

20 years, 23 days

MaplePrimes Activity


These are answers submitted by ecterrab

This is a subtle bug; although rare to happen in the DE programs, these contain a formidably large amount of code ... Anyway it is fixed now. The fix is available to everybody as usual, in the Mapelsoft R&D web page for Differential Equations and Mathematical Functions. Note however that this fix only works in Maple 2015 so maybe you want to consider upgrading, there are good reasons for that independent of this fix. If that is not at reach for you please write me an email to physics@maplesoft.com and I will see if I can help perhaps guiding in some way for you to have this fixed in Maple 16.

Oct/6 update: Here is is a maple library, Maple16_DE_update.mla.zip, that you can drop in the lib directory of your Maple 16 installation and fixes the issue, so that now you have:

 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@Dmitry Lyakhov 

There is no command in the Physics package to automatically find the maximal abelian subalgebra of a given Lie algebra. 

I worked on an implementation of derived subalgebras in the context of differential equations time ago, and the related command is DEtools[solve_group]. I didn't find the time to do this more generally in the more modern symmetry routines of PDEtools.

But then there is the DifferentialGeometry package that we introduce not many years ago, with commands for performing these computations, in either semi-automatic way (not "one go", but almost), or step by step, with commands for performing - I'd say - all the seps.

So why don't you post your problem? Giving a look at the details it may be possible to understand why is that the existing commands are not sufficient (are they really not?) or what is that you find non-algorithmic (as far as I recall,  polynomial factorization is fully algorithmic - see for instance The complete analysis of a polynomial factorization algorithm over finite fields).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Hi Michael

Your question misses context: the d_ Physics command is an indexed differential operator that is applied onto a "derivand", you know. But your question shows nothing of that. So without further details from you, this is the basics about how it works

with(Physics); -1; Setup(coordinates = X, tensors = A)

`* Partial match of  'coordinates' against keyword 'coordinatesystems'`

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (x1, x2, x3, x4)}

 

`Systems of spacetime Coordinates are: `*{X = (x1, x2, x3, x4)}

 

[coordinatesystems = {X}, tensors = {A, Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}]

(1)

Physics:-d_[mu](A[mu](X))

Physics:-d_[mu](A[`~mu`](X), [X])

(2)

The above cannot be expressed in terms of diff or D because mu has not been given any value and, you know, the differentiation variable depends on the value of mu.

Then, if you perform the summation implicit in the repeated indices, the output already comes in diff format:

Physics:-SumOverRepeatedIndices(Physics:-d_[mu](A[`~mu`](X), [X]))

diff(A[`~1`](X), x1)+diff(A[`~2`](X), x2)+diff(A[`~3`](X), x3)+diff(A[`~4`](X), x4)

(3)

The same does not happen with the inert form %d_, but then you can convert to diff or D using convert (that you say it has no effect, but actually works fine as expected):

subs(Physics:-d_ = %d_, Physics:-d_[mu](A[`~mu`](X), [X]))

%d_[mu](A[`~mu`](X), [X])

(4)

Physics:-SumOverRepeatedIndices(%d_[mu](A[`~mu`](X), [X]))

%d_[1](A[`~1`](X), [X])+%d_[2](A[`~2`](X), [X])+%d_[3](A[`~3`](X), [X])+%d_[4](A[`~4`](X), [X])

(5)

convert(%d_[1](A[`~1`](X), [X])+%d_[2](A[`~2`](X), [X])+%d_[3](A[`~3`](X), [X])+%d_[4](A[`~4`](X), [X]), diff)

diff(A[`~1`](X), x1)+diff(A[`~2`](X), x2)+diff(A[`~3`](X), x3)+diff(A[`~4`](X), x4)

(6)

convert(%d_[1](A[`~1`](X), [X])+%d_[2](A[`~2`](X), [X])+%d_[3](A[`~3`](X), [X])+%d_[4](A[`~4`](X), [X]), D)

(D[1](A[`~1`]))(X)+(D[2](A[`~2`]))(X)+(D[3](A[`~3`]))(X)+(D[4](A[`~4`]))(X)

(7)

So what is the context for you question? What is the actual expression you want to convert that you say is not being converted?

 

Download convert_inert_d_to_D.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

I actually like and use 2D Math input, but it has its problems, frequently invisible, and this one you mention looks like that kind of thing.

The simple workaround, that more than that it is a saving of your time all around, is to not rewrite the commands found in this site you mention, but instead use these commands as already written by Maple. I mean:

  1. Open the help page by typing ?Poincare,examples (you see I am entering the question mark "?" to invoke the help page) then pressing Enter.
  2. The page that opens is actually a worksheet with everything written, you can reproduce things, play around, change, etc. and more than nothing: you don't need to spend your time rewriting :) 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

It is not, at all, that a loop could change or corrupt in this way a tetrad definition.

The answer actually is that you shall not use spacetime contracted indices, that enter your definition of RicciT, I am talking of a (see the line that starts with 'Define'), also as a loop dummy variable, because in this way you corrupt your definition (because the repeated spacetime index a ends up having the value of the loop index, that actually refers to a free, not repeated index).

So the correction in this case is to use something else for the loop dummies, for instance i and j, that do not enter as repeated indices in the definition of your tensors or, to avoid having to read things by eye to discard letters, once you choose using lowercase latin to represent spacetime indices, then, in general, use some other kind of letter for for-do-od loops, for instance alpha and beta, or A and B.

 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Damon,
This is also the kind of operation you do directly by using the Physics package; in this example using its Vectors subpackage; please give a look at the help page ?Physics,Vectors

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Tensor algebra using standard tensor indicial notation, including the LeviCivita and KroneckerDelta tensors (your epsilon and delta) is implemented in the Physics package, please give a look at the help page ?Physics.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Yes the output is correct. Recalling, differentiation with respect to a 'function' is not an ambiguous operation but just differentiation with respect to a jet variable of a jet space. Skipping technical details you can think of a jet space as one where independent variables, dependent variables (what we call 'functions') and their partial derivatives are all "independent objects in equal footing". That is, q and dq/dt are independent objects, and so  d/dq (dq/dt) = 0. See the help page for PDEtools:-ToJet. Another page you can give a look for a concrete example of the form you are posting (a bit more general) is ?Physics,diff, in the Examples section, starting at equation number (6).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

The error message tells what the problem is. Change, in your definition of a (first equation), f(x) by f(x(t)) and everything will work as you expect.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

There are two issues: first, in each DetSys you use a different name for the infinitesimals - you needto use the same name in order to compare; second and more important: you forgot to include the information of PDE1 in DetSys2, in that way it is not possible to compare things. I adjusted these two things below and showed how to compare the resulting DetSys: they are both correct and equivalent (i.e. they have the same solutions).

 

Below I intercalate comments all italized, as well as adjust a bit a few input lines to make things more straightforward.

 

with(PDEtools):

DepVars := [u(x, t), a(t), b(t)]

[u(x, t), a(t), b(t)]

(1)

declare(u(x, t), a(t), b(t))

u(x, t)*`will now be displayed as`*u

 

a(t)*`will now be displayed as`*a

 

b(t)*`will now be displayed as`*b

(2)

U, A, B := diff_table(u(x, t)), diff_table(a(t)), diff_table(b(t))

table( [(  ) = u(x, t) ] ), table( [(  ) = a(t) ] ), table( [(  ) = b(t) ] )

(3)

PDE1 := U[t]+u(x, t)*U[x]+a(t)*u(x, t)+b(t)*U[x, x, x] = 0

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x))+a(t)*u(x, t)+b(t)*(diff(diff(diff(u(x, t), x), x), x)) = 0

(4)

In this worksheet you have used _xi and _eta (with underscor) for DetSys and xi and eta (without underscore) for DetSys2, so to be sure you use the same names for the infinitesimals, set G right here and use it for both determining systems

G := [seq(xi[j](x, t, u), j = [x, t]), seq(eta[j](x, t, u), j = [u])]

[xi[x](x, t, u), xi[t](x, t, u), eta[u](x, t, u)]

(5)

PDEtools:-declare(G)

eta(x, t, u)*`will now be displayed as`*eta

 

xi(x, t, u)*`will now be displayed as`*xi

(6)

DetSys := DeterminingPDE(PDE1, G, integrabilityconditions = false)

{3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*b(t)-3*(diff(xi[x](x, t, u), u)), 3*(diff(diff(diff(xi[x](x, t, u), u), u), x))-(diff(diff(diff(eta[u](x, t, u), u), u), u)), -3*(diff(diff(eta[u](x, t, u), u), x))+3*(diff(diff(xi[x](x, t, u), x), x)), 9*(diff(diff(xi[x](x, t, u), u), x))-3*(diff(diff(eta[u](x, t, u), u), u)), 3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*b(t)-3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*b(t)-3*(diff(xi[x](x, t, u), u))*u, u*(diff(xi[t](x, t, u), x))*b(t)-3*(diff(xi[x](x, t, u), x))*b(t)+(diff(diff(diff(xi[t](x, t, u), x), x), x))*b(t)^2+(diff(b(t), t))*xi[t](x, t, u)+(diff(xi[t](x, t, u), t))*b(t)-a(t)*u*(diff(xi[t](x, t, u), u))*b(t), -(diff(diff(diff(eta[u](x, t, u), x), x), x))*b(t)^2+b(t)*(diff(eta[u](x, t, u), u))*a(t)*u-b(t)*(diff(eta[u](x, t, u), t))-(diff(eta[u](x, t, u), x))*b(t)*u-3*b(t)*(diff(xi[x](x, t, u), x))*a(t)*u+u*(a(t)*(diff(b(t), t))-b(t)*(diff(a(t), t)))*xi[t](x, t, u)-eta[u](x, t, u)*b(t)*a(t), -2*b(t)*(diff(xi[x](x, t, u), x))*u+(diff(b(t), t))*xi[t](x, t, u)*u-3*(diff(diff(diff(eta[u](x, t, u), u), x), x))*b(t)^2+(diff(diff(diff(xi[x](x, t, u), x), x), x))*b(t)^2-eta[u](x, t, u)*b(t)+b(t)*(diff(xi[x](x, t, u), t))-4*b(t)*(diff(xi[x](x, t, u), u))*a(t)*u, diff(diff(diff(xi[t](x, t, u), u), u), u), diff(diff(diff(xi[t](x, t, u), u), u), x), diff(diff(diff(xi[x](x, t, u), u), u), u), diff(diff(xi[t](x, t, u), u), u), diff(diff(xi[t](x, t, u), u), x), diff(diff(xi[t](x, t, u), x), x), diff(diff(xi[x](x, t, u), u), u), diff(xi[t](x, t, u), u), diff(xi[t](x, t, u), x), diff(xi[x](x, t, u), u)}

(7)

Instead of copying each equation by hand in order to list them, you can list the equations in this way

for EQ in sort([op(DetSys)], length) do EQ = 0 end do

diff(xi[t](x, t, u), u) = 0

 

diff(xi[t](x, t, u), x) = 0

 

diff(xi[x](x, t, u), u) = 0

 

diff(diff(xi[t](x, t, u), u), u) = 0

 

diff(diff(xi[t](x, t, u), u), x) = 0

 

diff(diff(xi[t](x, t, u), x), x) = 0

 

diff(diff(xi[x](x, t, u), u), u) = 0

 

diff(diff(diff(xi[t](x, t, u), u), u), u) = 0

 

diff(diff(diff(xi[t](x, t, u), u), u), x) = 0

 

diff(diff(diff(xi[x](x, t, u), u), u), u) = 0

 

-3*(diff(diff(eta[u](x, t, u), u), x))+3*(diff(diff(xi[x](x, t, u), x), x)) = 0

 

9*(diff(diff(xi[x](x, t, u), u), x))-3*(diff(diff(eta[u](x, t, u), u), u)) = 0

 

3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*b(t)-3*(diff(xi[x](x, t, u), u)) = 0

 

3*(diff(diff(diff(xi[x](x, t, u), u), u), x))-(diff(diff(diff(eta[u](x, t, u), u), u), u)) = 0

 

3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*b(t)-3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*b(t)-3*(diff(xi[x](x, t, u), u))*u = 0

 

u*(diff(xi[t](x, t, u), x))*b(t)-3*(diff(xi[x](x, t, u), x))*b(t)+(diff(diff(diff(xi[t](x, t, u), x), x), x))*b(t)^2+(diff(b(t), t))*xi[t](x, t, u)+(diff(xi[t](x, t, u), t))*b(t)-a(t)*u*(diff(xi[t](x, t, u), u))*b(t) = 0

 

-2*b(t)*(diff(xi[x](x, t, u), x))*u+(diff(b(t), t))*xi[t](x, t, u)*u-3*(diff(diff(diff(eta[u](x, t, u), u), x), x))*b(t)^2+(diff(diff(diff(xi[x](x, t, u), x), x), x))*b(t)^2-eta[u](x, t, u)*b(t)+b(t)*(diff(xi[x](x, t, u), t))-4*b(t)*(diff(xi[x](x, t, u), u))*a(t)*u = 0

 

-(diff(diff(diff(eta[u](x, t, u), x), x), x))*b(t)^2+b(t)*(diff(eta[u](x, t, u), u))*a(t)*u-b(t)*(diff(eta[u](x, t, u), t))-(diff(eta[u](x, t, u), x))*b(t)*u-3*b(t)*(diff(xi[x](x, t, u), x))*a(t)*u+u*(a(t)*(diff(b(t), t))-b(t)*(diff(a(t), t)))*xi[t](x, t, u)-eta[u](x, t, u)*b(t)*a(t) = 0

(8)

DepVars := [u(x, t)]

[u(x, t)]

(9)

G was already entered lines above, so I comment your input line here

 

S := PDEtools:-InfinitesimalGenerator(G, DepVars, expanded, prolongation = 3):

 

You do not need to enter the equation in Jet notation by hand (prone to mistakes); you can use ToJet instead

L := PDEtools:-ToJet(PDE1, DepVars)

u[t]+u*u[x]+a(t)*u+b(t)*u[x, x, x] = 0

(10)

S(L)

xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*u[x, x, x])+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-4*(diff(xi[x](x, t, u), u))*u[x]*u[x, x, x]-(diff(xi[t](x, t, u), u))*u[t]*u[x, x, x]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2+(diff(eta[u](x, t, u), u))*u[x, x, x]-3*(diff(xi[x](x, t, u), x))*u[x, x, x]-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3)*b(t) = 0

(11)

#In (14), on equating coefficients of various differentials of u(x,t) the determining equation are obtained which does not matches with obtained at (6), what could be the reason???

 

There is one essential issue here: the way you constructed DetSys2, it does not take into account the actual form of PDE1 anywhere. Hence your DetSys2 depends on u[x, x, x]

indets(xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*u[x, x, x])+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-4*(diff(xi[x](x, t, u), u))*u[x]*u[x, x, x]-(diff(xi[t](x, t, u), u))*u[t]*u[x, x, x]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2+(diff(eta[u](x, t, u), u))*u[x, x, x]-3*(diff(xi[x](x, t, u), x))*u[x, x, x]-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3)*b(t) = 0, specindex(u))

{u[t], u[x], u[x, t], u[x, x], u[x, x, t], u[x, x, x]}

(12)

and therefore you cannot compare it with DetSys, that does take into account the actual form of PDE1; it does not depend on u[x, x, x].

 

So let's first remove this third derivative from DetSys2 introducing the information regarding the actual form of PDE1, and in that way you have something valid to be compared with DetSys

isolate(L, u[x, x, x])

u[x, x, x] = (-u*u[x]-u[t]-a(t)*u)/b(t)

(13)

Introduce this value of u[x, x, x] in the expression for the determining system you constructed step by step using the InfinitesimalGenerator then ToJet, then isolate, now subs:

subs(u[x, x, x] = (-u*u[x]-u[t]-a(t)*u)/b(t), xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*u[x, x, x])+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-4*(diff(xi[x](x, t, u), u))*u[x]*u[x, x, x]-(diff(xi[t](x, t, u), u))*u[t]*u[x, x, x]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2+(diff(eta[u](x, t, u), u))*u[x, x, x]-3*(diff(xi[x](x, t, u), x))*u[x, x, x]-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3)*b(t) = 0)

xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*(-u*u[x]-u[t]-a(t)*u)/b(t))+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3+(diff(eta[u](x, t, u), u))*(-u*u[x]-u[t]-a(t)*u)/b(t)-3*(diff(xi[x](x, t, u), x))*(-u*u[x]-u[t]-a(t)*u)/b(t)-4*(diff(xi[x](x, t, u), u))*u[x]*(-u*u[x]-u[t]-a(t)*u)/b(t)-(diff(xi[t](x, t, u), u))*u[t]*(-u*u[x]-u[t]-a(t)*u)/b(t))*b(t) = 0

(14)

 

Now, to compare with DetSys you still need to take the coefficients of the indexed u (here representing derivatives in Jet notation)

du := indets(xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*(-u*u[x]-u[t]-a(t)*u)/b(t))+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3+(diff(eta[u](x, t, u), u))*(-u*u[x]-u[t]-a(t)*u)/b(t)-3*(diff(xi[x](x, t, u), x))*(-u*u[x]-u[t]-a(t)*u)/b(t)-4*(diff(xi[x](x, t, u), u))*u[x]*(-u*u[x]-u[t]-a(t)*u)/b(t)-(diff(xi[t](x, t, u), u))*u[t]*(-u*u[x]-u[t]-a(t)*u)/b(t))*b(t) = 0, specindex(u))

{u[t], u[x], u[x, t], u[x, x], u[x, x, t]}

(15)

 

Note that for coeff to work, you need to apply it to the left-hand side of the equation (14), and I also take the numerator of this expression - in this way there is no need to call expand

DetSys3 := {coeffs(numer(lhs(xi[t](x, t, u)*((diff(a(t), t))*u+(diff(b(t), t))*(-u*u[x]-u[t]-a(t)*u)/b(t))+eta[u](x, t, u)*(u[x]+a(t))+(-(diff(xi[x](x, t, u), u))*u[x]^2-(diff(xi[t](x, t, u), u))*u[x]*u[t]+u[x]*(diff(eta[u](x, t, u), u))-(diff(xi[x](x, t, u), x))*u[x]-(diff(xi[t](x, t, u), x))*u[t]+diff(eta[u](x, t, u), x))*u-(diff(xi[x](x, t, u), u))*u[t]*u[x]-(diff(xi[t](x, t, u), u))*u[t]^2+(diff(eta[u](x, t, u), u))*u[t]-(diff(xi[x](x, t, u), t))*u[x]-(diff(xi[t](x, t, u), t))*u[t]+diff(eta[u](x, t, u), t)+(-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]*u[t]*u[x, x]-3*(diff(xi[t](x, t, u), u))*u[x, x]*u[x, t]-3*(diff(xi[t](x, t, u), u))*u[x]*u[x, x, t]-(diff(diff(diff(xi[t](x, t, u), u), u), u))*u[x]^3*u[t]-6*(diff(diff(xi[x](x, t, u), u), u))*u[x]^2*u[x, x]-3*(diff(diff(xi[t](x, t, u), u), u))*u[x]^2*u[x, t]+3*(diff(diff(eta[u](x, t, u), u), u))*u[x]*u[x, x]-3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*u[x]^2*u[t]-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*u[x]*u[t]-9*(diff(diff(xi[x](x, t, u), u), x))*u[x]*u[x, x]-6*(diff(diff(xi[t](x, t, u), u), x))*u[x]*u[x, t]-3*(diff(diff(xi[t](x, t, u), u), x))*u[t]*u[x, x]+diff(diff(diff(eta[u](x, t, u), x), x), x)-3*(diff(xi[x](x, t, u), u))*u[x, x]^2-3*(diff(xi[t](x, t, u), x))*u[x, x, t]-3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*u[x]^3-3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*u[x]^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*u[x]^2+3*u[x]*(diff(diff(diff(eta[u](x, t, u), u), x), x))-(diff(diff(diff(xi[x](x, t, u), x), x), x))*u[x]-(diff(diff(diff(xi[t](x, t, u), x), x), x))*u[t]+3*(diff(diff(eta[u](x, t, u), u), x))*u[x, x]-3*(diff(diff(xi[x](x, t, u), x), x))*u[x, x]-3*(diff(diff(xi[t](x, t, u), x), x))*u[x, t]-(diff(diff(diff(xi[x](x, t, u), u), u), u))*u[x]^4+(diff(diff(diff(eta[u](x, t, u), u), u), u))*u[x]^3+(diff(eta[u](x, t, u), u))*(-u*u[x]-u[t]-a(t)*u)/b(t)-3*(diff(xi[x](x, t, u), x))*(-u*u[x]-u[t]-a(t)*u)/b(t)-4*(diff(xi[x](x, t, u), u))*u[x]*(-u*u[x]-u[t]-a(t)*u)/b(t)-(diff(xi[t](x, t, u), u))*u[t]*(-u*u[x]-u[t]-a(t)*u)/b(t))*b(t) = 0)), du)}

{-(diff(diff(diff(xi[t](x, t, u), u), u), u))*b(t)^2, -3*(diff(diff(diff(xi[t](x, t, u), u), u), x))*b(t)^2, -(diff(diff(diff(xi[x](x, t, u), u), u), u))*b(t)^2, -3*(diff(diff(xi[t](x, t, u), u), u))*b(t)^2, -6*(diff(diff(xi[t](x, t, u), u), x))*b(t)^2, -3*(diff(diff(xi[t](x, t, u), u), x))*b(t)^2, -3*(diff(diff(xi[t](x, t, u), x), x))*b(t)^2, -6*(diff(diff(xi[x](x, t, u), u), u))*b(t)^2, -3*(diff(xi[t](x, t, u), u))*b(t)^2, -3*(diff(xi[t](x, t, u), x))*b(t)^2, -3*(diff(xi[x](x, t, u), u))*b(t)^2, -3*(diff(diff(diff(xi[x](x, t, u), u), u), x))*b(t)^2+(diff(diff(diff(eta[u](x, t, u), u), u), u))*b(t)^2, 3*(diff(diff(eta[u](x, t, u), u), u))*b(t)^2-9*(diff(diff(xi[x](x, t, u), u), x))*b(t)^2, 3*(diff(diff(eta[u](x, t, u), u), x))*b(t)^2-3*(diff(diff(xi[x](x, t, u), x), x))*b(t)^2, 3*(diff(xi[x](x, t, u), u))*b(t)-3*(diff(diff(diff(xi[t](x, t, u), u), x), x))*b(t)^2, -3*(diff(diff(diff(xi[x](x, t, u), u), x), x))*b(t)^2+3*(diff(diff(diff(eta[u](x, t, u), u), u), x))*b(t)^2+3*b(t)*(diff(xi[x](x, t, u), u))*u, -(diff(diff(diff(xi[t](x, t, u), x), x), x))*b(t)^2-(diff(b(t), t))*xi[t](x, t, u)-(diff(xi[t](x, t, u), t))*b(t)+3*(diff(xi[x](x, t, u), x))*b(t)+a(t)*u*(diff(xi[t](x, t, u), u))*b(t)-u*(diff(xi[t](x, t, u), x))*b(t), 3*(diff(diff(diff(eta[u](x, t, u), u), x), x))*b(t)^2-(diff(diff(diff(xi[x](x, t, u), x), x), x))*b(t)^2-b(t)*(diff(xi[x](x, t, u), t))+eta[u](x, t, u)*b(t)+4*b(t)*(diff(xi[x](x, t, u), u))*a(t)*u+2*b(t)*(diff(xi[x](x, t, u), x))*u-(diff(b(t), t))*xi[t](x, t, u)*u, (diff(eta[u](x, t, u), x))*b(t)*u+eta[u](x, t, u)*b(t)*a(t)+(diff(diff(diff(eta[u](x, t, u), x), x), x))*b(t)^2+b(t)*(diff(eta[u](x, t, u), t))-b(t)*(diff(eta[u](x, t, u), u))*a(t)*u+3*b(t)*(diff(xi[x](x, t, u), x))*a(t)*u+xi[t](x, t, u)*(diff(a(t), t))*b(t)*u-xi[t](x, t, u)*(diff(b(t), t))*a(t)*u}

(16)

Now it is time to compare. The simplest way to do it is: "Reduce one system using the other and you should obtain 0 for all of its equations". If that is happens, then both systems have the same solution, regardless of whether one system has some equations further simplified removing constant factors etc.

 

To reduce systems you can use the ReducedForm command. Start with detecting the variables here - the unknown of these determining systems, these are the infinitesimals

Vars := remove(has, indets(DetSys3, unknown), {a, b})

{eta[u](x, t, u), xi[t](x, t, u), xi[x](x, t, u)}

(17)

Reduce now DetSys3, obtained going one step at a time using InfinitesimalGenerator, using DetSys obtained in one go using DeterminingPDE

PDEtools:-ReducedForm(DetSys3, DetSys, Vars)

`casesplit/ans`([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [])

(18)

That by itself tells that all the solutions of DetSys are also solutions of DetSys3. Let's see now whether the reversed statement is also true

PDEtools:-ReducedForm(DetSys, DetSys3, Vars)

`casesplit/ans`([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [])

(19)

Hence, all solutions of DetSys3 are also solutions of DetSys, from where these two systems just have the same solution, given by

pdsolve(DetSys, Vars)

{eta[u](x, t, u) = exp(Int(-a(t), t))*_C2, xi[t](x, t, u) = 0, xi[x](x, t, u) = _C1+(Int(exp(Int(-a(t), t)), t))*_C2}

(20)

pdsolve(DetSys3, Vars)

{eta[u](x, t, u) = exp(Int(-a(t), t))*_C2, xi[t](x, t, u) = 0, xi[x](x, t, u) = _C1+(Int(exp(Int(-a(t), t)), t))*_C2}

(21)

By the way you can get the solution also in one go, and with the integration constants already specialized

PDEtools:-Infinitesimals(PDE1)

[_xi[x](x, t, u) = 1, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = 0], [_xi[x](x, t, u) = Int(exp(Int(-a(t), t)), t), _xi[t](x, t, u) = 0, _eta[u](x, t, u) = exp(Int(-a(t), t))]

(22)

Or you can use the method to reduce the independent variables of PDE1 as much as possible in one go, also displaying the intermediate solutions; you can also specify the dependency ofthe invariant solutions you are interested on, etc (give a look at the help page for this command, it has a large number of options).

PDEtools:-InvariantSolutions(PDE1, display)

invariants = [t, (u(x, t)*(Int(exp(-(Int(a(t), t))), t))-exp(-(Int(a(t), t)))*x)/(Int(exp(-(Int(a(t), t))), t))]

 

solutions = [{u(x, t) = (_C1*exp(-(Int((a(t)*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t))))/(Int(exp(-(Int(a(t), t))), t)), t)))*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t)))*x)/(Int(exp(-(Int(a(t), t))), t))}]

 

_________________________________________________

 

invariants = [t, u(x, t)]

 

solutions = [{u(x, t) = exp(-(Int(a(t), t)))*_C2}]

 

_________________________________________________

 

u(x, t) = exp(-(Int(a(t), t)))*_C1, u(x, t) = (_C1*exp(-(Int((a(t)*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t))))/(Int(exp(-(Int(a(t), t))), t)), t)))*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t)))*x)/(Int(exp(-(Int(a(t), t))), t))

(23)

So two invariant solutions can be derived from these infinitesimals. Let's test these solutions

map(pdetest, [u(x, t) = exp(-(Int(a(t), t)))*_C1, u(x, t) = (_C1*exp(-(Int((a(t)*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t))))/(Int(exp(-(Int(a(t), t))), t)), t)))*(Int(exp(-(Int(a(t), t))), t))+exp(-(Int(a(t), t)))*x)/(Int(exp(-(Int(a(t), t))), t))], PDE1)

[0, 0]

(24)

I.e. the solutions are correct

 

Download [411]_Determing_Equations_for_Variable_coefficient_KdV_(reviewed).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@escorpsy 

Just gave a look to your worksheet (BTW why do you ask your question with an exclamation mark `!`, or you intended `?` and the `!` is just a typo?).

The problem in your worksheet is that you use eval (ok...) but then in the input you pass to it you do not distinguish between mu (the covariant index) and~mu (the contravariant index). If you want to use eval, or for the case subs, to replace ~mu, then use, for instance following what I see in your worksheet, eval(expression, ~mu = ~2) and in doing so be sure that there is a blank space between = and ~2, because without that space, =~ has a different meaning (more like the zip command).

Alternatively, you may prefer to jump over these syntactic subtleties of evalsubs, etc. and just use the Physics command SubstituteTensorIndices, which will do the substitution exactly as you intended, that is, you input SubstituteTensorIndice(mu = 2, your_expression) and it will automatically replace mu = 2 or~mu = ~2. Note that SubstituteTensorIndices accepts, among others, the optional arguments evaluatetensor and evaluateexpression, so that you can use this command to work as you would expect from eval, or from subs (these two behave different, if you were not aware of that, please give a look to the corresponding help pages), including some extra flexibility that none of them have.

Edgardo S. Cheb-Terrab 
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Hi shzan,

Besides Carl's suggestion of a loop, you can also enter your problem directly as you suggested, so as a double sum, where one of the summation index is j+k = m-1. For that purpose you need to redefinesum through the Physics  package (it just extends the syntax to what you want plus a few other enhancements). So,

Physics:-Setup(redefinesum = true)

[redefinesum = true]

(1)

Now go ahead as you intended, in one go, for instance,

Sum(Sum(2^m*(D@@k)(f)*(D@@j)(f), j+k = m-1), m = 1 .. 5)

Sum(Sum(2^m*(D@@k)(f)*(D@@j)(f), j+k = m-1), m = 1 .. 5)

(2)

value(Sum(Sum(2^m*(D@@k)(f)*(D@@j)(f), j+k = m-1), m = 1 .. 5))

2*f^2+8*D(f)*f+16*(D@@2)(f)*f+8*D(f)^2+32*(D@@3)(f)*f+32*(D@@2)(f)*D(f)+64*(D@@4)(f)*f+64*(D@@3)(f)*D(f)+32*(D@@2)(f)^2

(3)

You see this is the same result as you get using Carl's loop, or his suggested rewriting of your problem in terms of a single index j (possible in this example, but not always possible)

add(add(2^m*(D@@j)(f)*(D@@(m-1-j))(f), j = 0 .. m-1), m = 1 .. 5);

2*f^2+8*D(f)*f+16*(D@@2)(f)*f+8*D(f)^2+32*(D@@3)(f)*f+32*(D@@2)(f)*D(f)+64*(D@@4)(f)*f+64*(D@@3)(f)*D(f)+32*(D@@2)(f)^2

(4)

To know more about redefinesum, check the help page of what's new in Physics in Maple 18

 

Download Multi-Index_summation.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

The results you get in your worksheet look correct to me. I corrected anyway one or two things in your input lines, added comments, and verifications. I note that you also do not say that something is wrong anywhere, you just ask whether the results are correct. Anyway, I imagine you got in doubt due to a subtletly motivating this answer below: when you compute a covariant derivaive passing a tensor component as argument, if that tensor component gets evaluated into a scalar before arriving at D_, the command receives a scalar, so the output does not contain a Christoffel symbol. It is different when the tensor component e.g. 'N[1]' arrives at D_. The details are as follows (and I suggest you to update to the latest version of Physics in order to reproduce what you see next):


restart

Physics:-Version()[2]

`2015, September 11, 0:4 hours`

(1)

with(Physics):

Physics:-Setup(math = true)

`* Partial match of  'math' against keyword 'mathematicalnotation'`

 

[mathematicalnotation = true]

(2)

g_[]

g[mu, nu] = (Matrix(4, 4, {(1, 1) = -A(r), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 2) = B(r), (2, 3) = 0, (2, 4) = 0, (3, 3) = C(r)*r^2, (3, 4) = 0, (4, 4) = C(r)*r^2*sin(theta)^2}, storage = triangular[upper], shape = [symmetric]))

(3)

PDEtools:-declare(Physics:-g_[mu, nu] = Matrix(%id = 18446744078341407198), Phi(r), N(r))

A(r)*`will now be displayed as`*A

 

B(r)*`will now be displayed as`*B

 

C(r)*`will now be displayed as`*C

 

Phi(r)*`will now be displayed as`*Phi

 

N(r)*`will now be displayed as`*N

(4)

N[nu] = [-Physics:-`^`(A(r), Physics:-`^`(2, -1)), 0, 0, 0]

N[nu] = [-A(r)^(1/2), 0, 0, 0]

(5)

Physics:-Define(%)

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], N[nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(6)

You have already defined N, no need to define it again (changes nothing)

 

This definition of Lambda could be problematic if F contains mu because the index would appear repeated more than once - just have in mind this.

Lambda := proc (F) options operator, arrow; Physics:-D_[mu](Physics:-D_[`~mu`](F)) end proc

proc (F) options operator, arrow; Physics:-D_[mu](Physics:-D_[`~mu`](F)) end proc

(7)

Here there is a mistake: you defined N[nu] in a way that depends on (r). But then you add again that functionality, so depending on the operation you do you will have N[1](r) = (-A(r)^(1/2))(r) = (A(r)(r))^(1/2). I correct here that mistake

Lambda(N[nu])

Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(8)

T[nu] = %

T[nu] = Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(9)

Physics:-Define(%)

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], N[nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], T[nu], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(10)

T[definition]

T[nu] = Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(11)

In addition, for testing purposes I will define a H[mu,nu] tensor:

H[mu, nu] = Physics:-D_[mu](N[nu])

H[mu, nu] = Physics:-D_[mu](N[nu], [X])

(12)

Physics:-Define(H[mu, nu] = Physics:-D_[mu](N[nu], [X]))

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], H[mu, nu], N[nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], T[nu], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(13)

Physics:-Setup(auto = true)

`* Partial match of  'auto' against keyword 'automaticsimplification'`

 

[automaticsimplification = true]

(14)

T[1]

(1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2))

(15)

NULL

 

So your first question is about correctness of this result (15) But, is there something that makes you think is wrong?

 

In any case what follows below is what I would do to verify this result for correctness, but first let's agree on the meaning of this expression:

 

`𝒟`[mu](N[1]) = eval(`𝒟`[mu](N[nu]), nu = 1)NULL

The relevant thing here is that the computation of the covariant derivative having a tensor component for argument will include a Christoffel term. So the operation is performed in two steps: first compute with nu, then replace nu by the number 1. Because Lambda = `𝒟`[mu]*`𝒟`[`~mu`], what I am saying is also that this is the meaning of the expression you are asking:

 

Lambda(N[1]) = eval(Lambda(N[nu]), nu = 1)

 

I will check now that the result (15) for T[1] is correct, through four different ways.

 

1) Expand the covariant derivatives in  T[nu] = `𝒟`[mu](`𝒟`[`~mu`](N[nu](r))) which is the same as rewriting it in terms of Christoffel symbols and noncovariant derivatives, then make nu = 1. This is the general approach, and the important thing is that you remove all covariant derivatives D_ before introducing any tensor component.

expand(D_[mu](D_[`~mu`](N[nu], [X]), [X]))

Physics:-g_[`~beta`, `~mu`]*(Physics:-d_[mu](Physics:-d_[beta](N[nu], [X]), [X])-Physics:-Christoffel[`~sigma`, beta, mu]*Physics:-d_[sigma](N[nu], [X])-Physics:-Christoffel[`~sigma`, mu, nu]*Physics:-d_[beta](N[sigma], [X])-N[alpha]*Physics:-d_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])+N[alpha]*Physics:-Christoffel[`~lambda`, beta, mu]*Physics:-Christoffel[`~alpha`, lambda, nu]+N[alpha]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, lambda]-N[alpha]*Physics:-Christoffel[`~alpha`, lambda, mu]*Physics:-Christoffel[`~lambda`, beta, nu]-Physics:-Christoffel[`~alpha`, beta, nu]*Physics:-d_[mu](N[alpha], [X])+Physics:-Christoffel[`~alpha`, beta, nu]*Physics:-Christoffel[`~kappa`, alpha, mu]*N[kappa])

(16)

ee := eval(Physics[g_][`~beta`, `~mu`]*(Physics[d_][mu](Physics[d_][beta](N[nu], [X]), [X])-Physics[Christoffel][`~sigma`, beta, mu]*Physics[d_][sigma](N[nu], [X])-Physics[Christoffel][`~sigma`, mu, nu]*Physics[d_][beta](N[sigma], [X])-N[alpha]*Physics[d_][mu](Physics[Christoffel][`~alpha`, beta, nu], [X])+N[alpha]*Physics[Christoffel][`~lambda`, beta, mu]*Physics[Christoffel][`~alpha`, lambda, nu]+N[alpha]*Physics[Christoffel][`~lambda`, mu, nu]*Physics[Christoffel][`~alpha`, beta, lambda]-N[alpha]*Physics[Christoffel][`~alpha`, lambda, mu]*Physics[Christoffel][`~lambda`, beta, nu]-Physics[Christoffel][`~alpha`, beta, nu]*Physics[d_][mu](N[alpha], [X])+Physics[Christoffel][`~alpha`, beta, nu]*Physics[Christoffel][`~kappa`, alpha, mu]*N[kappa]), nu = 1)

Physics:-g_[`~beta`, `~mu`]*(-(1/2)*Physics:-g_[beta, `~2`]*(-(1/2)*(diff(A(r), r))^2*Physics:-g_[mu, `~2`]/A(r)^(3/2)+(diff(diff(A(r), r), r))*Physics:-g_[mu, `~2`]/A(r)^(1/2))+(1/2)*Physics:-Christoffel[`~sigma`, beta, mu]*(diff(A(r), r))*Physics:-g_[sigma, `~2`]/A(r)^(1/2)-Physics:-Christoffel[`~sigma`, 1, mu]*Physics:-d_[beta](N[sigma], [X])-N[alpha]*Physics:-d_[mu](Physics:-Christoffel[`~alpha`, 1, beta], [X])+N[alpha]*Physics:-Christoffel[`~lambda`, beta, mu]*Physics:-Christoffel[`~alpha`, 1, lambda]+N[alpha]*Physics:-Christoffel[`~lambda`, 1, mu]*Physics:-Christoffel[`~alpha`, beta, lambda]-N[alpha]*Physics:-Christoffel[`~alpha`, lambda, mu]*Physics:-Christoffel[`~lambda`, 1, beta]-Physics:-Christoffel[`~alpha`, 1, beta]*Physics:-d_[mu](N[alpha], [X])+Physics:-Christoffel[`~alpha`, 1, beta]*Physics:-Christoffel[`~kappa`, alpha, mu]*N[kappa])

(17)

Sum over the repeated indices

SumOverRepeatedIndices(Physics[g_][`~beta`, `~mu`]*(-(1/2)*Physics[g_][beta, `~2`]*(-(1/2)*(diff(A(r), r))^2*Physics[g_][mu, `~2`]/A(r)^(3/2)+(diff(diff(A(r), r), r))*Physics[g_][mu, `~2`]/A(r)^(1/2))+(1/2)*Physics[Christoffel][`~sigma`, beta, mu]*(diff(A(r), r))*Physics[g_][sigma, `~2`]/A(r)^(1/2)-Physics[Christoffel][`~sigma`, 1, mu]*Physics[d_][beta](N[sigma], [X])-N[alpha]*Physics[d_][mu](Physics[Christoffel][`~alpha`, 1, beta], [X])+N[alpha]*Physics[Christoffel][`~lambda`, beta, mu]*Physics[Christoffel][`~alpha`, 1, lambda]+N[alpha]*Physics[Christoffel][`~lambda`, 1, mu]*Physics[Christoffel][`~alpha`, beta, lambda]-N[alpha]*Physics[Christoffel][`~alpha`, lambda, mu]*Physics[Christoffel][`~lambda`, 1, beta]-Physics[Christoffel][`~alpha`, 1, beta]*Physics[d_][mu](N[alpha], [X])+Physics[Christoffel][`~alpha`, 1, beta]*Physics[Christoffel][`~kappa`, alpha, mu]*N[kappa]))

(1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2))

(18)

That is the same you got in one go in (15) for T[1]. By the way note that you can also simplify (16), then evaluate

Physics:-Simplify(Physics:-g_[`~beta`, `~mu`]*(Physics:-d_[mu](Physics:-d_[beta](N[nu], [X]), [X])-Physics:-Christoffel[`~sigma`, beta, mu]*Physics:-d_[sigma](N[nu], [X])-Physics:-Christoffel[`~sigma`, mu, nu]*Physics:-d_[beta](N[sigma], [X])-N[alpha]*Physics:-d_[mu](Physics:-Christoffel[`~alpha`, beta, nu], [X])+N[alpha]*Physics:-Christoffel[`~lambda`, beta, mu]*Physics:-Christoffel[`~alpha`, lambda, nu]+N[alpha]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, lambda]-N[alpha]*Physics:-Christoffel[`~alpha`, lambda, mu]*Physics:-Christoffel[`~lambda`, beta, nu]-Physics:-Christoffel[`~alpha`, beta, nu]*Physics:-d_[mu](N[alpha], [X])+Physics:-Christoffel[`~alpha`, beta, nu]*Physics:-Christoffel[`~kappa`, alpha, mu]*N[kappa]))

N[alpha]*Physics:-Christoffel[`~alpha`, beta, `~kappa`]*Physics:-Christoffel[`~beta`, kappa, nu]+N[alpha]*Physics:-Christoffel[`~alpha`, kappa, nu]*Physics:-Christoffel[`~kappa`, mu, `~mu`]-N[alpha]*Physics:-d_[`~beta`](Physics:-Christoffel[`~alpha`, beta, nu], [X])-2*Physics:-Christoffel[`~beta`, kappa, nu]*Physics:-d_[`~kappa`](N[beta], [X])-Physics:-Christoffel[sigma, mu, `~mu`]*Physics:-d_[`~sigma`](N[nu], [X])+Physics:-dAlembertian(N[nu], [X])

(19)

Physics:-SumOverRepeatedIndices(eval(N[alpha]*Physics:-Christoffel[`~alpha`, beta, `~kappa`]*Physics:-Christoffel[`~beta`, kappa, nu]+N[alpha]*Physics:-Christoffel[`~alpha`, kappa, nu]*Physics:-Christoffel[`~kappa`, mu, `~mu`]-N[alpha]*Physics:-d_[`~beta`](Physics:-Christoffel[`~alpha`, beta, nu], [X])-2*Physics:-Christoffel[`~beta`, kappa, nu]*Physics:-d_[`~kappa`](N[beta], [X])-Physics:-Christoffel[sigma, mu, `~mu`]*Physics:-d_[`~sigma`](N[nu], [X])+Physics:-dAlembertian(N[nu], [X]), nu = 1))

(1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2))

(20)

 

2) A different path: sum first, then make nu = 1

T[definition]

T[nu] = Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(21)

Physics:-SumOverRepeatedIndices(T[definition])

T[nu] = -(diff(B(r), r))*(Physics:-diff(N[nu], r)+Physics:-Christoffel[`~1`, 2, nu]*A(r)^(1/2))/B(r)^2+(Physics:-diff(Physics:-diff(N[nu], r), r)+Physics:-diff(Physics:-Christoffel[`~1`, 2, nu], r)*A(r)^(1/2)+(1/2)*Physics:-Christoffel[`~1`, 2, nu]*(diff(A(r), r))/A(r)^(1/2))/B(r)+Physics:-diff(Physics:-Christoffel[`~1`, 3, nu], theta)*A(r)^(1/2)/(C(r)*r^2)+(1/2)*Physics:-Christoffel[`~2`, 1, nu]*(diff(A(r), r))/A(r)^(3/2)+((1/2)*(diff(A(r), r))/A(r)+(1/2)*(diff(B(r), r))/B(r)+((diff(C(r), r))*r+2*C(r))/(r*C(r)))*(Physics:-diff(N[nu], r)+Physics:-Christoffel[`~1`, 2, nu]*A(r)^(1/2))/B(r)+cos(theta)*Physics:-Christoffel[`~1`, 3, nu]*A(r)^(1/2)/(sin(theta)*C(r)*r^2)

(22)

eval(T[nu] = -(diff(B(r), r))*(Physics:-diff(N[nu], r)+Physics:-Christoffel[`~1`, 2, nu]*A(r)^(1/2))/B(r)^2+(Physics:-diff(Physics:-diff(N[nu], r), r)+Physics:-diff(Physics:-Christoffel[`~1`, 2, nu], r)*A(r)^(1/2)+(1/2)*Physics:-Christoffel[`~1`, 2, nu]*(diff(A(r), r))/A(r)^(1/2))/B(r)+Physics:-diff(Physics:-Christoffel[`~1`, 3, nu], theta)*A(r)^(1/2)/(C(r)*r^2)+(1/2)*Physics:-Christoffel[`~2`, 1, nu]*(diff(A(r), r))/A(r)^(3/2)+((1/2)*(diff(A(r), r))/A(r)+(1/2)*(diff(B(r), r))/B(r)+((diff(C(r), r))*r+2*C(r))/(r*C(r)))*(Physics:-diff(N[nu], r)+Physics:-Christoffel[`~1`, 2, nu]*A(r)^(1/2))/B(r)+cos(theta)*Physics:-Christoffel[`~1`, 3, nu]*A(r)^(1/2)/(sin(theta)*C(r)*r^2), nu = 1)

(1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2)) = (1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2))

(23)

3) This is a third way, one step at a time so that you can verify the results by eye. For that purposes use the first derivative represented by H

Physics:-D_[mu](H[mu, nu])

Physics:-D_[mu](H[`~mu`, nu], [X])

(24)

H[definition]

H[mu, nu] = Physics:-D_[mu](N[nu], [X])

(25)

Physics:-D_[mu](H[`~mu`, nu], [X]) = Physics:-SubstituteTensor(H[definition], Physics:-D_[mu](H[`~mu`, nu], [X]))

Physics:-D_[mu](H[`~mu`, nu], [X]) = Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(26)

So work with (24), start expanding

expand(Physics:-D_[mu](H[`~mu`, nu], [X]))

Physics:-d_[mu](H[`~mu`, nu], [X])-Physics:-Christoffel[`~alpha`, mu, nu]*H[`~mu`, alpha]+Physics:-Christoffel[`~mu`, alpha, mu]*H[`~alpha`, nu]

(27)

By eye this result is correct. Next:

Physics:-SubstituteTensor(H[definition], Physics:-d_[mu](H[`~mu`, nu], [X])-Physics:-Christoffel[`~alpha`, mu, nu]*H[`~mu`, alpha]+Physics:-Christoffel[`~mu`, alpha, mu]*H[`~alpha`, nu])

Physics:-d_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])-Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-D_[`~mu`](N[alpha], [X])+Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-D_[`~alpha`](N[nu], [X])

(28)

expand(Physics:-d_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])-Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-D_[`~mu`](N[alpha], [X])+Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-D_[`~alpha`](N[nu], [X]))

Physics:-d_[mu](Physics:-g_[`~kappa`, `~mu`]*(Physics:-d_[kappa](N[nu], [X])-Physics:-Christoffel[`~beta`, kappa, nu]*N[beta]), [X])-Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-d_[upsilon](N[alpha], [X])+Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-Christoffel[`~tau`, alpha, upsilon]*N[tau]+Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-d_[sigma](N[nu], [X])-Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-Christoffel[`~lambda`, nu, sigma]*N[lambda]

(29)

This result above is also correct by eye, you can check all the signs in the Christoffel symbols. Next:

eval(Physics:-d_[mu](Physics:-g_[`~kappa`, `~mu`]*(Physics:-d_[kappa](N[nu], [X])-Physics:-Christoffel[`~beta`, kappa, nu]*N[beta]), [X])-Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-d_[upsilon](N[alpha], [X])+Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-Christoffel[`~tau`, alpha, upsilon]*N[tau]+Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-d_[sigma](N[nu], [X])-Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-Christoffel[`~lambda`, nu, sigma]*N[lambda], nu = 1)

-Physics:-d_[mu](Physics:-g_[`~kappa`, `~mu`], [X])*((1/2)*(diff(A(r), r))*Physics:-g_[kappa, `~2`]/A(r)^(1/2)+Physics:-Christoffel[`~beta`, 1, kappa]*N[beta])-(-(1/4)*Physics:-g_[kappa, `~2`]*(diff(A(r), r))^2*Physics:-g_[mu, `~2`]/A(r)^(3/2)+(1/2)*Physics:-g_[kappa, `~2`]*(diff(diff(A(r), r), r))*Physics:-g_[mu, `~2`]/A(r)^(1/2)+Physics:-d_[mu](Physics:-Christoffel[`~beta`, 1, kappa], [X])*N[beta]+Physics:-Christoffel[`~beta`, 1, kappa]*Physics:-d_[mu](N[beta], [X]))*Physics:-g_[`~kappa`, `~mu`]-Physics:-Christoffel[`~alpha`, 1, mu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-d_[upsilon](N[alpha], [X])+Physics:-Christoffel[`~alpha`, 1, mu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-Christoffel[`~tau`, alpha, upsilon]*N[tau]-(1/2)*Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*(diff(A(r), r))*Physics:-g_[sigma, `~2`]/A(r)^(1/2)-Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-Christoffel[`~lambda`, 1, sigma]*N[lambda]

(30)

Physics:-SumOverRepeatedIndices(-Physics:-d_[mu](Physics:-g_[`~kappa`, `~mu`], [X])*((1/2)*(diff(A(r), r))*Physics:-g_[kappa, `~2`]/A(r)^(1/2)+Physics:-Christoffel[`~beta`, 1, kappa]*N[beta])-(-(1/4)*Physics:-g_[kappa, `~2`]*(diff(A(r), r))^2*Physics:-g_[mu, `~2`]/A(r)^(3/2)+(1/2)*Physics:-g_[kappa, `~2`]*(diff(diff(A(r), r), r))*Physics:-g_[mu, `~2`]/A(r)^(1/2)+Physics:-d_[mu](Physics:-Christoffel[`~beta`, 1, kappa], [X])*N[beta]+Physics:-Christoffel[`~beta`, 1, kappa]*Physics:-d_[mu](N[beta], [X]))*Physics:-g_[`~kappa`, `~mu`]-Physics:-Christoffel[`~alpha`, 1, mu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-d_[upsilon](N[alpha], [X])+Physics:-Christoffel[`~alpha`, 1, mu]*Physics:-g_[`~mu`, `~upsilon`]*Physics:-Christoffel[`~tau`, alpha, upsilon]*N[tau]-(1/2)*Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*(diff(A(r), r))*Physics:-g_[sigma, `~2`]/A(r)^(1/2)-Physics:-Christoffel[`~mu`, alpha, mu]*Physics:-g_[`~alpha`, `~sigma`]*Physics:-Christoffel[`~lambda`, 1, sigma]*N[lambda])

(1/4)*(diff(A(r), r))^2/(B(r)*A(r)^(3/2))

(31)

Again the same result.

 

4) Try computing directly a TensorArray for this definition

T[definition]

T[nu] = Physics:-D_[mu](Physics:-D_[`~mu`](N[nu], [X]), [X])

(32)

TensorArray(T[nu] = D_[mu](D_[`~mu`](N[nu], [X]), [X]))

Array(%id = 18446744078362242094)

(33)

So we have arrived to the same result going through four different paths.  Is there something concrete making you think this result would be incorrect?

 

Next you ask

NULL

 

To answer this other question, again, it is key here that the covariant derivative operator knows whether its argument is or not a tensor. So Let's first agree on the meaning:

 

Lambda(Phi(r)*N[1]*N[1]) = eval(Lambda(Phi(r)*N[alpha]*N[beta]), {alpha = 1, beta = 1})

Then start with

Lambda(Physics:-`*`(Physics:-`*`(Phi(r), N[alpha]), N[beta]))

Physics:-g_[`~kappa`, `~mu`]*(Phi(r)*Physics:-D_[mu](Physics:-d_[kappa](N[alpha], [X]), [X])*N[beta]+Phi(r)*N[alpha]*Physics:-D_[mu](Physics:-d_[kappa](N[beta], [X]), [X])+(Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[beta]-Physics:-Christoffel[`~nu`, beta, kappa]*N[nu]*Phi(r)+Phi(r)*Physics:-d_[kappa](N[beta], [X]))*Physics:-D_[mu](N[alpha], [X])+(Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[alpha]-Physics:-Christoffel[`~nu`, alpha, kappa]*N[nu]*Phi(r)+Phi(r)*Physics:-d_[kappa](N[alpha], [X]))*Physics:-D_[mu](N[beta], [X])+(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*Physics:-d_[kappa](N[alpha], [X])*N[beta]+(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[alpha]*Physics:-d_[kappa](N[beta], [X])-Phi(r)*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa])*Physics:-D_[mu](N[nu], [X])-Physics:-D_[mu](Physics:-Christoffel[`~nu`, alpha, kappa], [X])*Phi(r)*N[nu]*N[beta]-Physics:-D_[mu](Physics:-Christoffel[`~nu`, beta, kappa], [X])*Phi(r)*N[alpha]*N[nu]+Physics:-g_[mu, `~2`]*(Physics:-g_[kappa, `~2`]*(diff(diff(Phi(r), r), r))*N[beta]*N[alpha]-(diff(Phi(r), r))*N[nu]*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa])))

(34)

expand(Physics:-g_[`~kappa`, `~mu`]*(Phi(r)*Physics:-D_[mu](Physics:-d_[kappa](N[alpha], [X]), [X])*N[beta]+Phi(r)*N[alpha]*Physics:-D_[mu](Physics:-d_[kappa](N[beta], [X]), [X])+(Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[beta]-Physics:-Christoffel[`~nu`, beta, kappa]*N[nu]*Phi(r)+Phi(r)*Physics:-d_[kappa](N[beta], [X]))*Physics:-D_[mu](N[alpha], [X])+(Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[alpha]-Physics:-Christoffel[`~nu`, alpha, kappa]*N[nu]*Phi(r)+Phi(r)*Physics:-d_[kappa](N[alpha], [X]))*Physics:-D_[mu](N[beta], [X])+(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*Physics:-d_[kappa](N[alpha], [X])*N[beta]+(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[alpha]*Physics:-d_[kappa](N[beta], [X])-Phi(r)*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa])*Physics:-D_[mu](N[nu], [X])-Physics:-D_[mu](Physics:-Christoffel[`~nu`, alpha, kappa], [X])*Phi(r)*N[nu]*N[beta]-Physics:-D_[mu](Physics:-Christoffel[`~nu`, beta, kappa], [X])*Phi(r)*N[alpha]*N[nu]+Physics:-g_[mu, `~2`]*(Physics:-g_[kappa, `~2`]*(diff(diff(Phi(r), r), r))*N[beta]*N[alpha]-(diff(Phi(r), r))*N[nu]*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa]))))

-(-Phi(r)*N[beta]*Physics:-d_[mu](Physics:-d_[kappa](N[alpha], [X]), [X])-Phi(r)*N[alpha]*Physics:-d_[mu](Physics:-d_[kappa](N[beta], [X]), [X])+(Phi(r)*Physics:-Christoffel[`~sigma`, beta, mu]*N[sigma]-(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[beta]-Phi(r)*Physics:-d_[mu](N[beta], [X]))*Physics:-d_[kappa](N[alpha], [X])+(-(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[alpha]+Phi(r)*Physics:-Christoffel[`~tau`, alpha, mu]*N[tau]-Phi(r)*Physics:-d_[mu](N[alpha], [X]))*Physics:-d_[kappa](N[beta], [X])+(-Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[beta]+Physics:-Christoffel[`~nu`, beta, kappa]*N[nu]*Phi(r))*Physics:-d_[mu](N[alpha], [X])+(-Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[alpha]+Physics:-Christoffel[`~nu`, alpha, kappa]*N[nu]*Phi(r))*Physics:-d_[mu](N[beta], [X])+Phi(r)*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa])*Physics:-d_[mu](N[nu], [X])+Phi(r)*N[nu]*N[beta]*Physics:-d_[mu](Physics:-Christoffel[`~nu`, alpha, kappa], [X])+Phi(r)*N[alpha]*N[nu]*Physics:-d_[mu](Physics:-Christoffel[`~nu`, beta, kappa], [X])+Phi(r)*N[beta]*Physics:-Christoffel[`~omega`, alpha, mu]*Physics:-d_[kappa](N[omega], [X])+Phi(r)*N[beta]*Physics:-Christoffel[`~omega`, kappa, mu]*Physics:-d_[omega](N[alpha], [X])+Phi(r)*N[alpha]*Physics:-Christoffel[`~psi`, beta, mu]*Physics:-d_[kappa](N[psi], [X])+Phi(r)*N[alpha]*Physics:-Christoffel[`~psi`, kappa, mu]*Physics:-d_[psi](N[beta], [X])-(diff(diff(Phi(r), r), r))*Physics:-g_[mu, `~2`]*Physics:-g_[kappa, `~2`]*N[alpha]*N[beta]+((N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, beta, kappa]+N[sigma]*Physics:-g_[kappa, `~2`]*Physics:-Christoffel[`~sigma`, beta, mu])*N[alpha]+N[beta]*(N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, alpha, kappa]+N[tau]*Physics:-g_[kappa, `~2`]*Physics:-Christoffel[`~tau`, alpha, mu]))*(diff(Phi(r), r))-Phi(r)*(((Physics:-Christoffel[`~nu`, beta, upsilon]*Physics:-Christoffel[`~upsilon`, kappa, mu]+Physics:-Christoffel[`~nu`, kappa, upsilon]*Physics:-Christoffel[`~upsilon`, beta, mu]-Physics:-Christoffel[`~nu`, mu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, kappa])*N[nu]+N[lambda]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~nu`, beta, kappa])*N[alpha]+((-Physics:-Christoffel[`~chi`, alpha, kappa]*Physics:-Christoffel[`~nu`, chi, mu]+Physics:-Christoffel[`~chi`, alpha, mu]*Physics:-Christoffel[`~nu`, chi, kappa]+Physics:-Christoffel[`~chi`, kappa, mu]*Physics:-Christoffel[`~nu`, alpha, chi])*N[nu]+N[lambda]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~nu`, alpha, kappa])*N[beta]+N[nu]*(N[sigma]*Physics:-Christoffel[`~nu`, alpha, kappa]*Physics:-Christoffel[`~sigma`, beta, mu]+N[tau]*Physics:-Christoffel[`~nu`, beta, kappa]*Physics:-Christoffel[`~tau`, alpha, mu])))*Physics:-g_[`~kappa`, `~mu`]

(35)

eval(-(-Phi(r)*N[beta]*Physics:-d_[mu](Physics:-d_[kappa](N[alpha], [X]), [X])-Phi(r)*N[alpha]*Physics:-d_[mu](Physics:-d_[kappa](N[beta], [X]), [X])+(Phi(r)*Physics:-Christoffel[`~sigma`, beta, mu]*N[sigma]-(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[beta]-Phi(r)*Physics:-d_[mu](N[beta], [X]))*Physics:-d_[kappa](N[alpha], [X])+(-(diff(Phi(r), r))*Physics:-g_[mu, `~2`]*N[alpha]+Phi(r)*Physics:-Christoffel[`~tau`, alpha, mu]*N[tau]-Phi(r)*Physics:-d_[mu](N[alpha], [X]))*Physics:-d_[kappa](N[beta], [X])+(-Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[beta]+Physics:-Christoffel[`~nu`, beta, kappa]*N[nu]*Phi(r))*Physics:-d_[mu](N[alpha], [X])+(-Physics:-g_[kappa, `~2`]*(diff(Phi(r), r))*N[alpha]+Physics:-Christoffel[`~nu`, alpha, kappa]*N[nu]*Phi(r))*Physics:-d_[mu](N[beta], [X])+Phi(r)*(N[alpha]*Physics:-Christoffel[`~nu`, beta, kappa]+N[beta]*Physics:-Christoffel[`~nu`, alpha, kappa])*Physics:-d_[mu](N[nu], [X])+Phi(r)*N[nu]*N[beta]*Physics:-d_[mu](Physics:-Christoffel[`~nu`, alpha, kappa], [X])+Phi(r)*N[alpha]*N[nu]*Physics:-d_[mu](Physics:-Christoffel[`~nu`, beta, kappa], [X])+Phi(r)*N[beta]*Physics:-Christoffel[`~omega`, alpha, mu]*Physics:-d_[kappa](N[omega], [X])+Phi(r)*N[beta]*Physics:-Christoffel[`~omega`, kappa, mu]*Physics:-d_[omega](N[alpha], [X])+Phi(r)*N[alpha]*Physics:-Christoffel[`~psi`, beta, mu]*Physics:-d_[kappa](N[psi], [X])+Phi(r)*N[alpha]*Physics:-Christoffel[`~psi`, kappa, mu]*Physics:-d_[psi](N[beta], [X])-(diff(diff(Phi(r), r), r))*Physics:-g_[mu, `~2`]*Physics:-g_[kappa, `~2`]*N[alpha]*N[beta]+((N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, beta, kappa]+N[sigma]*Physics:-g_[kappa, `~2`]*Physics:-Christoffel[`~sigma`, beta, mu])*N[alpha]+N[beta]*(N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, alpha, kappa]+N[tau]*Physics:-g_[kappa, `~2`]*Physics:-Christoffel[`~tau`, alpha, mu]))*(diff(Phi(r), r))-Phi(r)*(((Physics:-Christoffel[`~nu`, beta, upsilon]*Physics:-Christoffel[`~upsilon`, kappa, mu]+Physics:-Christoffel[`~nu`, kappa, upsilon]*Physics:-Christoffel[`~upsilon`, beta, mu]-Physics:-Christoffel[`~nu`, mu, upsilon]*Physics:-Christoffel[`~upsilon`, beta, kappa])*N[nu]+N[lambda]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~nu`, beta, kappa])*N[alpha]+((-Physics:-Christoffel[`~chi`, alpha, kappa]*Physics:-Christoffel[`~nu`, chi, mu]+Physics:-Christoffel[`~chi`, alpha, mu]*Physics:-Christoffel[`~nu`, chi, kappa]+Physics:-Christoffel[`~chi`, kappa, mu]*Physics:-Christoffel[`~nu`, alpha, chi])*N[nu]+N[lambda]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~nu`, alpha, kappa])*N[beta]+N[nu]*(N[sigma]*Physics:-Christoffel[`~nu`, alpha, kappa]*Physics:-Christoffel[`~sigma`, beta, mu]+N[tau]*Physics:-Christoffel[`~nu`, beta, kappa]*Physics:-Christoffel[`~tau`, alpha, mu])))*Physics:-g_[`~kappa`, `~mu`], [alpha = 1, beta = 1])

Physics:-g_[`~kappa`, `~mu`]*(2*Phi(r)*N[nu]*A(r)*Physics:-d_[mu](Physics:-Christoffel[`~nu`, 1, kappa], [X])+Phi(r)*A(r)*Physics:-Christoffel[`~omega`, 1, mu]*Physics:-d_[kappa](N[omega], [X])+Phi(r)*A(r)*Physics:-Christoffel[`~psi`, 1, mu]*Physics:-d_[kappa](N[psi], [X])+2*Phi(r)*A(r)*Physics:-Christoffel[`~nu`, 1, kappa]*Physics:-d_[mu](N[nu], [X])+(diff(diff(Phi(r), r), r))*Physics:-g_[mu, `~2`]*Physics:-g_[kappa, `~2`]*A(r)^(3/2)+Phi(r)*(diff(diff(A(r), r), r))*A(r)^(1/2)*Physics:-g_[kappa, `~2`]*Physics:-g_[mu, `~2`]+((2*(diff(Phi(r), r))*Physics:-g_[kappa, `~2`]*Physics:-g_[mu, `~2`]-(1/2)*Phi(r)*(Physics:-g_[omega, `~2`]*Physics:-Christoffel[`~omega`, kappa, mu]+Physics:-g_[psi, `~2`]*Physics:-Christoffel[`~psi`, kappa, mu]))*(diff(A(r), r))+Physics:-Christoffel[`~nu`, 1, kappa]*N[nu]*Phi(r)*(N[sigma]*Physics:-Christoffel[`~sigma`, 1, mu]+N[tau]*Physics:-Christoffel[`~tau`, 1, mu]))*A(r)^(1/2)+(1/2)*(2*N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, 1, kappa]+Physics:-g_[kappa, `~2`]*(N[sigma]*Physics:-Christoffel[`~sigma`, 1, mu]+N[tau]*Physics:-Christoffel[`~tau`, 1, mu]))*Phi(r)*(diff(A(r), r))+A(r)*((2*N[nu]*Physics:-g_[mu, `~2`]*Physics:-Christoffel[`~nu`, 1, kappa]+Physics:-g_[kappa, `~2`]*(N[sigma]*Physics:-Christoffel[`~sigma`, 1, mu]+N[tau]*Physics:-Christoffel[`~tau`, 1, mu]))*(diff(Phi(r), r))-2*(((1/2)*Physics:-Christoffel[`~chi`, 1, mu]*Physics:-Christoffel[`~nu`, chi, kappa]+(1/2)*Physics:-Christoffel[`~chi`, kappa, mu]*Physics:-Christoffel[`~nu`, 1, chi]-(1/2)*Physics:-Christoffel[`~chi`, 1, kappa]*Physics:-Christoffel[`~nu`, chi, mu]+(1/2)*Physics:-Christoffel[`~nu`, 1, upsilon]*Physics:-Christoffel[`~upsilon`, kappa, mu]+(1/2)*Physics:-Christoffel[`~nu`, kappa, upsilon]*Physics:-Christoffel[`~upsilon`, 1, mu]-(1/2)*Physics:-Christoffel[`~nu`, mu, upsilon]*Physics:-Christoffel[`~upsilon`, 1, kappa])*N[nu]+N[lambda]*Physics:-Christoffel[`~lambda`, mu, nu]*Physics:-Christoffel[`~nu`, 1, kappa])*Phi(r)))/A(r)^(1/2)

(36)

Physics:-SumOverRepeatedIndices(%)

(1/2)*(-Phi(r)*(diff(A(r), r))^2+2*A(r)^2*(diff(diff(Phi(r), r), r)))/(B(r)*A(r))

(37)

Now, you will not get the same result if you enter

Lambda(Phi(r)*N[1]*N[1])

(B(r)*((diff(A(r), r))*Phi(r)+A(r)*(diff(Phi(r), r)))*Physics:-d_[mu](Physics:-g_[`~2`, `~mu`], [X])+(diff(diff(Phi(r), r), r))*A(r)+(diff(diff(A(r), r), r))*Phi(r)+(Physics:-Christoffel[`~mu`, mu, nu]*A(r)*B(r)*Physics:-g_[`~2`, `~nu`]+2*(diff(A(r), r)))*(diff(Phi(r), r))+Physics:-Christoffel[`~mu`, mu, nu]*Phi(r)*(diff(A(r), r))*Physics:-g_[`~2`, `~nu`]*B(r))/B(r)

(38)

Physics:-SumOverRepeatedIndices((B(r)*((diff(A(r), r))*Phi(r)+A(r)*(diff(Phi(r), r)))*Physics:-d_[mu](Physics:-g_[`~2`, `~mu`], [X])+(diff(diff(Phi(r), r), r))*A(r)+(diff(diff(A(r), r), r))*Phi(r)+(Physics:-Christoffel[`~mu`, mu, nu]*A(r)*B(r)*Physics:-g_[`~2`, `~nu`]+2*(diff(A(r), r)))*(diff(Phi(r), r))+Physics:-Christoffel[`~mu`, mu, nu]*Phi(r)*(diff(A(r), r))*Physics:-g_[`~2`, `~nu`]*B(r))/B(r))

(1/2)*(2*(diff(diff(Phi(r), r), r))*A(r)^2*B(r)*r*C(r)+2*(diff(diff(A(r), r), r))*Phi(r)*A(r)*B(r)*r*C(r)+(diff(A(r), r))^2*C(r)*B(r)*Phi(r)*r+5*A(r)*(r*B(r)*C(r)*(diff(Phi(r), r))+(2/5)*(-(1/2)*r*C(r)*(diff(B(r), r))+B(r)*((diff(C(r), r))*r+2*C(r)))*Phi(r))*(diff(A(r), r))+2*A(r)^2*(-(1/2)*r*C(r)*(diff(B(r), r))+B(r)*((diff(C(r), r))*r+2*C(r)))*(diff(Phi(r), r)))/(A(r)*B(r)^2*r*C(r))

(39)

And why is that? Because when you input Lambda(Phi(r)*N[1]*N[1]), N[1] gets evaluated into a scalar function before D_[mu] could perceive it is a tensor:

N[1]

-A(r)^(1/2)

(40)

You can check this with a simpler example:

Upsilon := proc (F) options operator, arrow; D_[mu](F) end proc

proc (F) options operator, arrow; Physics:-D_[mu](F) end proc

(41)

debug(D_)

Physics:-D_

(42)

Upsilon(N[1])

{--> enter Physics:-D_[mu], args = -A(r)^(1/2)

<-- exit Physics:-D_[mu] (now in Upsilon) = -(1/2)*(diff(A(r), r))*Physics:-g_[mu, ~2]/A(r)^(1/2)}

 

You see: a scalar function entered D_, and so the result has no Christoffel symbols. N[1] gets evaluated into a scalar function before D_[mu] can touch it. Compare with passing N[1] to D_[mu]

D_[mu](N[1])

{--> enter Physics:-D_[mu], args = N[1]

<-- exit Physics:-D_[mu] (now at top level) = -(1/2)*(diff(A(r), r))*Physics:-g_[mu, ~2]/A(r)^(1/2)-Physics:-Christoffel[~alpha, 1, mu]*N[alpha]}

 

Now you see N[1] arrives at D_[mu], allowing for perceiving that it is the first component of a tensor, so that there is a Christoffel symbol in the output, and in this way we have the correct meaning, as said lines above, repeating here:

 

 `&Dscr;`[mu](N[1]) = eval(`&Dscr;`[mu](N[nu]), nu = 1)

Summarizing: all the results you get look correct to me, and you need to remember, when passing tensor components to procedures that then call D_: those procedures (e.g. your Lambda) will evaluate the tensor component (e.g you N[1]) before forwarding it to D_, so that D_ will receive a scalar instead of the component of a tensor and you will miss the Christoffel symbol.


Download tensor_correct_(reviewed).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Rouben

Try please simplify(your_expression, size) and you get what you want.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Check the help page of PDEtools:-dcoeffs, it does what you are looking for, just enter 

PDEtools:-dcoeffs(PDE, u(x,y)).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

First 40 41 42 43 44 45 46 Last Page 42 of 59