John Fredsted

2238 Reputation

15 Badges

20 years, 169 days

MaplePrimes Activity


These are replies submitted by John Fredsted

I learned about the functions reading the help pages. But, as I wrote in my previous post, I had trouble figuring out how to return a matrix, and here the help pages seemed of little help, but maybe that is my own fault, as I only read the help pages cursorily. Obviously, Robert Israel has resolved this issue, using a slightly different structure of the procedure, and using parse which I didn't know.

I learned about the functions reading the help pages. But, as I wrote in my previous post, I had trouble figuring out how to return a matrix, and here the help pages seemed of little help, but maybe that is my own fault, as I only read the help pages cursorily. Obviously, Robert Israel has resolved this issue, using a slightly different structure of the procedure, and using parse which I didn't know.

You can create a Maplet corresponding to an m x n matrix by having a procedure return the Maplet:

with(Maplets:-Elements):
makeMaplet := proc(m::posint,n::posint)
   Maplet([
      ["Enter the matrix, please"],
      seq([seq(TextBox[entry||i||j](width = 5),j = 1..n)],i = 1..m),
      [Button("Return the matrix",Shutdown())]
   ])
end proc:
Maplets[Display](makeMaplet(3,5));

So far, though, I have struggled in vain to have the Maplet itself return a matrix with the entered values, when shutting down. My problem is not that I don't know how to obtain the entries themselves, the problem is that I cannot figure out the correct format of the code to put in Shutdown().

You can create a Maplet corresponding to an m x n matrix by having a procedure return the Maplet:

with(Maplets:-Elements):
makeMaplet := proc(m::posint,n::posint)
   Maplet([
      ["Enter the matrix, please"],
      seq([seq(TextBox[entry||i||j](width = 5),j = 1..n)],i = 1..m),
      [Button("Return the matrix",Shutdown())]
   ])
end proc:
Maplets[Display](makeMaplet(3,5));

So far, though, I have struggled in vain to have the Maplet itself return a matrix with the entered values, when shutting down. My problem is not that I don't know how to obtain the entries themselves, the problem is that I cannot figure out the correct format of the code to put in Shutdown().

To be strictly true to the original integral, shouldn't the integral F1 be done with respect to y, and the integral Q with respect to z?

Note added: The result is, of course, the same because the integrand is symmetric in y and z. Realized after posting. Sometimes I post, and then I think. I apologize.

Thanks for your thoughtful words. I have to admit that I was feeling somewhat discouraged considering the overwhelming inadequacy of my first version. That was why I put forward the idea of joined work in which I would love to participate.

I very much like your suggestion, thanks. Unfortunately, for the time being I have decided to put the project in the drawer. Due to the above-mentioned inadequacies, today I have withdrawn the package from the MapleSoft Application Center.

Thanks acer for that sobering list :-).

I guess a whole lot of work, a little over my head, I am afraid, is left to do. The simple types like _Inert_NAME (which is already covered) is no sweat, the troubles start with the more complex types like _Inert_FUNCTION which may come in so many variants.

If the outline of my module is anything to build on, then maybe a joined effort of some kind here at mapleprimes may be the way to proceed. Here the post by Jacques comes to mind.

Concerning the equation: Even though not being an error by itself, because _Inert_EQUATION is not among the inert types given in the list in the original blog entry, the missing _Inert_EQUATION is surely an inadequacy, which I should have caught myself. The remedy is straightforward, though:

  • Define the export `LatexString/EQUATION`.
  • Define the procedure `LatexString/EQUATION`:
    `LatexString/EQUATION` := (expr) -> cat(
    	LatexString(lhs(expr)),
    	"=",
    	LatexString(rhs(expr))
    );
    
  • Insert into the procedure LatexString:
    elif inertType = _Inert_EQUATION then `LatexString/EQUATION`(args[1])
    

Concerning the integral: Before trying to remedy this inadequacy, I would like first to ask this forum what other more special types of _Inert_FUNCTION (the integral being of this inert type) Maple can throw up. By the way, revisiting the procedure `LatexString/FUNCTION`, which is the procedure in question, its treatment of Sum is clearly inadequate, or rather plain wrong, returning only "d". I guess I must have postponed the treatment of Sum because it comes in many variants, and then subsequently forgot about this postponement.

Concerning the dvi output: By default the imaginary complex unit I is converted to the LaTeX snippet \\mathrm{i}, as specified by the variable COMPLEX_UNIT. This latter variable may be changed using the procedure complexUnit, see the original blog entry.

PS: Thanks for catching these inadequacies of the module. I will await any renewed upload, the changes being made only in my own version, until it has somehow stabilized. Thanks also to Joe Riel for his two suggestions which have also been included in my own version.

Although the best way to use any module is to save it to some repository, as outlined by Joe Riel, the module (as with any module with exports) may also be used straightforwardly writing

newLatex:-Latex(expr);

where expr is the Maple expression which you want converted to LaTeX.

You beat me to the finish line. I was thinking along similar lines, using patmatch, but I struggled to extract in a (simple and) session independent manner the exponent from the pattern solution.

You present a quite general method for doing so: substituting the value of the exponent into the exponent itself. That, although now quite obvious, never occurred to me. Thanks for removing that ignorance of mine.

You beat me to the finish line. I was thinking along similar lines, using patmatch, but I struggled to extract in a (simple and) session independent manner the exponent from the pattern solution.

You present a quite general method for doing so: substituting the value of the exponent into the exponent itself. That, although now quite obvious, never occurred to me. Thanks for removing that ignorance of mine.

You could put your beautiful images in a blog entry, then certainly you will not have to feel that you have to apologize (which I do not imply that you have to do here).

Note added: Having just, too late, checked your blog I can see that you are all familiar with that posting option, so I will kindly ask you to just disregard this post of mine.

The old issue reported in Now you see it, now you don't has never been resolved. Despite several attempts, I have only been able to change the content of one single field. The content of all others seem to be dropped down some black hole in cyberspace. Maybe Hawking radiation will one day return it back, although probably unrecognizably scrambled.

First 33 34 35 36 37 38 39 Last Page 35 of 68