Applications, Examples and Libraries

Share your work here

SHA-0.3.zip includes a Maple archive and help data base that implement the SHA algorithm (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512).  The implementation is interpreted Maple, so will be considerably slower than a compiled routine, but these should be fast enough for likely uses in Maple.  For example

CodeTools:-Usage(SHA("The quick brown fox jumps over the lazy dog", 512));
memory used=502.00KiB,...

In 2010-2011, I persuaded tens of thousands of Russian and Ukrainian students and students in that Maple - a very useful thing.
Testimonials - the number of visits and thanks.
So I decided to resurrect some of my old sites.
Not just for history!

The first: Maple PoverTools.

http://powertool.narod.ru/

The complexplot3d command can color by using (complex) argument for the hue, and compute height z by magnitude. So, when rotated to view the x-y plane straight on, it can provide a nice coloring of the argument of whatever complex-valued expression is being plotted.

Another way to obtain a similar plot is to use densityplot (with appropriate values for its scaletorange option) and apply argument to the expression or function being plotted. For some kinds of complex-valued...

The June edition of the IBM Ponder This website poses the following puzzle:

Assume that cars have a length of two units and that they are parked along the circumference of a circle whose length is 100 units, which is marked as 100 segments, each one exactly one unit long.

A car can park on any two adjacent free segments (i.e., it does not need any extra maneuvering space).

The problem

Back in 1996 I was working for the Symbolic Computation Group at the University of Waterloo, developing algorithms and code...

11_1_eng.mw This Maple worksheet Ukrainian students have downloaded 84.581 times a week. ("ZNO")

I would like to pay  attention  to the PhD thesis by John Baber in an actual field of complex analysis done with Maple: http://arxiv.org/PS_cache/arxiv/pdf/1106/1106.4737v1.pdf . It should be noticed that the usage of Maple is an essential tool of this work (for example, see p. 28, 43, and around), not a fashion trend.

Sleep Sort is a hilarious (to me anyway) joke dressed up as a sorting algorithm.

Here it is in non-obfuscated (if somewhat garbagey) Maple code (need version 15 since it uses ?Threads,Sleep )

SleepSort := proc(L::list(posint),$)
local Lout, p, i;
    Lout := NULL;

    p := proc(n::posint,$)
        Threads:-Sleep(n);
        Lout := Lout, n;
    end proc:

    Threads:-Wait( seq( Threads:-Create( p(i...

Answering to that question, I posted several procedures finding minimal polynomials for the elements of finite fields. The best one was the following,

alias(a=RootOf(T^100+T^97+T^96+T^93+T^91+T^89+T^87+T^86+T^82+T^81+T^71+T^70+T^67+T^61+
T^60+T^57+T^54+T^53+T^52+T^49+T^48+T^45+T^44+T^42+T^39+T^36+T^33+T^32+T^31+T^29+T^28+T^27+
T^26+T^24+T^23+T^22+T^18+T^17+T^16+T^14+T^13+T^12+T^10+T^8+T^7+T^6+T^3+T+1)):

F:=GF(2,100,op(a)):
z:=F:-input(2):

MinPolyGF:=proc(x,y:=_X)
local A, i;
A:=Matrix(100,...

I recently stumbled upon a hypnotic video of 15 out-of-phase pendulums from a physics experiment at Harvard University.

The...

Following Christopher2222 request, I wrote the following procedures for "exact" cubic Hermite spline interpolation,

p:=proc(x0,p0,m0,x1,p1,m1,x)
local t,d;
d:=x1-x0;
t:=(x-x0)/d;
p0+(d*m0+(3*(p1-p0)-d*(2*m0+m1)+(2*(p0-p1)+d*(m0+m1))*t)*t)*t
end:

pb:=proc(x0,p0,x1,p1,m1,x)
local t,d;
d:=x1-x0;
t:=(x-x0)/d;
p0+(2*(p1-p0)-d*m1+(p0-p1+d*m1)*t)*t
end:

pe:=proc(x0,p0,m0,x1,p1,x...

   The Kolmogorov-Smirnov test is a widespread, simple, and effective test to check the hypotheses of the form H[0]:=F[ksi](x)=F(x), where a function F[ksi](x) is the CDF of a population distribution, a function F(x) is a given continuous function (the Kolmogorov  test), and the hypotheses of the form  H[0]:=F[1](x)=F[2](x), where F[j](x), j=1,2, are the CDF of two population distributions, both are assumed to be continuous (the Smirnov test).  See the ...

A Plot Component (on the right below) can act as a kind of 2-dimensional "slider" for inputing values of two parameters at once.

The polar plot (on the left below) makes use of both values.

If you click in the right Plot, and drag around the mouse cursor for a while, then the left Plot will be continuously updated.

Make sure to execute the collapsed code-edit region, to initialize it. (Just click on it, to execute. Or expand, look, and right-click on it.)

 

 

 

Click any point above, & Drag

 

Download plotslider1.mw

 

This is in response to a Question about the speed and memory use of an animated DEplot. The problems are that the example's animation was slow to create, and prohibitively expensive to save in a Document.

An alternative approach is to combine multiple calls to plots:-odeplot with a call to plots:-fieldplot to supply the background flow arrows. This is a lot faster. It takes less memory to create and run, but the GUI may still consume too much resources saving it. The good news is that it's so much faster that it's not inconvenient to re-run the entire thing from scratch. And so it's quite feasible to remove all the expensive output from the Document prior to saving and thus avoid the whole resources problem.

The original questioner also wanted to visualize with resect to two varying parameters. So I've also done an implementation of that using Embedded Components and two Sliders.

Here is the old DEplot animation. It takes about 40 sec to create it animation on an Intel i7.

Here is the new combined odeplot+fieldplot animation. It takes a second or two to create its animation on an Intel i7.

Here is the DEplot in Embedded Components. It's very slow, and the image doesn't change smoothly with the sliders.

Here is the new combined odeplot+fieldplot in Embedded Components. Its image changes pretty smoothly with the sliders.

I encourage completely quitting the GUI (not just restart, or close Document and re-Open) between comparison runs of these implementations, of you want to get a really good feel for the effects of both running them as well as saving them (with and without all output).

For the Embedded Component documents, the functioning code resides inside the "initialize" button. (right-click, go to Component Properties, Action When Clicked, only if you want to inspect it.) To run those two  Documents, execute all the commands (use the triple-exclam from the menubar if you like), and then press the "initialize" button, and then move the sliders.

The difference in performance is related partly to the use of hardware datatype Arrays in the PLOT structures generated by odeplot and fieldplot. (But an `arrow` primitive would help even more!)

And (I think) there is improvement by virtue of using dsolve/numeric/parameters in the use of `odeplot`. That saves overhead from repeated cold invocations of dsolve/numeric. And DEplot doesn't support that, since it expects as argument the system of DEs and ICs. The newer `odeplot` command accepts the procedure returned by dsolve/numeric, and thus allows for efficient repeated setting of parameter values. The `fieldplot` command doesn't need the solution of the DE system at all: it just needs the DEs.

I would have considered wrapping the whole combined approach up into a single command, but it might have to accept separate options for the view ranges, in order to always look its best. A smart version might be able to deduce the computed ranges from the odeplot output, and then create the background fieldplot based on that.

First 57 58 59 60 61 62 63 Last Page 59 of 71