130 Reputation

5 Badges

4 years, 233 days

MaplePrimes Activity

These are questions asked by greatpet

Given a polynomial, e.g. 3*x^2 + a*x*y + b*y^2, is there some built-in function which can give me a list of monomials, with each monomial represented as [coefficient, [exponent_of_x, exponent_of_y]] ? The above polynomial would turn into something like [ [3, [2,0]], [a, [1,1]], [b, [0,2]] ].

It's not difficult to write this procedure from scratch. The procedure would require two arguments: (1) the polynomial itself, (2) which symbols are considered variables (in the above case, x and y). The remaining variables, a and b, would then be treated as constants that appear as coefficients. But I'm wondering if there's a built-in function I can just use.

Suppose I have a list of 10 thousand expressions containing the symbol x. I would like to integrate all of them in the range x=0..1 and store the result in a new list or array of 10 thousand elements. I run Maple on a server with 32 CPUs and would like to parallelize the computation. Could you give some code samples showing how this can be done? Since the starting expressions vary greatly in complexity, some kind of dynamics load balancing (rather than dividing the calculation "equally") would be also very useful. Thanks for any help!

On a shared cluster with 32 CPU cores, how do I limit Maple (called from the Linux command line) to use only 8 cores? (Certain built-in operations in Maple are parallelized by default.)

I used to have this kind of code without problem:

myModule := module()
    option package;
    export myFunc;
    # local i;
    myFunc := proc()
        [seq(i, i in 1..10)]
    end proc;
end module;

But after upgrading to the latest version of Maple 2021, I get a warning

Warning, (in myModule:-myFunc) `i` is implicitly declared local |myModule.mpl:5|

I have to uncomment the local i declaration for the warning to go away. Has the behavior of seq changed in Maple 2021?

I need to use a remote machine with an outdated Maple 2016. But I have written my own package in Maple 2019 / 2020 on my laptop. When I try to load my code in Maple 2016, I got the error

Error, unexpected export declaration in module body

What are the main changes to the module system in the Maple language since the 2016 version? How should I modify the code to run it successfully? (I encounter no errors for other code which only contains procedures but not modules.)

1 2 3 Page 1 of 3