acer

32353 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

[edited, after further reflection]

It is possible to construct an alternate Matrix Browser that is not implemented within a Maplet.

There are a variety of possibilities about how to do it. I hope to find time to post some prototypes to illustrate what (tricks) I have in mind.

How satisfactory these might be would be subjective -- each individual may put differing value of qualities of a Matrix Browser. Those could include such things as non-locking control, separate floating window occurence, dynamic interaction with data, different tab, and flexible ability to switch on-the-fly between any of the above. And so on.

It also raises these questions: is it better to get an alternative non-Maplet Matrix browser right now, or would it be better to implement a sophisticated "array data" analyzer? (The DataMatic, folks. It slices, it dices...) Or would a few simple context-menu driven pointplots suffice?

acer

Try issuing the FunctionAdvisor(BesselI) command. You may be interested in particular in the differentiation rule. And indeed you can also issue,

FunctionAdvisor(BesselI,"differentiation_rule");

which should corroborate this:

> diff(BesselI(0,f(x)),x);
                                           /d      \
                          BesselI(1, f(x)) |-- f(x)|
                                           \dx     /
 

acer

Try issuing the FunctionAdvisor(BesselI) command. You may be interested in particular in the differentiation rule. And indeed you can also issue,

FunctionAdvisor(BesselI,"differentiation_rule");

which should corroborate this:

> diff(BesselI(0,f(x)),x);
                                           /d      \
                          BesselI(1, f(x)) |-- f(x)|
                                           \dx     /
 

acer

Thanks very much for the mention, Axel. But I would decline. Having said that...

I would hope that the choice of winner can bring with it the opportunity to get good feedback on key ways to improve Maple.

There is of course quite a bit of feedback provided already -- in the posts, replies and comentary of the most active posters to this site. Attentively reading (all) the posts here can itself lead to insight. There are quite a few important common themes. Some of that may add extra weight for making design and development decisions and choosing directions. Some of it might lead to a few "Aha!"s. Some of it might corroborate views held already. Some parts may be surprising and controversial.

It would be interesting to read the views on improving Maple of any of the nominees, if they chose to post them here explicitly.

acer

It's not clear what you mean by "complex expressions" in the previous reply.

I haven't actually looked to see which scenario that I describe below might pertain.

On the one hand, it could mean that  you see expressions containing  symbolic variables (names) and `I` as well. But it is possible that such terms vanish upon simplification or upon further instantiation of the variables with values. You mentioned a cubic (polynomial, presumably). The "formulae" for the roots of a cubic may appear to be complex-valued, with `I` present, even though evaluation and symbolic simplification leads to a theoretically expected purely real answer.

Or it could mean just be that you see nonzero imaginary components with very small floating-point coefficients. That is what I tried to explain in my previous reply . Here's a simple example. Suppose you have sqrt of some subexpression, and you expect that subexpression to evaluate to zero under exact arithmetic when the variables are instantiated at exact values. And then instead the subexpression is evaluated as a floating-point computation. The subexpression result may come out, under floating-point computation, as a very small negative value and not precisely zero. And so taking sqrt of that will introduce a very small nonzero floating-point imaginary component. Usually, increasing the working precision for the floating-point computations will lead to those imaginary artefacts shrinking in magnitude.

acer

The fact that other names (in some same class) are protected is not in itself a good reason to protect some name.

A good reason could be that assignment to the name causes things to break.

A name that is protected is a name that is also removed from the namespace available to users. Maple is thus "improved" by having less names protected. And hence a name should not be protected without good reason.

If examples are found of unprotected names for which their assignment breaks Maple then there are two reasonable courses of action: protect the name, or fix the instances of use -- if possible -- by quoting, etc.

Do you have examples where assignment to these unprotected dagtag names causes parts of Maple (not user-authored parts) to break?

nb. "parts of Maple" should really also cover code (or objects) that is emitted by Maple itself.

acer

A single call to fff returns a (Maple sequence) of two values. The first is the original code's prof_s and the second is prof_. They'll come back like this,

> fff( X, 100, 4, 100 );
                     -2.24688183307647, -23.3347550549661

If you do it 10 times, like seq(fff(...),i=1..10) then it will return 10 pairs: prof_s, prof_, prof_s, prof_, etc.

I gave the time() example, in case you were interested in seeing how fast it could compute 1000 runs.

The notation foo:-bar means the member bar from the module (package) foo.

I created X outside of fff, and passed it in (as the parameter `dist`). X is a procedure that takes a posint (n, say) and returns a Vector of sampled values from the distribution. Apart from being more efficient to have the creation of X outside of the procedure fff, I thought that it might be nice for you to be able to easily change the distribution details (if you wanted).

acer

A single call to fff returns a (Maple sequence) of two values. The first is the original code's prof_s and the second is prof_. They'll come back like this,

> fff( X, 100, 4, 100 );
                     -2.24688183307647, -23.3347550549661

If you do it 10 times, like seq(fff(...),i=1..10) then it will return 10 pairs: prof_s, prof_, prof_s, prof_, etc.

I gave the time() example, in case you were interested in seeing how fast it could compute 1000 runs.

The notation foo:-bar means the member bar from the module (package) foo.

I created X outside of fff, and passed it in (as the parameter `dist`). X is a procedure that takes a posint (n, say) and returns a Vector of sampled values from the distribution. Apart from being more efficient to have the creation of X outside of the procedure fff, I thought that it might be nice for you to be able to easily change the distribution details (if you wanted).

acer

Perhaps I might offer some advice. Sorry that I currently don't have time to offer code.

Don't have the objective function `Diffproc` itself create a new procedure for (local) f on the fly, with each and every call. Create an objective procedure just once (inside GlobalFit, say). Either subs the parameters right in (before calling GlobalSolve) to get the objective, or declare the parameters in it as globals. But don't use an objective that itself internally creates an entirely new procedure with every single invocation. The NbrP, the spline stuff, the creation of f, the subs of R,A,K... roll it all up so that when GlobalSolve is called the objective is a proc that either already contains the right parameters or accesses them as globals. Have the objective function do math, and not dynamic procedure creation. Who knows, the 13 instances of the objectives could get called tens or hundreds of thousands of times.

Did you want to use evalf(int(...) or evalf(Int(...))?

There are other style and coding issues such as other undeclared globals, using protected name `Diff` as a local, appending to lists/sets in a loop, etc. But they may be relatively minor.

You might also consider running Maple's code profiling mechanisms against it, to see where the time and memory goes.

acer

Perhaps I might offer some advice. Sorry that I currently don't have time to offer code.

Don't have the objective function `Diffproc` itself create a new procedure for (local) f on the fly, with each and every call. Create an objective procedure just once (inside GlobalFit, say). Either subs the parameters right in (before calling GlobalSolve) to get the objective, or declare the parameters in it as globals. But don't use an objective that itself internally creates an entirely new procedure with every single invocation. The NbrP, the spline stuff, the creation of f, the subs of R,A,K... roll it all up so that when GlobalSolve is called the objective is a proc that either already contains the right parameters or accesses them as globals. Have the objective function do math, and not dynamic procedure creation. Who knows, the 13 instances of the objectives could get called tens or hundreds of thousands of times.

Did you want to use evalf(int(...) or evalf(Int(...))?

There are other style and coding issues such as other undeclared globals, using protected name `Diff` as a local, appending to lists/sets in a loop, etc. But they may be relatively minor.

You might also consider running Maple's code profiling mechanisms against it, to see where the time and memory goes.

acer

Since the Sockets:-Serve call will not return (and since that doesn't appear to function from within a Thread), maybe the script could also send a string to automatically open a blank worksheet (after starting up of the GUI to initialize the Serve call).

I'm not sure that it's that big a deal. It's only one instance of having to do File->Open manually per session, compared to the many instances that may be avoided (for some people). And without a switch/option it would always be only either a Worksheet or a Document. And there might be a need (?) for the script to pause, until the socket is ready. And the blank .mw template file would need to read-only, unless someone figures out some other INTERFACE_WORKSHEET call which opens a new empty worksheet.

acer

Does all of commandline Maple's useful printout go to stdout rather than stderr? If so then maybe you could just wrap x/maple in another script which directs stderr to /dev/null.

Eg,

#!/bin/bash
maple12 $* 2> /dev/null

acer

Could you not open a .mw with the automw batch file, utilizing the "Open with" facility? That was my hope. Of course, the first time it's tried the batch file would have to be located with a "browse". (I thought that Windows could use .exe, .com, and .bat to "open" files.)

I was hoping that, used once, the batch file would stay in the short list of suggested applications for the given .mw filename extension.

The intention is also that the (maple) script fire up a new GUI instance as a fallback (on socket communication failure).

acer

In Worksheet (not Document) mode the input as "Maple Notation" should be 1D, appearing as red input text. But, also in Worksheet mode, input can be in "2D Math" notation which appears in black and is mathematically typeset.

Could it be that you were trying it in a Document instead of a Worksheet.

acer

In Worksheet (not Document) mode the input as "Maple Notation" should be 1D, appearing as red input text. But, also in Worksheet mode, input can be in "2D Math" notation which appears in black and is mathematically typeset.

Could it be that you were trying it in a Document instead of a Worksheet.

acer

First 518 519 520 521 522 523 524 Last Page 520 of 592