John Fredsted

2253 Reputation

15 Badges

20 years, 191 days

MaplePrimes Activity


These are replies submitted by John Fredsted

Using {L[ ]} instead of convert(L,set) is very neat, and a complete surprise to me. Where, Doug, did you originally pick up this knowledge? Like me, attending this forum, or? To me such a property is something that I would never guess, only stumble upon by accident, but maybe it is just my imagination that is poor. Anyway, coming to think of it, it probably having been suggested before by others, I think it would be nice to have some place where all these tricks of the trade could be collected side by side, instead of them being scattered all over this forum.
I did not know about attributes() or setattribute(), which surely seem to provide a nice workaround. My own workaround was something along the following lines (where the general object-oriented design of my package is also shown: for instance, fields can first be defined when a spacetime, on which they propagate, is defined - physically logical):
module()
   export createSpacetime;
   createSpacetime := proc(spacetime_args) # Spacetime constructor
      # properties (attributes)
      # ... assigning the spacetime_args to local variables ...
      # methods
      # ...
      module()
         export createField;
         createField := proc(field_args) # Field constructor
            # properties (attributes)
            # ... assigning the field_args to local variables ... (*)
            # methods
            # ...
         end proc
      end module
   end proc
end module:
Here the (anti-)symmetries would be properties (assigned to local variables) of the field object, in the line indicated with (*). But to me they are only workarounds. It would be nice if somehow the Array constructor of Maple could construct the appropiate indexing function from a list of symmetries and antisymmetries, something along the lines of
Array(1..4,1..4,1..4,1..4,permpos={[3,4,1,2]},permneg={[2,1,3,4],[1,2,4,3]});
where permpos are the positive permutations (the symmetries), and permneg are the negative permutations (the antisymmetries), and, most crucially, at the same time automatically record permpos and permneg as attributes so that they are readily available for constructing indexing functions for new and larger Arrays derived from the original one. By the way, this example is relevant for the Riemannian curvature tensor of four-dimensional spacetime.
To the best of my knowledge, I have always only used one and the same email address as the username, both at maplesoft.com and mapleprimes.com. But, of course, there is a slight chance that I am mistaken.
I completely agree with you concerning the messy semantics, compare my post above.
I would prefer a strict syntax for interpreting square brackets, see my earlier post, in conjunction with some nice conversion functions, making it possible, for instance, to easily create a larger matrix from smaller ones, as you mention. Why? Because it makes me think a lot less, not having to remember all those exceptions. I have to admit that my memory is not as strong as it used to be :-). A little joke: In getting older there are three things that you loose: your memory, your memory, and a third thing which I cannot remember.
Thanks for your example which I repeat here with a small addition (defining the variabel M):
m1:=Matrix([[1.1,2.1,3.1],[4.1,5.1,6.1]]):
m2:=Matrix([[1.2,2.2,3.2],[4.2,5.2,6.2]]):
m3:=Matrix([[1.3,2.3,3.3],[4.3,5.3,6.3]]):
m4:=Matrix([[1.4,2.4,3.4],[4.4,5.4,6.4]]):
M := Matrix([[m1,m2],[m3,m4]]):
For such a code I would expect M[1,1], for instance, to give m1, not 1.1, as it actually does. I would expect the code to work as the following code does:
m1:=Matrix([[1.1,2.1,3.1],[4.1,5.1,6.1]]):
m2:=Matrix([[1.2,2.2,3.2],[4.2,5.2,6.2]]):
m3:=Matrix([[1.3,2.3,3.3],[4.3,5.3,6.3]]):
m4:=Matrix([[1.4,2.4,3.4],[4.4,5.4,6.4]]):
M := Matrix(2,2):
M[1,1] := m1:
M[1,2] := m2:
M[2,1] := m3:
M[2,2] := m4:
To me the Maple interpreter should always interpret
Vector([entry_1,...,entry_n]);
as an n-dimensional Vector, no matter what types (note plural) the different entries may have. Likewise, to me the Maple interpreter should always interpret
Matrix([
   [entry_11,...,entry_1m],
   ...
   [entry_n1,...,entry_nm]
]);
as an nxm Matrix, no matter what types the different entries may have. And so forth for Arrays, etc.
Thanks for your thoughtfulness, Jacques. Yesterday I wrote to http://www.mapleprimes.com/contact with the following message:
Dear MaplePrimes, Several times I've tried to change information under "About Me", each time, of course, remembering to click the Submit button - but to no avail. I think it might be related to the following: Several weeks ago I changed my password at maplesoft.com (note not mapleprimes.com), which worked well. But, subsequently, trying to do the same at mapleprimes.com spelled problems; it became impossible for me to access my mapleprimes account no matter what password (old or new) I used. This problem was only resolved when I changed back my password at maplesoft.com (note not mapleprimes.com). I've got the feeling that somehow the changes which I do make to my account information at mapleprimes.com get stored at some ghostly second account of mine. Sincerely, John Fredsted
I have not yet heard from them.
Anybody, developers at MapleSoft included, of course, on the above post? To me the unwrapping of list of lists to one level only (compare the help text) seems to me quite ad hoc. Why has that been implemented?
You are quite welcome. I know this is a bit unconventional (that is using the forum in this way), but I would like to know if you have read my three private messages to you; I suppose not because they are all still marked "new" in my "Sent messages".
You are quite welcome. I know this is a bit unconventional (that is using the forum in this way), but I would like to know if you have read my three private messages to you; I suppose not because they are all still marked "new" in my "Sent messages".
Thanks for that very specific reference to the help text. It is quite interesting to try out the different issues mentioned there. But please forgive me, why should it be an error to have a matrix in the list? To me it seems counterintuitive to have to write those extra [...]'s. To me it seems analogous to have to write
Vector([[2],[3]]);
instead of
Vector([2,3]);
Of course, here the two versions produce identical results because (according to the help text you are referring to) the list of lists in the first version gets unwrapped. Actually, coming to think of it, this seems nonsensical to me; why shouldn't the first version be interpreted instead as a list-valued two-dimensional (column) vector? Such an interpretation would be consistent with interpreting
Vector([Matrix(3,3),Matrix(3,3)]);
as a Matrix-valued two-dimensional (column) vector, instead of producing an error. And what about the following example: The expression
Vector([Array(1..2,1..2,1..2)]);
produces a four-dimensional Vector of one-dimensional Arrays (why should it be so?), while
Vector([[Array(1..2,1..2,1..2)]]);
correctly (although, of course, I still find the extra [...] counterintuitive) produces a one-dimensional Vector with a three-dimensional Array as entry.
To me the two most important features of Scientific WorkPlace are:
  • It makes it possible to write LaTeX documents in a WYSIWYG way, i.e., without tediously having to type all the LaTeX commands themselves.
  • It can generate a PDF document from a LaTeX document. An article of mine is an example of such a PDF document.
Maple can generate LaTeX code, see ?LaTeX. But, unless I'm mistaken, it cannot generate PDF documents. However, what I generally miss, not in Maple, but in connection with webpages (and therefore also at mapleprimes.com), is a smoother integration of PDF and HTML documents, making it possible to have PDF snippets embedded inside the HTML code, instead of having to resort, as I did above, to using for instance gif image files. Of course, the W3C Consortium is aware of that. In order to facilitate mathematical information on the web they recommend using MathML (Mathematical Markup Language). But to me typographically MathML documents come nowhere near the LaTeX/PDF documents.
To me the two most important features of Scientific WorkPlace are:
  • It makes it possible to write LaTeX documents in a WYSIWYG way, i.e., without tediously having to type all the LaTeX commands themselves.
  • It can generate a PDF document from a LaTeX document. An article of mine is an example of such a PDF document.
Maple can generate LaTeX code, see ?LaTeX. But, unless I'm mistaken, it cannot generate PDF documents. However, what I generally miss, not in Maple, but in connection with webpages (and therefore also at mapleprimes.com), is a smoother integration of PDF and HTML documents, making it possible to have PDF snippets embedded inside the HTML code, instead of having to resort, as I did above, to using for instance gif image files. Of course, the W3C Consortium is aware of that. In order to facilitate mathematical information on the web they recommend using MathML (Mathematical Markup Language). But to me typographically MathML documents come nowhere near the LaTeX/PDF documents.
Is it just me being silly?
First 59 60 61 62 63 64 65 Page 61 of 68