MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Just wanted to let everyone know that there is a Maple 16 update available. Maple 16.01 includes improvements to the mathematics, interface, and plotting capabilities of Maple, including:

    • Enhancements to the Physics package in the area of general relativity
    • Translations of tutors and assistants into French and Brazilian Portuguese
    • A correction to the problem in plotting multiple plots at once in non-Cartesian coordinates, as

    Using techniques previously used for generating color images of logistic maps and complex argument, attached is a first draft of a new Mandelbrot set fractal image applet.

    A key motive behind this is the need for a faster fractal generator than is currently available on the Application Center as the older Fractal Fun! and Mandelbrot Mania with Maple entries. Those older apps warn against being run with too high a resolution for the final image, as it would take too long. In fact, even at a modest size such as 800x800 the plain black and white images can take up to 40 seconds to generate on a fast Intel i7 machine when running those older applications.

    The attached worksheet can produce the basic 800x800 black and white image in approximately 0.5 seconds on the same machine. I used 64bit Maple 15.01 on Windows 7 for the timings. The attached implementration uses the Maple Compiler to attain that speed, but should fall back to Maple's quick evalhf mode in the case that the Compiler is not properly configured or enabled.

    The other main difference is that this new version is more interactive: using sliders and other Components. It also inlines the image directly (using a Label), instead of as a (slow and resource intensive) density plot.

    Run the Code Edit region, to begin. Make sure your GUI window is shown large enough for you to see the sides of the GUI Table conveniently.

    The update image appearing in the worksheet is stored in a file, the name of which is currently set to whatever the following evaluates to in your Maple,

    cat(kernelopts('homedir'),"/mandelbrot.jpg"):
    

    You can copy the current image file aside in your OS while experimenting with the applet, if you want to save it at any step. See the start of the Code Edit region, to change this filename setting.

    Here's the attachment. Comments are welcome, as I'd like to make corrections before submitting to the Application Center. Some examples of images (reduced in size for inclusion here) created with the applet are below.

    This post can be downloaded here:  Download May202012.mw

    Below we have approximations involving the MRB constant. The MRB constant plus a fraction is saved as P while a combination of another constant is saved as Q. We then subtract Q from P and always have a very small result!

    I am finding, if you add to an old question directed towards someone at maplesoft before the weekend but after a maplesoft business day has ended, your question may not be answered or addressed. This is because your new question in the thread has been swamped by newer questions and yours has trickled down the list and essentially becomes buried or lost. 

    I also find too much information related to posted questions are being summarized in the top level making it...

    Being easy to use is nice, but being easy to learn with is better. Maple’s ease-of-use paradigm, captured in the phrases “Clickable Calculus” and “Clickable Math” provides a syntax-free way to use Maple. The learning curve is flattened. But making Maple easy to use to use badly in the classroom helps neither student nor instructor.

    In the mid to late ‘80s,...

    In memory of a Friend. Maple 16 for Russian students.

    260412.zip

    Оформление - облегченное, чтобы работало на любом компьютере. Разархи и открыти файл ege.html. Неточности присутствуют, наверное. Поправим вместе.

    The basic plot routine in Maple 16 has a serious problem with the domain.  The following is an example.

    The domain is correct in Maple 15.  This failure occurs in both Windows 7 and Linux.

    I have been generating graphics in Maple 16 using the plotsetup(ps,...) command under Windows 7 and Linux.  Maple tech support has a fix for Linux and has confirmed that there is a bug in the Windows version.  These are a Windows eps (converted to png for uploading) and png of the same figure.  The eps conversion should not do this.

    There is no option to change your original email address and save in mapleprimes. 

    **edit add**  Sorry the option is there but the option to save the new email is not.

     

    Just a small digression.  It would be nice if the numbers on the x-axis could be rotated or angled so it does not look like they collide with each other.  When the numbers reach the 100's or 1000's there will be congestion. 

    This is perhaps a suggestion for a future Maple version as the current versions do not support number rotations on the axis.

     

    The Locator object is a nice piece of Mathematica's Manipulate command's functionality. Perhaps Maple's Explore command could do something as good.

    Here below is a roughly laid out example, as a Worksheet. Of course, this is not...

    Here is a short wrapper which automates repeated calls to the DirectSearch 2 curve-fitting routine. It offers both time and repetition (solver restart) limits.

    The global optimization package DirectSearch 2 (see Application Center link, and here) has some very nice features. One aspect which I really like is that it can do curve-fitting: to fit an expression using tabular data. By this, I mean that it can find optimal values of parameters present in an expression (formula) such that the residual error between that formula and the tabular data is minimized.

    Maple itself has commands from the CurveFitting and Statistics packages for data regression, such as NonlinearFit, etc. But those use local optimization solvers, and quite often for the nonlinear case one may need a global optimizer in order to produce a good fit. The nonlinear problem may have local extrema which are not even close to being globally optimal or provide a close fit.

    Maplesoft offers the (commercially available) GlobalOptimization package as an add-on to Maple, but its solvers are not hooked into those mentioned curve-fitting commands. One has to set up the proper residual-based objective function onself in order to use this for curve-fitting, and some of the bells and whistles may be harder to do.

    So this is why I really like the fact that the DirectSearch 2 package has its own exported commands to do curve-fitting, integrated with its global solvers.

    But as the DirectSearch package's author mentions, the fitting routine may sometimes exit too early. Repeat starts of the solver, for the very same parameter ranges, can produce varying results due to randomization steps performed by the solver. This post is branched off from another thread which involved such a problematic example.

    Global optimization is often a dark art. Sometimes one may wish to simply have the engine work for 24 hours, and produce whatever best result it can. That's the basic enhancement this wrapper offers.

    Here is the wrapper, and a few illustrative calls to it on the mentioned curve-fitting example that show informative  progress status messages, etc. I've tried to make the wrapper pretty generic. It could be reused for other similar purposes.

    Other improvements are possible, but might make it less generic. A target option is possible, where attainment of the target would cause an immediate stop. The wrapper could be made into an appliable module, and the running best result could be stored in a module local so that any error (and ensuing halt) would not wipe out the best result from potentially hours and hours worth of conputation.

    restart:
    randomize():
    
    repeater:=proc(  funccall::uneval
                   , {maxtime::numeric:=60}
                   , {maxiter::posint:=10}
                   , {access::appliable:=proc(a) SFloat(a[1]); end proc}
                   , {initial::anything:=[infinity]}
                  )
              local best, current, elapsed, i, starttime;
                starttime:=time[real]();
                elapsed:=time[real]()-starttime;
                i:=1; best:=[infinity];
                while elapsed<maxtime and i<=maxiter do
                  userinfo(2,repeater,`iteration `,i);
                  try
                    timelimit(maxtime-elapsed,assign('current',eval(funccall)));
                  catch "time expired":
                  end try;
                  if is(access(current)<access(best)) then
                    best:=current;
                    userinfo(1,repeater,`new best `,access(best));
                  end if;
                  i:=i+1;
                  elapsed:=time[real]()-starttime;
                  userinfo(2,repeater,`elapsed time `,elapsed);
                end do;
                if best<>initial then
                  return best;
                else
                  error "time limit exceeded during first attempt";
                end if;
              end proc:
    
    
    X := Vector([seq(.1*j, j = 0 .. 16), 1.65], datatype = float): 
    
    Y := Vector([2.61, 2.62, 2.62, 2.62, 2.63, 2.63, 2.74, 2.98, 3.66,
                 5.04, 7.52, 10.74, 12.62, 10.17, 5, 2.64, 11.5, 35.4],
                datatype = float):
    
    F := a*cosh(b*x^c*sin(d*x^e));
    
                                        /   c    /   e\\
                             F := a cosh\b x  sin\d x //
    
    infolevel[repeater]:=2: # or 1, or not at all (ie. 0)
    interface(warnlevel=0): # disabling warnings. disable if you want.
    
    repeater(DirectSearch:-DataFit(F
                          , [a=0..10, b=-10..10, c=0..100, d=0..7, e=0..4]
                          , X, Y, x
                          , strategy=globalsearch
                          , evaluationlimit=30000
                                  ));
    repeater: iteration  1
    repeater: new best  9.81701944539358706
    repeater: elapsed time  15.884
    repeater: iteration  2
    repeater: new best  2.30718902535293857
    repeater: elapsed time  22.354
    repeater: iteration  3
    repeater: new best  0.627585701120743822e-4
    repeater: elapsed time  30.777
    repeater: iteration  4
    repeater: elapsed time  47.959
    repeater: iteration  5
    repeater: new best  0.627585700905294148e-4
    repeater: elapsed time  55.221
    repeater: iteration  6
    repeater: elapsed time  60.009
     [0.0000627585700905294, [a = 2.61748237902808, b = 1.71949329097179, 
    
       c = 2.30924401405164, d = 1.50333106110324, e = 1.84597267458055], 4333]
    
    
    # without userinfo messages printed
    infolevel[repeater]:=0:
    repeater(DirectSearch:-DataFit(F
                          , [a=0..10, b=-10..10, c=0..100, d=0..7, e=0..4]
                          , X, Y, x
                          , strategy=globalsearch
                          , evaluationlimit=30000
                                  ));
    
     [0.0000627585701341043, [a = 2.61748226209478, b = 1.71949332125427, 
    
       c = 2.30924369227236, d = 1.50333090706676, e = 1.84597294290477], 6050]
    
    
    # illustrating early timeout
    infolevel[repeater]:=2:
    repeater(DirectSearch:-DataFit(F
                          , [a=0..10, b=-10..10, c=0..100, d=0..7, e=0..4]
                          , X, Y, x
                          , strategy=globalsearch
                          , evaluationlimit=30000
                                  ),
             maxtime=2);
    
    repeater: iteration  1
    repeater: elapsed time  2.002
    Error, (in repeater) time limit exceeded during first attempt
    
    # illustrating iteration limit cutoff
    infolevel[repeater]:=2:
    repeater(DirectSearch:-DataFit(F
                          , [a=0..10, b=-10..10, c=0..100, d=0..7, e=0..4]
                          , X, Y, x
                          , strategy=globalsearch
                          , evaluationlimit=30000
                                  ),
             maxiter=1);
    
    repeater: iteration  1
    repeater: new best  5.68594272127419575
    repeater: elapsed time  7.084
     [5.68594272127420, [a = 3.51723075672918, b = -1.48456068506828, 
    
       c = 1.60544055207338, d = 6.99999999983179, e = 3.72070034285212], 2793]
    
    
    # giving it a large total time limit, with reduced userinfo messages
    infolevel[repeater]:=1:
    Digits:=15:
    repeater(DirectSearch:-DataFit(F
                          , [a=0..10, b=-10..10, c=0..100, d=0..7, e=0..4]
                          , X, Y, x
                          , strategy=globalsearch
                          , evaluationlimit=30000
                                  ),
             maxtime=2000, maxiter=1000);
    
    repeater: new best  3.10971990123465947
    repeater: new best  0.627585701270853103e-4
    repeater: new best  0.627585700896181428e-4
    repeater: new best  0.627585700896051324e-4
    repeater: new best  0.627585700895833535e-4
    repeater: new best  0.627585700895607885e-4
     [0.0000627585700895608, [a = 2.61748239185387, b = -1.71949328487160, 
    
       c = 2.30924398692221, d = 1.50333104262348, e = 1.84597270535142], 6502]
    

    I came across a thing that does not make sense in Maple. If you click on:

    http://ichart.finance.yahoo.com/table.csv?s=CSV&a=10&b=15&c=1996&d=03&e=24&f=2012&g=d&ignore=.csv

    Then you will get a csv-file.

    Now if you download and save that file on your computer then you can open it with:

    I am surfing around looking for cloud database providers (a lot of them are free
    such as http://xeround.com) Then it struck me that maple has a cloud. Unfortunatly I
    dont think it can handle what I want it to do:

    Wouldnt it be cool if every maple user could have a personal or public data warehouse
    in the maple cloud instead of everyone having sql servers running localy with attached
    cron jobs and head aches.

    It...

    First 109 110 111 112 113 114 115 Last Page 111 of 306