I try to make friends physics package and matrixes. But I am faced with difficulties. To be more specific, to consider a code:
with(Physics)
Setup(mathematicalnotation = true)
Coordinates(X)
Setup(tensors = A[mu](X))
PDEtools:-declare(A(X), p0(X), pm(X), pp(X), pt(X), U(X), m5(X))
And then I create a matrix:
pt := proc (X) options operator, arrow; Matrix(2, 2, [[p0(X), sqrt(2)*pp(X)], [sqrt(2)*pm(X), -p0(X)]]) end proc;
NULL;
Why do p0, pp, pm become function only one variable x1?
Interestingly that maple understands the next matrix
Why is only one variable?
In cases like this one, it is frequently useful to consult the documentation. In the help page for Coordinates, you read "The Coordinates command also sets an alias for a capital letter X to represent a list of coordinates ..." So: you type X and that automatically expands to x1, x2, x3, x4, while this sequence of variables is displayed as a single X. BUT, when you define a procedure, as in pt := proc(X) .... end proc, the X you see there is just a dummy representing (only one) procedure's parameter.
That answers your question: you see p0, pp, pm as functions of only one variable because pt is defined as a function of only one variable: when you execute pt(X) only the first element in the sequence, that is x1, is used, the other three are discarded. From context I understand that what you want to define is pt := proc(x1, x2, x3, x4) .... end proc. Then use it as pt(X) and you will see p0, pp, pm as functions of the four variables, which in turn are displayed as the single capital X.
Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft.