Product Tips & Techniques

Tips and Tricks on how to get the most about Maple and MapleSim

Just came across this

Press esc twice then enter.  Maple becomes unresponsive. 

 

 

I made a small change to the Task Filtering code I uploaded a few weeks ago.  The new code has better memory performance and, most importantly has more stable memory usage which means it can actually run very large examples.  Here is the new version of the code:

FilterCombPara := module( )
    local ModuleApply,
            doSplit,
            splitCombs,
            makeNewPrefix,
            lessThanX,
            filterCombs;

    lessThanX := proc( x, i ) x<=i; end;

    doSplit := proc( i::integer, prefix::set(posint), rest::set(posint),
                                                k::posint, filter::appliable, $ )
        splitCombs( prefix union {i}, remove( lessThanX, rest, i ), k-1, filter );
    end;

    splitCombs := proc( prefix::set(posint), rest::set(posint), k::posint,
                                                                filter::appliable, $ )
        if ( numelems( rest ) < k ) then
            NULL;
        elif ( k = 1 ) then
            filterCombs( prefix, rest, filter );
        else
            op( Threads:-Map( doSplit, rest, prefix, rest, k, filter ) );
        end;
    end;

    makeNewPrefix := proc( i, prefix ) { i, op( prefix ) } end;
    filterCombs := proc( prefix::set(posint), rest::set(posint), filter::appliable, $ )
        local i, f;

        op(select( filter, map( makeNewPrefix, rest, prefix ) )):
    end;

    ModuleApply := proc( n::posint, k::posint, filter::appliable, $ )
        [ splitCombs( {}, {seq( i,i=1..n )}, k, filter ) ];
    end;

end:

This code has the small mapping functions as module members instead of declared inline.  This means that less memory is churned as this code is excuted.  For a long runs, this helps keeps the memory stable.

As an example, I ran the following example:

> CodeTools:-Usage( FilterCombPara( 113,7, x->false ) );
memory used=17.39TiB, alloc change=460.02MiB, cpu time=88.52h, real time=20.15h
                                                  []

It used 88 CPU hours to run, but only 20 hours of real time (go parallelism!)  It used 17 Terabytes of memory, but only allocated 500 M.  This example is pretty trival, as the filter returned false for all combinations, so it did not collect any matches during the run.  However as long as the number of matches is small, that shouldn't be an issue.  If the number of matches is too large to fit in memory, then this code may need to be modified to write the matches out to disk instead of trying to hold them all in memory at once.

Darin

-- Kernel Developer Maplesoft

FilterComb.mw

Two problems surfaced when I upgraded my Mac to Mavericks (OS X 10.9).

First, the old Java SE installation was removed (actually, some linkages were destroyed), so a Maple launch puts up a dialog "need to install Java." Apple hasn't yet (10/23/13) updated the software database links --- installation fails with a "can't find software" error. I reinstalled Java using the version at http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2013-05.dmg. (The links can be redone, it's just easier to reinstall.)

Second, the (new?) structure for /Library/Frameworks made my Maple license invalid. I dug out the old email with my activation code, then re-activated.

And all is now copacetic.

This blog post is a response to a post on MaplePrimes.  MaplePrimes user wkehowski asked how the Task Model could be used to filter combinations.  The basic problem is formalated like this:  We want a function, I'll call it FilterComb, that accepts positive integers...

I have located a claimed webpage http://www.advanpix.com/2013/10/03/advanpix-vs-maple-sparse-solvers-comparison/ that shows Advanpix doing sparse matricies much faster than Maple.

The slowness is usually the result of poor coding or someone not well versed in Maple software. 

Anyone care to comment on the times?  I am sure the presented code there can be improved.

Greetings to all.

I have been using the numtheory package for quite some time now and it has helped me advance on a number of problems. Recently an issue came to my attention that I have known about for a long time but somehow never realized that it can be fixed. This is the fact that the numtheory package does not know about Dirichlet series, finite and infinite. Here are two links:

We’ve recently added a new set of questions to the Maple T.A. Cloud for English language proficiency tests. These questions demonstrate how Maple T.A. can be used to generate text-based questions that take advantage of the randomization feature. These questions were created by Metha Kamminga, an Independent Learning Professional in the Netherlands. Metha is a strong proponent of Maple T.A. in Europe, and transformed the testing and assessment system in Delft University before her retirement.

TU Delft University aims to transform learning through the use of technology. Its ambition is to eventually offer fully digitalized degree programs and it believes that digital testing and assessment can play an important role within this process. They are using Maplesoft’s online testing and assessment suite, Maple T.A., to move their courses to a digital assessment environment. To read the full user story, click here.

Visit the Maple T.A. Cloud to access the questions mentioned above and to browse the full collection of questions.

Greetings to all. I will keep this brief and to the point. I would like to point out a certain deficit in the integral transform package. I have recently been calculating some Mellin transforms at this link and the base functions are of the following type.

g := (p, q) -> 1/(x+p)/(x+(p*q-1)/q);

Now to see the deficit here are some Mellin transforms that...

I just wanted to remind everyone that this quarter's Möbius App Challenge closes Sept. 30.  This quarter's prize is an iPad Prize Pack, which looks very cool but sadly, I'm not allowed to enter.

To enter the contest, all you need to do is:

1) Create an interactive App in Maple

2) While in Maple, log-in to the MapleCloud through the MapleCloud palette.

3) Click on the Send Document to the Cloud button

When upgrading from Opensuse 12.2 to opensuse 12.3 with an nvidia graphics card I got some strange behavior.  It appears that something in the old maple configuration files was causing the trouble.  To eliminate the problem I  deleted the .maple and .maplesoft directories.

 

If you have some serious configuration information, you would need to save that first or track down exactly where the error ocurs.

An update to Maple 17 is now available. It includes improvement in several different areas of the product, including a new keyboard shortcut for inline evaluation and updates to the Physics package.

To get this update, you can use Tools>Check for Updates from within Maple, or visit Maple 17.02 Downloads, where you can also find a few more details.

eithne

We have just released the MapleSim Hydraulics Library from Modelon, a new add-on component library for advanced hydraulics modeling.  The result of a technology partnership with Modelon, the renowned developer of high-quality Modelica libraries, the MapleSim Hydraulics Library from Modelon allows you to:

  • Seamlessly combine hydraulic subsystems and components with other domains in a single modeling environment
    • Choose from over 150 components...

A peculiar consequence of the "smartview" of plots see updates Maple16 (plotting) is that the plot of a constant function only shows the rounding errors:

plot( arcsin+arccos, -1..1 );

Obviously Maple doesn't automatically simplify arcsin(x)+arccos(x) to Pi/2.

I was trying to get the labels and titles in a plot to be typeset using LaTeX fonts on a computer running SUSE 12.2.  Everything worked on a Windows 7 computer with the LaTeX fonts installed.  Maple 17 would use not use the CMU Open Type fonts that were installed on the Linux computer.  After switching in the CMU True Type fonts for the CMU Open Type fonts, everything works properly in the attached worksheet on the Linux machine.

  

I have a rather complicated expressions involving several parameters. The parameters are calibrated to some baseline. I'm interested in having a quick look at how changing each parameter changes the value of the expression. This is very standard. I wrote a procedure to create a list of values to the left and to the right of the base value for a given parameter. I then use that to look at my expression, to plot lists of expressions, and so on.

I thought I'd share this...

First 26 27 28 29 30 31 32 Last Page 28 of 66