pagan

5147 Reputation

23 Badges

17 years, 123 days

 

 

"A map that tried to pin down a sheep trail was just credible,

 but it was an optimistic map that tried to fix a the path made by the wind,

 or a path made across the grass by the shadow of flying birds."

                                                                 - _A Walk through H_, Peter Greenaway

 

MaplePrimes Activity


These are replies submitted by pagan

I mentioned the Layout palette, since it seemed to me that it provided what was requested. I figured that I'd misunderstood the request, since he didn't respond.

But the way, the "prepost" item is a little odd. You can use it to generate super/subliterals for some of the (right) positions but with the left super- and subscripts  instantiated as indexed value and algebraic power.

It might be more flexible if there was an all-rounder, a literal-script entry in the Layout palette which allowed for tabbed-fill-in of all six supported positions (with all six being literal sub/superscripts).

Is the thing you want not on the Layout palette?

Also, I believe that there are actually four other none() instances possible, for your example with two super/subscript values chosen.

The full set of six super/subscript arguments correspond to lower/upper right and left, and lower/upper middle positions. If you fill out all six, you can see the general form.

It is relatively simple to construct a Maple procedure which produces such scripted objects. It could accept keyword optional arguments (with none() as the default value) for each of the six super/subscript-values, and concatenation to form the desired object.

Is the thing you want not on the Layout palette?

Also, I believe that there are actually four other none() instances possible, for your example with two super/subscript values chosen.

The full set of six super/subscript arguments correspond to lower/upper right and left, and lower/upper middle positions. If you fill out all six, you can see the general form.

It is relatively simple to construct a Maple procedure which produces such scripted objects. It could accept keyword optional arguments (with none() as the default value) for each of the six super/subscript-values, and concatenation to form the desired object.

Please pardon me for asking, but are you sure that you haven't made another entry/typing/pasting mistake?

Here's what I see, in Maple 13.01 (Linux, 32bit).

> with(ImageTools):
> img:=Create(20,20):
> img[2,2]:=.98:
>
> img[2,2];
                             0.979999999999999982

> img[2,2]:=.97:
> img[2,2];
                             0.969999999999999972

The jar file for such resources is really just a zip file. A particular item in that zip file can be refreshed (replaced).

Don't attempt this if you really don't know what you're doing, or if you suspect it might violate your EULA.

On Linux, being careful to back up my mapleresources.jar file...

mkdir /tmp/splashtemp
cd /tmp/splashtemp
cp /usr/local/maple13.02/java/mapleresource.jar .
mkdir -p com/maplesoft/worksheet/resources
cp ~/foo.jpg com/maplesoft/worksheet/resources/splash.jpg
touch com/maplesoft/worksheet/resources/splash.jpg
zip -f mapleresource.jar com/maplesoft/worksheet/resources/splash.jpg
cd /usr/local/maple13.02/java/
cp -i mapleresource.jar mapleresource.jar.orig
cp -i /tmp/splashtemp/mapleresource.jar .
cd ~
/usr/local/maple13.02/bin/maple -s -x &

I make no promise that this won't make the jvm crash and burn. It seemed to work for me. And, of course, the jar file can be replaced with its backup.

Some nontrivial examples of using the Maple debugger is a great idea. It truly is a useful tool for programming in Maple. I'd suggest that something more than merely a recap of the help-page could illustrate it well.

I find that the debugger is one of those things where I find and settle into my own usage patterns. In doing so, a few simple tricks had to be figured out, since some cirecumstances arise over and over.

For example: How to get into a subroutine, while in the debugger, even if I forgot to set a stopat on it beforehand. How to do that last item, for a non-exported module local routine. How to figure out where I am inside the current routine. How to figure out which case of some broad if..elif..fi case switch I've just entered. How to query locals vs globals of the same name. How to easily get to the point where my non-debug run of the procedure produced an error. How to inspect an anonmous module created at higher scope and passed in to my current routine. Etc, etc.

Perhaps I and others will find the opportunity to share their solutions to such items.

As a habitual commandline interface user, I've developed familiar usage patterns that fit the debugger as it appears in either the commandline or Classic interfaces. I've found it difficult to adjust my usage patterns to the graphical debugger in Standard. As just one amongst many examples of that, I really like the readline capability of using my command history while in the commandline debugger. And I love that it remembers my last debugger command, so that I can hit Enter and not affect my command history (available with the up-arrow key). But that usage is impossible in the Standard debugger. Also, the grahical debugger is much less stable. I wish that I could disable the graphical debugger while in Standard, to get the commandline debugger instead. But, alas, it seems impossible (..and I've tried a lot of sneaky tricks).

Some nontrivial examples of using the Maple debugger is a great idea. It truly is a useful tool for programming in Maple. I'd suggest that something more than merely a recap of the help-page could illustrate it well.

I find that the debugger is one of those things where I find and settle into my own usage patterns. In doing so, a few simple tricks had to be figured out, since some cirecumstances arise over and over.

For example: How to get into a subroutine, while in the debugger, even if I forgot to set a stopat on it beforehand. How to do that last item, for a non-exported module local routine. How to figure out where I am inside the current routine. How to figure out which case of some broad if..elif..fi case switch I've just entered. How to query locals vs globals of the same name. How to easily get to the point where my non-debug run of the procedure produced an error. How to inspect an anonmous module created at higher scope and passed in to my current routine. Etc, etc.

Perhaps I and others will find the opportunity to share their solutions to such items.

As a habitual commandline interface user, I've developed familiar usage patterns that fit the debugger as it appears in either the commandline or Classic interfaces. I've found it difficult to adjust my usage patterns to the graphical debugger in Standard. As just one amongst many examples of that, I really like the readline capability of using my command history while in the commandline debugger. And I love that it remembers my last debugger command, so that I can hit Enter and not affect my command history (available with the up-arrow key). But that usage is impossible in the Standard debugger. Also, the grahical debugger is much less stable. I wish that I could disable the graphical debugger while in Standard, to get the commandline debugger instead. But, alas, it seems impossible (..and I've tried a lot of sneaky tricks).

The img object is an Array with datatype=float[8]. Ie, it is an object where all the data is efficiently stored as double-precision numbers in a contiguous piece of memory. That's efficient because it allows compiled functions to act directly on the data.

The quantity 0.97 is not representable exactly in base 2 (hardware double precision). So a close base-2 double-precision number is what gets actually stored in img. Now, hardware double precision does not correspond exactly to a whole number of base 10 digits. It corresponds to something between 15 and 16 decimal (base 10) digits.

Now, you may well ask what the extra trailing few digits are doing there. The ones that appear beyond the 16th decimal place. My understanding is that they exist only to ensure that the quantity can be round-trip converted back and forth between base 2 and base 10 without loss of information. (You could make the argument that those trailing digits ought not be displayed. In other similar circumstances they are not shown.)

> HFloat(0.97); # a so-called "hardware scalar" Maple number
                                     0.97

> lprint(%);
HFloat(.969999999999999972)

By the way, you must done something other than what you showed above, in your session. Because you entered = not := and so didn't show an actual assignment. Also, you should have see .96999... and not 0.96666... so perhaps you could try it exactly as follows.

> with (ImageTools):
> img:=Create(480,640);
                            [ 1..480 x 1..640 2-D Array ]
                     img := [ Data Type: float[8]       ]
                            [ Storage: rectangular      ]
                            [ Order: C_order            ]

> img[1,7]:=.97:
> img[1,7];
                             0.969999999999999972

You can thus think of those trailing two decimal digits printed as being extraneous, esp. for operations subsequently done either using compiled routines or with Digits<16. The particular trailing two decimal digits printed might even be platform dependant (I forget whether it is so).

This is interesting. Touching the exported DSolveSys procedure generally makes the problem vanish. By that, I mean merely calling eval(DSolveSys), or eval(DSolveSys,1),  or doing pointto of its address, applying ToInert to it, or even doing pointto of the address of its argument sequence. In other words, its difficult to pick apart the problematic procedure without inadvertantly changing & repairing it.

So, maybe it is a problem with what is stored in the library archive, or a problem in how the kernel is reading from that. I don't know whether it is related to the fact that you're using an out-of-fashion .ind/.lib pair for the archive instead of the modern .mla structure. Or whether it is related to your file being in a module, or that you have unnecesasary uneval quotes on some of the types in the parameter sequence (even though only necessary when calling type itself), or some combination of these aspects. I wonder whether the problem is appearing to be with the first keyword parameter simply because it is alphabetically first, and whether some underlying problem might be with quite another parameter.

I don't see how to make more headway, without your providing actual source instead of a presaved archive. I suggest submitting a bug report.

I'm not sure about the debug/undebug effect you describe. But note that there is a difference between getting the default value when not passing the option and explicitly passing that default value when it does not match the specified type.

> DSolveSys:=proc({begynd::Vector:={}})
>   _options;
> end proc:

> DSolveSys();
                                  begynd = {}

> DSolveSys(begynd={});
Error, invalid input: DSolveSys expects value for keyword
 parameter begynd to be of type Vector, but received {}

The applications for fractals could be much better written. Some of the ones authored by Maplesoft even contain written warnings about running slowly and using a lot of memory! That is completely avoidable in those cases, with better programming.

In general, for Maple floating-point computations, the relative performance times of various computational methods available in Maple are like this.

  Compiler < evalhf < option hfloat < Threads < regular

By that, I mean, code done well with Compiler:-Compile is often about 10-20 times faster than code done well with evalhf. And code done well with evalhf is about 5-10 faster than that done with option hfloat. Etc. And using Threads (which precludes use of Compiled code right now) is the slowest speedup method of them all (when all done properly), since it gets hardly linear acceleration over the number of cores. In stark contrast to that, Compiled fractal code can be about 1000 times faster right now, on today's machines, and use much less allocated memory.

And most of the fractal worksheets on the Application Centre use option hfloat or Threads. They don't even use evalhf, and that's been in Maple for over ten years!

The preferences of New->Worksheet (not Document) and 1D (not 2D) input are both preferences that can be saved in Standard using Tools->Options from the main menubar. (Sorry if I misunderstood, but you seemed to be indicating in your 1) that such preferences could not be saved.)

I once knew a guy who did all his editing in xemacs, which used to start slowly way back when. He'd close it after each finished document. He'd even fire it up more than once in order to edit multiple files concurrently. ...Anyway, I guess the "ideal" intended use is that Maple can be opened, and kept open, for the day (say). I don't know how well such practice would do with Standard, whether memory leaks and whatnot would force periodic relaunching. A program intended for multiple documents should either start fast, or be rock solid and leak free.

Me, I am content to use Standard for worksheets, and keep it open for longer than just the single first sheet's use. When I want really fast access I use the commandline interface since that is fastest and leanest.

Try this.

At the top of your worksheet, after the restart, add a line like this, so that you see all the entries of Vectors up to size 50. (Otherwise, the default is to only show the entries of Vectors and Matrices with dimensions of size at most 10.)

interface(rtablesize = 50):

Then, change your eigenvalues(R) to this.

Eigenvalues(evalf(R));

Otherwise, you'll just see a placeholder meant to express roots of the degree 24 characteristic polynomial in exact form. And those roots are 144, 0 with multiplicity 3, and the roots of some degree 20 polynomial (which may not be solved explicitly, and which might be pages of exact symbolic expressions even if it were.)

Try this.

At the top of your worksheet, after the restart, add a line like this, so that you see all the entries of Vectors up to size 50. (Otherwise, the default is to only show the entries of Vectors and Matrices with dimensions of size at most 10.)

interface(rtablesize = 50):

Then, change your eigenvalues(R) to this.

Eigenvalues(evalf(R));

Otherwise, you'll just see a placeholder meant to express roots of the degree 24 characteristic polynomial in exact form. And those roots are 144, 0 with multiplicity 3, and the roots of some degree 20 polynomial (which may not be solved explicitly, and which might be pages of exact symbolic expressions even if it were.)

Sorry, but I often find it difficult to understand what you are asking.

So I can't tell if you are looking for something like this.

> CrossRatio:=proc(L1,L2)
> local expr,sol;
>   expr:=(a*z+b)/(c*z+d);
>   sol:=solve({seq(eval(expr,z=L1[i])=L2[i],
>                   i=1..nops(L1))},{a,b,c,d});
>   if nops([sol])=1 then
>     unapply(simplify(subs(sol,expr)),z);
>   else
>     NULL;
>   end if;
> end proc:

> f := CrossRatio([0,I,-I],[1,-1,0]);
                                         z + I
                              f := z -> --------
                                        -3 z + I
 
> f~([0,I,-I]);
                                  [1, -1, 0]
 
> CrossRatio([z1,z2,z3,z4],[z1,z2,z4,z3]); # no solution

> CrossRatio([z1,z2,z3,z4],[z2,z1,z4,z3]);
           -z z4 z3 + z z2 z1 - z2 z1 z4 + z3 z1 z4 + z3 z4 z2 - z3 z2 z1
      z -> --------------------------------------------------------------
                     -z z4 - z z3 + z z1 + z z2 + z4 z3 - z2 z1
 
> CrossRatio([z1,z2,z3,z4],[z2,z3,z4,z1]); # no solution

> CrossRatio([z1,z2,z3,z4],[z4,z3,z2,z1]);
           -z z2 z3 + z z4 z1 - z3 z1 z4 + z3 z4 z2 + z3 z2 z1 - z2 z1 z4
      z -> --------------------------------------------------------------
                     -z z3 - z z2 + z z4 + z z1 + z3 z2 - z4 z1

> f(z):

> collect(numer(%),z)/collect(denom(%),z);
        (-z3 z2 + z4 z1) z - z3 z1 z4 + z3 z4 z2 + z3 z2 z1 - z2 z1 z4
        --------------------------------------------------------------
                    z (-z3 - z2 + z4 + z1) + z3 z2 - z4 z1
First 56 57 58 59 60 61 62 Last Page 58 of 81