acer

33188 Reputation

29 Badges

20 years, 207 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

If you plan on raising the matrix to many, many different powers, because you want many results from those, then you might consider the following: diagonalize the matrix just once to get it factored like p^(-1).d.p where d is diagonal and m^n=p^(-1).d^n.p due to orthogonality in p. (You just raise entries of vector form of d, and the turn into diagonal matrix, rather than raising d to power n.) Once the single time cost of the eigenvector computation gives you those factors you can raise to many different powers quickly, or even in parallel using the Grid package.

@Carl Love I would expect that the cost of the extra function calls would make a recursive implementation relatively expensive when the number of total iterations becomes very large. But sometimes it can be easier to set up a recursive method in code, which is only why I mentioned it. As usual for this site. the Asker didn't give a lot of details.

How about writing a procedure that admits a list of the specifics of remaining loops as one of its arguments? Then it could loop, and inside that loop call itself with the pared list of specifics?

acer

@wolfman29 Axel meant more decimal places in your data (constant values you used, like parameters). If you have 'em...

Or you could try root finding (fsolve) of your expression plus a small fudge factor (constraint violation). Or you could tryOptimization instead (with objective any constant, and expression equal to zero as constraint, and use constraint violation options). Or you could use the DirectSearch v.2 package which can also do such things.

BTW, I got the previously found partial results much faster by using the range option for fsolve. You even put in a way to shoehorn it into Denom. But you didn't make use of it? Another possible speedup might be to use immediately previously found root as initial guess, at each step after the first.

@Carl Love That works even in MapleV R5.

You've asked similar questions twice before, with an uploaded worksheet by the same name. This file and question might be quite different and new, of course, but I would still like to ask which version of Maple you're using. The previous two questions were marked as Maple 13, and so is the marking of this one as Maple 18 correct?

acer

Having submitted this I see that while I was busy Preben gave my first suggestion as his last suggestion. Apologies: no offence intended, Preben.

It's a shame that querying the Help system for IsSimilar brings up a page for the inert IsSimilar (for use with modp) as its first choice, ranked higher than the page for LinearAlgebra:-IsSimilar. Most students will not want that first suggestion of the Help system.

It's also a shame that Student:-LinearAlgebra:-IsSimilar has yet a third style of returning the transformation Matrix. How confusing.

acer

@Markiyan Hirnyk The plot that the Asker showed as Maple output is the same as what one gets by issuing the command,

smartplot[cos, x]( cos*x/(x^2+2*x)=0 );

And that is what the context-menu system and PlotBuilder command can suggest here. And the black arrow between 2D expression and the plot, in the original Question, clearly indicates that context-menu plotting was done.

Enter the expression,

cos*x/(x^2+2*x)

and then right-click, and select from the context-menus the item "Plots" -> "2-D Implicit Plot" -> "(cos, x)". That invokes the `smartplot` call above.

I only called it an implicit plot because that was the term used in the context-menu item that gave the same plot as was originally shown. I've edited to now use the quoted term "2-D Implicit Plot" exactly.

It is clear that the Askers problem was indeed that he used cos*x instead of cos(x).

I tend to put utility procedures into a Library archive rather than an initialization file.

Most of the items in my initialization file are commented out. But here are a couple:

  ## Allow direct cut & paste of input lines (eg. from commandline sessions).
  interface(prompt=" (**) "):
  ## When I print or eval a system procedure I do want to see its body printed
  interface(verboseproc=3);
  ## I forget where I found this.
  showalias := proc(Q)
     local zz;
     zz := indets(Q,symbol);
     if zz <> {} then
         subs( map( (u,pr) -> u=subs('_A_' = u,pr)(), zz,
                     proc() local _A_; _A_ end ), Q );
     else
         zz := indets(Q,numeric);
         subs( map( u -> u=convert(u,symbol),zz ), Q );
     end if;
  end proc:

That last one works like so,

expr := sin(c)^2+exp(sin(c));

                                      2         
                             expr := t  + exp(t)

showalias(expr);

                                  2              
                            sin(c)  + exp(sin(c))

I've seen functionality related to the previous item posted on usenet by Joe Riel. 

And at some point in the past I must have wanted to allow custom initialization files. (This might be a useful idea on Windows, with the location adjusted of course, since even using a single initialization file is awkward due to the silly default location.) I would have used this form on Linux/Unix,

  ## local directory overrides
  ## I suppose I found this useful at one time, since I have two variants,
  ## with one of them depending on "hidden" files.
  #try proc() read(`./.mapleinit`) end() catch: end try;
  #try read "./mapleinit" catch: end try; 

acer

Now I see another post that might be related, but this time with a slightly different error mesage (and an example with definite integration, so perhaps failing hard while attempting ftoc method).

It might be useful for maplesoft tech support to be told where people are downloading failing installers from. They might be able to figure out whether it's just a random download blip, or whether there is some univ course site with an already corrupoted installer, or some other scenario, etc, etc.

@Athar Kharal I think I'm starting to understand better. I think I can make a procedure which, when called, returns a list of outputs in the current worksheet. And context menu results are one type of th 

You mention Equation Labels, but that may just be a display preference and possible not crucial here.

And you mention context menuactions, or chains of such. Now, while its not possible to run through that by repeated us of the Enter key, after replacing the original first input with typing, it should be possible reexecute the new chain using the triple exclamation from the menubar. So in some sense it can be seen as a task or template (but not in the exact was of maples usual defn of same).

And, after rexecuting the chain, then calling the special command would regenerate all the latex items.

Am I close to understanding your intention? If so then I'm pretty sure I can do it. I've been looking at a replacement for the export mechanism from .mw to .mpl and this may use some of my same ideas.

@Athar Kharal But you already asked about getting a list of the the label (output) here. Is this just a duplicate, then? I thought that perhaps this was different, being about the command rather than the output. Please clarify.

How do you want them collected? As groups of input output lines? As lists of commands?

What do you mean by automated tasks? Do you want to the assemble manually to get something like a procedure or execution group that someone else could utilize in an automated manner? Or do you want the collection automatically assembled? Also, did you mean "task" in the sense of the Task palette or just as a generic phrase?

The more detail in your description of the "use case" the better hope to nail it down.

acer

@Kitonum Thanks. I am glad that each of the implicitplot, algcurves, and direct plot approaches have been mentioned here.

First 356 357 358 359 360 361 362 Last Page 358 of 607