Items tagged with computation computation Tagged Items Feed

Dear mapleprimes users,

I have a problem concerning this function:

Naief := proc(A::integer,B::integer, p::posint)
local x, a:= A mod p, b:= B mod p;

 for x from 1 to p-1 do
    if a^x mod p = b then return x end if
end do;
print(¨No solution.¨)

end proc

It works fine for what it should do, finding x for a^x = b mod p by inserting x from 1 to p-1 until it finds an
apprioperate x.

My problem is concerning its computation time, which I like to calculate with:

Codetools:- Usage(Naief(a,b,p), output = [cputime], quiet, iterations= 2^12)

The problem is that keeps repeating

alot even when a,b and p are immensely huge. I don`t know how to fix it, because I need real CPUtimes which increase
a,b and p increase. I get the idea that the values of the CPUtime are not realistic.


Thanks for the help!




Dear friends,

Recently I was surprised when discovered the following error in using the function solve. If I run the simlest example from the help system for the first time (or after restarting), the following error occurs:

If I run this example repeatedly, this brings the following:


Previously in earlier versions I used solve many times for very complex computations and have never seen something similar.

Any suggestions are welcomed.



I am trying to find the inverse of 8x8 generic symbolic matrix. Everytime I evaluate the program I get the following error:


Error, (in expand/bigprod) Maple was unable to allocate enough memory to complete this computation. Please see ?alloc


Can anyone guide me how to increase the memory allocation? And would that solve the problem for me?


Any help is appreciated.



I would like to announce a new unofficial record computation of the MRB constant that was finished on Sun 21 Sep 2014 18:35:06.

I really would like to see someone beat it with Maple!

It took 1 month 27 days 2 hours 45 minutes 15 seconds. I computed 3,014,991 digits of the MRB constant, (confirming my previous 2,00,000 or more digit computation was actually accurate to 2,009,993 digits), with Mathematica 10.0. I Used my version of Richard Crandall's code:



(*Fastest (at MRB's end) as of 25 Jul 2014.*)


prec = 3000000;(*Number of required decimals.*)ClearSystemCache[];

T0 = SessionTime[];

expM[pre_] := 

  Module[{a, d, s, k, bb, c, n, end, iprec, xvals, x, pc, cores = 12, 

    tsize = 2^7, chunksize, start = 1, ll, ctab, 

    pr = Floor[1.005 pre]}, chunksize = cores*tsize;

   n = Floor[1.32 pr];

   end = Ceiling[n/chunksize];

   Print["Iterations required: ", n];

   Print["end ", end];

   Print[end*chunksize]; d = ChebyshevT[n, 3];

   {b, c, s} = {SetPrecision[-1, 1.1*n], -d, 0};

   iprec = Ceiling[pr/27];

   Do[xvals = Flatten[ParallelTable[Table[ll = start + j*tsize + l;

        x = N[E^(Log[ll]/(ll)), iprec];

        pc = iprec;

        While[pc < pr, pc = Min[3 pc, pr];

         x = SetPrecision[x, pc];

         y = x^ll - ll;

         x = x (1 - 2 y/((ll + 1) y + 2 ll ll));];(*N[Exp[Log[ll]/ll],

        pr]*)x, {l, 0, tsize - 1}], {j, 0, cores - 1}, 

       Method -> "EvaluationsPerKernel" -> 4]];

    ctab = ParallelTable[Table[c = b - c;

       ll = start + l - 2;

       b *= 2 (ll + n) (ll - n)/((ll + 1) (2 ll + 1));

       c, {l, chunksize}], Method -> "EvaluationsPerKernel" -> 2];

    s += ctab.(xvals - 1);

    start += chunksize;

    Print["done iter ", k*chunksize, " ", SessionTime[] - T0];, {k, 0,

      end - 1}];

   N[-s/d, pr]];

t2 = Timing[MRBtest2 = expM[prec];]; DateString[]


MRBtest2 - MRBtest2M



I used a six core Intel(R) Core(TM) i7-3930K CPU @ 3.20 GHz 3.20 GHz with 64 GB of RAM of which only 16 GB was used.

t2 From the computation was {1.961004112059*10^6, Null}.




I have written a code that computes the fourier-bessel series of a function over the period [a,b].
When I wanted to get some numerical results, I noticed that it takes lots of time for maple to numerically compute the coefficients of the series. Each coefficient of the series is expressed in terms of some integrals that I was expecting maple to compute them in few seconds, however, when  I want to compute "N=100" terms of the series, it takes lots of time.

I was wondering if there is any way to boost up the numerical computation time. I will appreciate any help.

Below you can find my code.

Many many thanks for your attentions! :)

Say I have




each of them can be ran seperately. While I am running a single file, it looks like that the machine is not "using" too much computation power. I wonder if it's possible to run multiple at the same time ?

My CPU is i7 940X, with 4 dual core processors, so it has 8 threads.

I know that the GUI can run multiple worksheets seperately, but if in one of the worksheet, i click "run all" (!!! botton),  I will have to run each line separtely by clicking one at a time.

Is there a better way to do this? What's the best way to do this? I hope to somehow 'maximize' the full use of my CPU (without changing the code).




Two related questions: I'd like to measure the CPU time used by a computation. Should I use with(CodeTools)? or use  time[real]? What would be the most accurate way to measure the CPU time used by one call, say dsolve()?

Also, How would one return both the result of the computation and the time used in one call so that one does not have to make two separate calls: to obtain the result and to obtain the CPU time?


ode:=2*a*x^3*y(x)^3+2*x*y(x)+diff(y(x), x);

Gives result:=0.141 while

ode:=2*a*x^3*y(x)^3+2*x*y(x)+diff(y(x), x);

Gives result:= 0.145

But in both cases, I have to make another call to get the result of the DSolve in this example. result:=dsolve(ode=0,y(x)); which I'd like to avoid if possible. 

I am using Maple 18


I have a rank 1 array M of 1000 values.

I want to apply a function f on each value of M and its location giving,

[f(1,M[1]), f(2,M[2]), ... , f(1000,M[1000])]

is it possible to get this using map or map2 or map[n] or maptype (without using seq since its slowing down computation).

inotherwords can i access the member location inside a map evaluation?

Slides of the presentation at the VII Workshop Fast Computational and Applied Mathematics developed in graduate school at the National University of Trujillo. January 8, 2014.




L. Araujo C.

I work entitled Point Exeter made ​​for Fast VII workshop on applied and computational mathematics 2014 Trujillo Peru.   (version in spanish)


Lenin Araujo Castillo

Physics Pure

Computer Science


Thanks to the community through Maplesoft Mapleprimes that could develop in Computational Mathematics Achievement Day at our institution.

Two questions:

The algortihms that Groebner[Basis] uses at each step computes some "tentative" or "pseudo-basis". The "tentative" basis is not a Groebner basis but it is in the ideal generated by the original system of polynomial eq.

1) Is this correct ? Provided this is correct, then

2) How can one retrive the last "tentative" basis?
 If I just use timelimit I can abort the computations but how can one retrive the last computation?


I am to program a computation on maple.
But I get the message :

Error, unable to match delimiters

followed by the full sequence of command.


How can I do to fix this problem?

As described on the help page ?updates,Maple17,Performance, Maple 17 uses a new data structure for polynomials with integer coefficients. Our goal was to improve the performance and parallel speedup of polynomial algorithms that underpin much of the system and create a platform for large scale polynomial computations. Shown below is the new representation for 9xy3z

The operation: 2^29.403243784 gives me 7.0999999820*10^8.

However, using WolframAlpha, the answer is 7.10000000139658667836958142950829925944726171959 × 10^8.

These are 2 different answers. Can someone offer an explanation as to why this occurs and how I can avoid this problem?

Thanks in Advance!

Eddy Liu

1 2 3 Page 1 of 3