ecterrab

14605 Reputation

24 Badges

20 years, 98 days

MaplePrimes Activity


These are answers submitted by ecterrab

Enter your expression, highlight the input, right click and: 2D-math -> convert to -> atomic identifier, and that produces what you want, that is an arbitrary expression as a singlie variable name. This image illustrates the final result:

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

Hi Trace

There is a problem with the input syntax, you are: missing a closing parenthesis, have extra spaces after d in 'd theta' and 'd phi' (should be dtheta and dphi), and you missed a multiplication sign after r in the last term of the square of the line element. Please give a look at the revised worksheet attached, where all this is adjusted, and the nonzero components of the Ricci tensor shown.

non_zero_components_of_ricci_tensor_(reviewed).mw

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

Hi Michael
Unfortunately, there seems to be a GUI (Graphical User Interface) issue around, related to using the default document mode. Concretely, if instead of expand((13)) you open a prompt and execute > expand((13)); the result is not 0 = 0. See the attached worksheet.

I will give a further look tomorrow to see if there is a programatic (library) way to workaround this GUI issue until it is fixed.

Question_R12_(reviewed).mw

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

Hi Codge

You know, the sections plotted are projections up to 3 dimension while the phase space has more than 3 dimensions; there is no programatic way to restrict the value of one of the variables (dimensions) out of sight - in your example, p1. I didn't investigate your problem further but it springs to my mind: why don't you analyze the problem trying to determine the range of t such that p1 > 0? Then you can specify that range instead of using t = -5000..5000 as you are using. For the purpose of this investigation, you can write Hamilton equations (you can use DEtools[hamilton_eqs]), then a numerical or exact solution of the system of equations will let you visually or algebraically determine the range of t for which p1 > 0.

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

Hi

In the post on "Computer Algebra for Theoretical Physics" you see how to define a tensor whose components are the partial derivatives of something else, or a matrix, or just defined by an algebraic tensorial expression. Check please the "Examples" in the sections for "Classical Field Theory" and "General Relativity". In another previous post, "Physics, one year of developments", in the section entitled "Tensors", within the examples, equation (48) shows what you ask, the definition of a tensor in terms of the partial derivatives of another tensor. The first section on Simplification, what concerns tensors, also contains material similar to what you ask. Finally in the help page ?Physics,Examples that comes with the Maple system, there is a section on "Tensors in Special and General Relativity" that contains answers to your question and more details on how to work with tensors in Maple in general.

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

There is an issue with Dirac and these equations that I'd need to give a look at the internals, not for today. Meantime, try as shown in this image and it resolves the problem; i.e. let dsolve tackle it without knowing who is 'delta'; use the option explicit to get the solution built (see ?dsolve,details where this is expllained):

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


Hi MathyMaple

This is again a combination of premature evaluation problems. The first one is in the power operation. In Maple, debatable or not, we have

0^0

1

(1)

But then,

0^m

0

(2)

Naturally, if in a second step m assume the value0, "it is too late". But this is resolved when you load Physics, that among other things also redefines the power operation to handle noncommutative operands. So,

with(Physics)

0^m

Physics:-`^`(0, m)

(3)

:) So that issue is not there anymore. The second premature evaluation problem happens in sum, but that is also addressed within the Physics package, that allows for redefining sum: just in order for it to be free of these evaluation issues.

Setup(redefinesum = true)

[redefinesum = true]

(4)

Try now your example:

X := [0, 1, 2, 3]

[0, 1, 2, 3]

(5)

n := 2

2

(6)

sum(sum(a[k]*X[i]^k, k = 0 .. n), i = 1 .. nops(X))

4*a[0]+6*a[1]+14*a[2]

(7)

sum(sum(a[k]*X[i]^k, i = 1 .. nops(X)), k = 0 .. n)

4*a[0]+6*a[1]+14*a[2]

(8)

To have the above working you need to update your Physics library with the one distributed in the Maplesoft R&D webpage.


Download DoubleSumAndPowerEvaluationProblem.mw

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

Hi H-R 100,

You talk of A as a 2nd order tensor (two indices) but then refer to a vector operation (curl(curl(A))) that would imply on A as a vector (or tensor with 1 index). So I guess I am missing something about your question. Could you be more specific on what you mean bu curl(curl(A)) where A is not a vector but a second order tensor instead?

Meanwhile, it could also be of help for you to give a look at this previous answer "Relating 3D vectors and tensors" given in a different context (covariant derivatives) but containing all the ingredients I could imagine behind your question, related Maple input/output illustrating, and also pointers to specific free online literature related to your question.

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

Hi rit,

In a previous post, on Computer Algebra for Theoretical Physics, section "Tackling examples with the Physics package", subsection Quantum Mechanics, in the first problem: "Quantization of the energy of a particle in a magnetic field", actually about second quantization, you have the guidelines (as a sort of template-example) for the second quantization of Maxwell equations. If you want to work this problem in tensorial form, probably the next problem in that worksheet, on the tensorial relationship between the components of the quantized angular momentum operator, would help. In fact this second problem can all be done in terms of the annihilation/creation operators as done in the first problem for the energy in a magnetic field.

Note: at the end of this post on Computer Algebra for Theoretical Physics you will see a link to download a worksheet containing all the material.

If you have any more concrete question on the steps to go, please post the question here (preferred) or email me at physics@maplesoft.com.

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


You need the following Physics commands; you can load them, as I do below, or you can use the long form; ie prefix them with the package's name, for example as in Physics:-Setup.

with(Physics, Setup, Define, LeviCivita, SumOverRepeatedIndices)

[Setup, Define, LeviCivita, SumOverRepeatedIndices]

(1)

Setup is to set the dimension of the space you are working, also to set it as Euclidean (default is Minkowski with signature - - - +).

Setup(spacetimeindices = lowercaselatin, dimension = [3, `+`], quiet)

[dimension = 3, signature = `+ + +`, spacetimeindices = lowercaselatin]

(2)

You can now use Matrix or matrix. With Matrix:

A := Matrix(3, symbol = a)

Matrix(%id = 18446744078399458710)

(3)

To use Einstein's sum rule for repeated indices with an object entering a product you first need to tell to the system that the object in question is a tensor; for that you use Define

Define(a[i, j])

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], a[i, j], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, mu, nu]}

(4)

Enter now the formula for the determinant; you can use the LeviCivita command, or its abbreviation ep_

ep_[i, j, k]*a[1, i]*a[2, j]*a[3, k]

Physics:-LeviCivita[i, j, k]*a[1, i]*a[2, j]*a[3, k]

(5)

To perform the sum over the repeated indices, use SumOverRepeatedIndices

SumOverRepeatedIndices(Physics:-LeviCivita[i, j, k]*a[1, i]*a[2, j]*a[3, k])

a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1]

(6)

Compare with the Determinant of A

LinearAlgebra:-Determinant(A)

a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1]

(7)

evalb(a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1] = a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1])

true

(8)

If in (5) you want to use A, not a you need to use matrix since Matrix requires numerical indices. So, define A as the matrix

A := matrix(3, 3, proc (i, j) options operator, arrow; a[i, j] end proc)

array( 1 .. 3, 1 .. 3, [( 2, 1 ) = (a[2, 1]), ( 3, 2 ) = (a[3, 2]), ( 1, 2 ) = (a[1, 2]), ( 3, 1 ) = (a[3, 1]), ( 3, 3 ) = (a[3, 3]), ( 1, 1 ) = (a[1, 1]), ( 2, 2 ) = (a[2, 2]), ( 2, 3 ) = (a[2, 3]), ( 1, 3 ) = (a[1, 3])  ] )

(9)

The rest is the same: define A to be an object with tensorial properties (ie for which the Einstein sum rule for repeated indices is to be applied)

Define(A[i, j])

`Defined objects with tensor properties`

 

{A[i, j], Physics:-Dgamma[mu], Physics:-Psigma[mu], a[i, j], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, mu, nu]}

(10)

Enter the formula forthe determinant, now in terms of A

LeviCivita[i, j, k]*A[1, i]*A[2, j]*A[3, k]

Physics:-LeviCivita[i, j, k]*A[1, i]*A[2, j]*A[3, k]

(11)

SumOverRepeatedIndices(Physics:-LeviCivita[i, j, k]*A[1, i]*A[2, j]*A[3, k])

a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1]

(12)

evalb(a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1] = a[1, 1]*a[2, 2]*a[3, 3]-a[1, 1]*a[2, 3]*a[3, 2]-a[1, 2]*a[2, 1]*a[3, 3]+a[1, 2]*a[2, 3]*a[3, 1]+a[1, 3]*a[2, 1]*a[3, 2]-a[1, 3]*a[2, 2]*a[3, 1])

true

(13)

``


Download LeviCivitaDeterminant.mw

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

Hi nm

The update of Physics distributed on Maplesoft's R&D Physics webpage includes a version of IntegrationTools:-Combine that is free of this problem you mentioned and a couple of other ones. I.e. updating your Physics automatically fixes IntegrationTools:-Combine, as well as a number of other routines on which the Physics package relies. Theses fixes to other routines are also the ones already in place in the version of Maple under development where, for example, the problem you posted today does not exist since some time.

So answering your question, you do not need to patch anything, but instead - better - you can directly use the fix already in place for this problem.

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

The page to look regarding the Physics package is ?Physics,Vectors. The range for the angles is in the references, listead at the end of the main ?Physics help page; see for instance 'Coordinate Systems' at the end of Vol 1 C.T. Quantum Mechanics.  So, theta ranges from 0 to Pi and phi from 0 to 2 Pi.

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

Hi

dsolve returns a sequence of solutions, each of which is of type equation, if possible with the unknown isolated on the left-hand-side, otherwise the implicit solution is all on the left-hand and the right-hand side is always equal to 0.

The sequence of solutions could be null (i.e. no solution at all was found). So, when no solution got found, dsolve(...) returns NULL.

Finally, if the equation(s) passed or the unknows were indicated as a system, i.e. enclosed in {} or [], the ouptut is a sequence of solution sets (i.e. the solutions enclosed within a set, unless the system of equations is nonlinear; more is explained in ?dsolve,details).

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

Generally speaking, the answer to your question is: use simplify, as in:

 

If simplify doesn't do what you want, the please post the expression you want to rewrite in terms of Re(z) so that one could see what is the appropriate command or combination of them that would work.

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

Michael

Recalling, generally speaking, a tetrad is defined up to a (6-parameter) Lorentz transformation. Therefore, there are infinitely many possible choices. So it is not the case that e_[1,mu] d_[mu](F) should have any only one particular form. That value depends on the choice of the tetrad.

Recall as well that even specifying that the thetrad is orhonormal (this is Physics's default value), or null, still does not define the tetrad univocally. Formulas 3.14 and 3.15 of Stephani's book "Exact Solutions to Einstein's equations" show how to transform the tetrad in different ways. Those formulas can be used rigth away within Physics. The same formulas are displayed in the help page for DifferentialGeometry:-Tensor:-NullTetradTransformation.

Having said that, about the directional (tetrad) derivative: just write the d_ operator with a tetrad index. By default, lowercase latin is used for tetrad when you load Tetrads, so enter d_[a](F) and that will suffice; it is the same as e_[a,mu]*d_[mu](F). Yes you can then use SumOverRepeatedIndices, or to get the four values (one for each value of the index a) you can use TensorArray, which automatically uses SumOverRepeatedIndices (unless you ask not to do that with optional arguments; this is explained in ?TensorArray).

So all boils down to your choice of tetrad ... I wrote about this when replying to your previous post related to the same problem. Perhaps if you tell (worksheet) what is the tetrad that you have in mind to work with? As said in that previous reply, you can always indicate the tetrad directly to Physics, and all in the package will take that indication into account. You set the tetrad to be what you prefer via Setup(tetrad = ....) or Setup(e_ = ...) both work. Or, you can take the tetrad computed by the package by default (orthonormal or null), then use formulas 3.14 and 3.15 of Stephani's book to produce another tetrad, fix the parameters so that it is the more convenient one for you (e.g. it could be principal axis), then set it as said using Setup.

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

First 43 44 45 46 47 48 49 Last Page 45 of 60