ecterrab

14702 Reputation

24 Badges

20 years, 240 days

MaplePrimes Activity


These are replies submitted by ecterrab

@mthkvv 

NOTE ADDED May 25: the issue mentioned below as 'to be fixed later today', is also resolved by installing the Maplesoft Physics Updates v.686 or newer.
 

The computations are performed correclyt if in the definitions you use all free indices covariant , as you see below, which is your worksheet but entering the defnitions of the tensors dv1, dv2, dv3 and dv4 using indices all covariant. I will fix the problem that arises when you Define with one index covariant the other contravariant, and post the fix in the nex version of the Physics Updates later today.

 

To the side, note that to get the matrix form there is a shortcut: [] produces the all covariant components and "[~]" the all contravariant ones. Finally, maybe you noticed maybe not: you can always post your worksheet with the contents itself visible, and you can insert text in the document: in any line (or open one above or below the cursor) by pressing Ctrl + T (or Command + T in Macintosh) or by clicking 'Text' in the context bar.

 

with(Physics)``

Setup(mathematicalnotation = true)

Coordinates(X = [t, r, theta, phi])

{X}

(1)

g_[sc]

Physics:-g_[mu, nu] = Matrix(%id = 18446744078394656638)

(2)

Define(v[mu] = (Vector[row](4, {(1) = (r-2*m)/r, (2) = 0, (3) = 0, (4) = 0})))

{Physics:-D_[mu], Physics:-Dgamma[mu], 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:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)

v[]

v[mu] = Array(%id = 18446744078294210310)

(4)

Define(dv1[mu, nu] = `▿`[nu](v[mu]))

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], dv1[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(5)

dv1[]

dv1[mu, nu] = Matrix(%id = 18446744078413868318)

(6)

Define(dv2[mu, nu] = convert(`▿`[nu](v[mu]), d_))

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], dv1[mu, nu], dv2[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(7)

dv2[]

dv2[mu, nu] = Matrix(%id = 18446744078383960062)

(8)

Define(v[mu] = (Vector[row](4, {(1) = 1, (2) = 0, (3) = 0, (4) = 0})))

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], dv1[mu, nu], dv2[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(9)

v[]

v[mu] = Array(%id = 18446744078383946438)

(10)

Define(dv3[mu, nu] = `▿`[nu](v[mu]))

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], dv1[mu, nu], dv2[mu, nu], dv3[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(11)

dv3[]

dv3[mu, nu] = Matrix(%id = 18446744078310429630)

(12)

Define(dv4[mu, nu] = convert(`▿`[nu](v[mu]), d_))

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], dv1[mu, nu], dv2[mu, nu], dv3[mu, nu], dv4[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(13)

dv4[]

dv4[mu, nu] = Matrix(%id = 18446744078431803862)

(14)

``

NULL


 

Download cov_diff_bug_3_(reviewed).mw

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

@vv 

There is only one Maple syntax indeed. Essentially, whatever you write using that syntax when the display is 1D, you can write when the display is 2D with the same meaning. But then there is also (as the 15th order term in a series expansion ...) a very small number of things that change, mostly related to not leaving a space between operators, as for example the one you mention. However, you see: with so many years using Maple, programming in Maple, and having used 1D display of input as well as 2D display of input, I never - ever -  crossed with this example you are mentioning now, simply put: wasn't even aware of it. If something, your example basically makes my point, in my opinion.

With all due respect, honest respect I have for you, vv, to think otherwise, that because of this example, then what you write when using 1D display doesn't work when using 2D display seems to me a blatant misrepresentation of the actual situation. People need to understand how this works 99.999 % of the time. It may even be useful to collect the minuscule exceptions, but not useful to think they are the issue here.

Most of the confusion about this, in fact, I think, derives from the mistake of calling these modes "1D input" and "2D input" when in reality they mean "1D display" and "2D display" of the same sequence of characters being input. Plus the fact that when using "2D display" of the input, you can, additionally, optionally, also use a space to represent multiplication, as we do with paper and pencil.

One last comment for Janhardo: what I meant by Maple syntax is not about programming. Maple syntax is just how we express mathematics on the worksheet. So 1+1 is Maple syntax, f(x), diff(f(x), x), all that is Maple syntax. 

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

 

@Steve Roper 

Just to suggest you upload the worksheet contents using the green arrow so that the contents becomes visible in Mapelprimes, without having to manually download and open the worksheet.

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

Not sure what the problem is. You do have the latest version, 669, that is what the first line shows, then you install again version 669 (that is what Physics:-Version(669) does, it install the version, that in your case it is already installed). So the first thing is that you do not need to install the Updates again.

Independent of that, I performed the same two input/output (I use macintosh) but didn't receive a kernel connection lost. I suppose clicking the restart icon should fix a problem of that kind (it is the icon to the right of the bug icon). If that doesn't work I would try closing and reopening Maple.

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

Hi

Would it be possible to post the problem itself within a worksheet? Something where it is clear what you intended to do, what is the input that you would have imagined to accomplish that, what is what you would expect to receive. Frequently, problems like this, with a clear prescription, are excellent sources for development (or otherwise, if the solution already exists, to tell you how to get that result).

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

 

@Steve Roper 

Unfortunately, form times to times development happens too fast and I forget about the help pages. I need to do one for ChangeCoordinates. Sorry for that. Meantime, its syntax is kinda natural: the same as ChangeBasis.

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

@Pascal4QM 

Indeed, defining A, B and C as noncommutative objects in general works fine for this. The possibility of defining commutator and anticommutator algebra rules for them also allows for flexible manipulation of their products. Note, additionally, that it is possible to be more specific in this case, by using matrix instead of Matrix, as discussed in Sec.5 of the Maple help page "Physics, Mini-Course". That automatically defines these as noncommutative objects, the same way quantumoperators are.

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

@Steve Roper 

with(Physics:-Vectors)

In your first post you asked about square of the norm of

a*`#mover(mi("r"),mo("∧"))`+b*`#mover(mi("θ",fontstyle = "normal"),mo("∧"))`+c*`#mover(mi("φ",fontstyle = "normal"),mo("∧"))`

_phi*c+_r*a+_theta*b

(1)

And this following result is correct because the three unit vectors form a basis and are orthogonal.

(_phi*c+_r*a+_theta*b).(_phi*c+_r*a+_theta*b)

a^2+b^2+c^2

(2)

In your second post you asked about something different

_i*x+_j*y+_k*z

_i*x+_j*y+_k*z

(3)

Of course the square of the norm of this one is

(_i*x+_j*y+_k*z).(_i*x+_j*y+_k*z)

x^2+y^2+z^2

(4)

BUT: if you express this result in spherical coordinates you have

ChangeBasis(_i*x+_j*y+_k*z, spherical, alsocomponents)

r*_r

(5)

r*_r.(r*_r)

r^2

(6)

That is understandable, because

ChangeCoordinates(r^2, cartesian)

x^2+y^2+z^2

(7)

So you see (4) and (6) are of course the same result. Summarizing: all these results are correct, and in (2) to expect something different is wrong.

 

You can see the same going the other way around: from shperical to Cartesian. Take the vector of your original post and change the basis to Cartesian

_phi*c+_r*a+_theta*b

_phi*c+_r*a+_theta*b

(8)

ChangeBasis(_phi*c+_r*a+_theta*b, cartesian)

(a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi))*_i+(a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi))*_j+(-sin(theta)*b+cos(theta)*a)*_k

(9)

So now you have your orginal vector in the Cartesian orthogonal basis. Take now the scalar product

((a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi))*_i+(a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi))*_j+(-sin(theta)*b+cos(theta)*a)*_k).((a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi))*_i+(a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi))*_j+(-sin(theta)*b+cos(theta)*a)*_k)

(a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi))^2+(a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi))^2+(-sin(theta)*b+cos(theta)*a)^2

(10)

simplify((a*cos(phi)*sin(theta)+b*cos(phi)*cos(theta)-c*sin(phi))^2+(a*sin(theta)*sin(phi)+b*cos(theta)*sin(phi)+c*cos(phi))^2+(-sin(theta)*b+cos(theta)*a)^2)

a^2+b^2+c^2

(11)

You see you again arrive at (2) For experimentation, you can try changing also the vector components, not just that basis, so that instead of seeing theta and phi in (9) you see x, y, z.

ChangeBasis(_phi*c+_r*a+_theta*b, cartesian, alsocomponents)

((x^2+y^2)^(1/2)*a*x-(x^2+y^2+z^2)^(1/2)*c*y+b*x*z)*_i/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*y+(x^2+y^2+z^2)^(1/2)*c*x+b*y*z)*_j/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*z-b*(x^2+y^2))*_k/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))

(12)

(((x^2+y^2)^(1/2)*a*x-(x^2+y^2+z^2)^(1/2)*c*y+b*x*z)*_i/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*y+(x^2+y^2+z^2)^(1/2)*c*x+b*y*z)*_j/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*z-b*(x^2+y^2))*_k/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))).(((x^2+y^2)^(1/2)*a*x-(x^2+y^2+z^2)^(1/2)*c*y+b*x*z)*_i/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*y+(x^2+y^2+z^2)^(1/2)*c*x+b*y*z)*_j/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2))+((x^2+y^2)^(1/2)*a*z-b*(x^2+y^2))*_k/((x^2+y^2+z^2)^(1/2)*(x^2+y^2)^(1/2)))

((x^2+y^2)^(1/2)*a*x-(x^2+y^2+z^2)^(1/2)*c*y+b*x*z)^2/((x^2+y^2+z^2)*(x^2+y^2))+((x^2+y^2)^(1/2)*a*y+(x^2+y^2+z^2)^(1/2)*c*x+b*y*z)^2/((x^2+y^2+z^2)*(x^2+y^2))+((x^2+y^2)^(1/2)*a*z-b*x^2-b*y^2)^2/((x^2+y^2+z^2)*(x^2+y^2))

(13)

simplify(((x^2+y^2)^(1/2)*a*x-(x^2+y^2+z^2)^(1/2)*c*y+b*x*z)^2/((x^2+y^2+z^2)*(x^2+y^2))+((x^2+y^2)^(1/2)*a*y+(x^2+y^2+z^2)^(1/2)*c*x+b*y*z)^2/((x^2+y^2+z^2)*(x^2+y^2))+((x^2+y^2)^(1/2)*a*z-b*x^2-b*y^2)^2/((x^2+y^2+z^2)*(x^2+y^2)))

a^2+b^2+c^2

(14)

``

 

Download scalar_product_in_spherical_coordinates.mw


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

 

@Axel Vogt 

No, the definition is not the same, neither there is only one in use in the literature. Maple and Mathematica definitions are related via JacobiSN(a, z) = JacobiSN[a, z^2]and the two solutions shown are actually the same after you translate from Maple to Mathematica. By the way entering convert("JacobiSN[a, z^2]", FromMma) shows how the definitions in both systems are related.

The issue mentioned by Rouben Rostamian is standard in Computer Algebra differential equations solvers when the DE has  square roots of the unknown of the problem. That results in branches directly in the DE. Semantics to the side, I tend to think of these problems as: remove the square root and you have a well-defined problem, otherwise, the symbolic solution will be correct only in some region of the complex plane. Basically, most of the time the symbolic solution you receive is the one that corresponds to the DE after removing those square roots. In this example, take for instance ODE^2, then call dsolve, and there you see the JacobiSN solution.

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

@deniscr 

Curious how minds interpret written language differently ... It confused me your comment about inner products. From your last reply, you only wanted to have one of the Killing vectors (tensors of 1 index) defined as a tensor. Do it the usual way using Define, for example with the first one:

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

@deniscr 

This is the original file, where I see no Killing vectors nor what is what you meant by the inner product of them with a scalar. To make your question understandable for me, you'd need to post a mw with the Killing vectors, the product you intend to do (but don't know how to) and the result you expect.

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

@deniscr 

I'd need to see your question with formulas visible on a worksheet in order to answer more precisely

@Carl Lovenm

I've also lost - not sure hundreds but with no doubt a hundred at least - of reputation points in an also fully mysterious way during the last two weeks mainly. I didn't look back to try to understand where it was coming from but some are visible at nude eye: the post "Vectors in Spherical Coordinates using Tensor Notation", displayed on the front-page of Mapleprimes, was with 6 votes a week ago, now it is with 5 votes.

So I assumed someone was taking votes away. I shrugged ... It didn't pass through my mind that my posts were not good, or that my answers were of no value (assuming someone took away her/his votes). To be sincere here, I evaluate my posts and answers by myself, and only present stuff that I find good.

By the way, specifically about you two Carl and Nm, I find your contributions to this website FANTASTIC, even if sometimes I may not agree with the words you use (e.g. yesterday on what one of you called a bug). Nothing of that takes away the enormous value of your contributions.

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

Yes. Firstly, without the original file, anyone willing to help you will need to re-type everything. Secondly, because the background for this problem is missing, the coordinates and the metric (I can deduce it from the picture you sent, but then will need to type all that deduction to reproduce - not good).

Please post the problem with a worksheet - can be by editing your original post replacing the picture by the worksheet showing its contents - and I will help you with this problem.

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

@maplequestions 

Yes, you need to upload the worksheet here. Not into a Google drive. First, so that others can see it, here, a forum maintained by the company, perhaps an year or two after today. Then because while most people on this website are happy to voluntarily help (this is not work for hire), on the other hand typing things for others (e.g. equations, or functions) and similar things can be done by the person who asks the question.

From your reply, being that you do not know how to input a function, I suggest you give a look at the post "Maple for Beginners". Section 2 is all about that, expressions, equations and functions. The five sections of that post constitute the basic to take off, moving you from beginner to actual user. Maybe you can learn that content in one afternoon, who knows perhaps less.

You can also give a look at the help page Physics,Tensors, Sec II.13, "Setting the spacetime metric indicating the line element", but trust me on this one: if you don't know how to input a function it is better to first go with Maple for Beginners, that is the fastest approach.

Then please write here again, posting the worksheet, this time containing your attempts to formulate the problem. Either you will have succeeded (I imagine), or the question on which to help you will be more specific.

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

First 21 22 23 24 25 26 27 Last Page 23 of 65