acer

32363 Reputation

29 Badges

19 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

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.

@sazroberson There are no subtle extra evaluations going on in this example.

Your code to map `rhs` is not correct. Apart from a missing bracket, the arguments to `rhs` will be wrong. When the variables passed to `solve` are in a list then the result is a list of such (list form) solutions.

You instead could do it as,

((rhs~)~)(solve({x+y=1,x+2*y=4},[x,y]))[];

                            [-2, 3]

((rhs~)~)(solve({x^2+y=1,x-y=5},[x,y],explicit))[];

                        [-3, -8], [2, -3]

But I still prefer to use the so-called 2-argument `eval` approach over approaches using `rhs` or `op`, as I feel it is more understandable and can (sometimes) place less burden on the coder to be aware of the variable positions in the `solve` call. Each to his own, naturally.

And, of course, the 2-argument `eval` approach can also be used with the list of lists format (but with one less mapping call),

map2(eval,[x,y],solve({x+y=1,x+2*y=4},[x,y],explicit))[];

                            [-2, 3]

map2(eval,[x,y],solve({x^2+y=1,x-y=5},[x,y],explicit))[];

                       [-3, -8], [2, -3]

@Carl Love The change is within the kernel builtin assigned command.

In Maple 18.01 all three queries within f below compute without error. In Maple 17.02 the third query, assigned(rt[foo]), does more levels of evaluation of rt[foo].

This below is run in Maple 17.02. The problematic third query seem to break 1-level evaluation rules for LOCALs. In Maple 18.01 the third query behave like the first, (giving value true rather than raising an error).

restart:

f:=proc() local rt,foo;
  rt:=table([foo='Vector'(posint)]);
  assigned(eval(rt[foo],1));
  type(rt[foo],name);
  assigned(rt[foo]);
  NULL;
end proc:

trace(f):

f();
{--> enter f, args = 
                      rt := table([foo = Vector(posint)])

                                     true

                                     false

<-- ERROR in f (now at top level) = 
"dimension parameter is required for this form of initializer"}
Error, (in Vector) dimension parameter is required for this form of initializer

The problematic behaviour seems specific to "local" table references. (I mean, the name `rt` to which the table is assigned is local. The table may scope from anywhere.) The following is also run in Maple 17.02,

restart:

f:=proc() local rt,foo,z;
  rt:=table([foo='Vector'(posint)]);
  z:=rt[foo];
  assigned(z);
end proc:

f();
                                     true

@Carl Love In 17.02 the call to Exists produced an error with one pair and returned true with two pairs. In18.01 both cases returned true.

@Mac Dude The need for two pairs of uneval (single-left) quotes around the type in the AddType call, so that Exists would work, seems unnecessary in Maple 18.02.

I didn't try it within ModuleLoad of a saved/loaded package.

I edited the main Question, to reflect product Maple 17.

I set the 'Product" on this Question to Maple 17, since the Asker mentioned that in a followup Comment.

acer

First 341 342 343 344 345 346 347 Last Page 343 of 592