John Fredsted

MaplePrimes Activity


These are replies submitted by John Fredsted

@acer: Personally, I would not choose either to save a package of my own in the Maple-default library. When writing my answer yesterday, I did briefly consider to make a note regarding that, but I chose to think that the choice of OP was informed and deliberate.

@PhilipKroon: You have to write it as

LibraryTools:-Save(MineRedskaber,cat(libname[1],"/MineRedskaber.mla"));

Note that the global variable libname is an expression sequence containing the possible library paths (as defined for instance in the maple.ini file). If several folders exist, then you can also choose [2], [3], etc., above, but the choice should of course be consistent with the library folder in which you have put your MineRedskaber.mla.

Or, coming to think of it, if you do not want to use libname but rather use an explicit path, as seems to be case, then write it as

LibraryTools:-Save(MineRedskaber,cat("C:/Program Files/Maple 2017/lib","/MineRedskaber.mla"));

i.e., drop the selector [1], and insert an appropiate root, C:/ say; or, what amounts to the same,

LibraryTools:-Save(MineRedskaber,"C:/Program Files/Maple 2017/lib/MineRedskaber.mla");

@ecterrab: Now it works. Now it also correctly reads "Files updated on March 6, 2018" at the R & D page, where it earlier read some date in February, the 23rd I believe.

@ecterrab: Thanks for your extensive answer.

I am having trouble getting the update to work, though. I have downloaded and copy-pasted Physics2017.mla to its proper, and usual, location on my system, having changed nothing else, but Physics:-Version() reports the date February 24th, which is wrong, I guess. The file downloaded is Physics_DEs_MathFuncs_Maple2017_264.zip.

Please forgive me, but I am still not comfortable with the notation used. I prefer having a vierbein always given as e_[~a,mu], and its inverse given as e_[~mu,a], with indices to be neither interchanged nor raised/lowered (for the latter having the world metric and/or the Minkowski metric figure explicitly where needed). But perhaps I am just being silly.

@ecterrab: Thanks for your extensive answer.

Concerning the first part: Nothing new or surprising there, I know that stuff. What I want is to be able "to work with an arbitrary, non-fixed vierbein". But perhaps, it suddenly occurs to me, that is possible by specifying the vierbein in inert form. Or what?

Concerning the second part: I have never worked with the Ricci rotation coefficients, so they are actually new to me. I think I will have to read §98 of Landau and Lifshitz. Although it is now clear to me that a Lorentz index on a Christoffel symbol is just, by definition, the contraction of the corresponding world index with the vierbein, the notation still bothers me, precisely because the Christoffel symbols do not transform as tensor components. Therefore, I think I prefer your Eq. (11) or (12) over Eq. (7). But perhaps it just takes some time getting used to.

@trace: Sorry, but I am heavily preoccupied with other things for the moment, and will thus not be able to help you for, perhaps, a couple of days.

@trace: I think your INDS, Eq. (8), is not what you intend it to be. I think it should contain only the perturbation functions g(r) and h(r) and their derivatives. Perhaps it would be easier to just enter the list manually, than to assort to the somewhat convoluted construction of mine.

PS: What is Z in your definition of Maxwell?

@trace: You are absolutely right. I was also surprised that there was no dependency. I have updated my answer so that it includes also derivatives.

@nm: Tom's answer contains the same simple suggestion, as I already noted yesterday. I decided, though, to stick to my answer because I felt it was more in the mathematical spirit of OP's question, whereas length, according to its help page, seems to apply to any expression and generally appears to me to be more of a computer/storage related thing, loosely speaking.

@Kitonum: Intrigued by your post, I have just found and read the (short) help page ?quotes. There it says that `...` is used to form a symbol. So something like ` A = ` is a symbol which one can therefore assign something to, forming, say, ` A = ` := 10. I would not have thought that possible. One learns something new everyday :-).

@Simwar: On grounds of your print statement, I had a hunch that you would like to have some whitespacing. Unfortunately, I have no idea how to do that. Perhaps somebody more kwowledgeable than me can help you out.

@nm: You ask acer "But is it possible to modify this slightly in order to make it easier to use by having your function return the 2 separated functions in a list?"

To have returned two separate functions, rather than a product, you could just do as follows:

s,r := selectremove(z -> has(z,x) and has(z,y),expr):
simplify(select(has,r*expand(s),x));
simplify(remove(has,r*expand(s),x));

This is a slight modification of my previous proposal, and it is, in fact, the first proposal I considered (but did not post).

@Kitonum: You indeed have a point. But it seems to me that one would serve to Splitting such an expression of a sum of terms only if one already knew that it factorizes. Changing the expression you give to x*y-sqrt(3)*x+sqrt(2)*y-2 say, would, of course, not result in any successful factorization.

Note added: Just for the sake of completeness, this reply corresponds to the post by Kitonum, which has been moved from being a reply (to my answer above) to being an answer on its own.

@Kitonum: Thanks. Before I posted, I also briefly considered whether or not my solution was applicable more generally. But I was so careless to replace exp(x + y) with sin(x + y), which does of course not factor as the product of function of x, and a function of y. So I just dropped doing any further investigations. It is therefore nice that you have taken it a step further.

I was not aware of the symbolic option to simplify, having just consulted its help page. It is nice to have when no care concerning branch cuts needs to be taken, and it is indeed needed here in relation to radicals. But I am wondering whether the factor command within simplify is really necessary; to me, it seems not.

@asukumari: No need to apologize. Such mistakes happen.

Concerning strings and keywords: In Kitonum's construction, wrong and correct are interpreted by Maple as unassigned variables. They are neiher strings (which delimiters are always double quotes, an example being "correct"), nor keywords. If they were the latter, an error would occur, as it does for your construction `if`(a>b,if,for).

1 2 3 4 5 6 7 Last Page 2 of 68