MaplePrimes Questions

Hello

I wonder if someone on the list can give me some guidelines on how to use Grid:-Seq.

I have applied Grid:-Set and Grid:-Seq to one of my problems where parallelization is a possibility.   In this problem, I have a massive list of lists that needs to be processed in chunks and then a new list is returned.

What I've found so far:

1) Grid-Seq won't work if I use a procedure from a private module that calls local (or exported) functions of the same module.  Solution:  I need to use savelib (there is a bug in Grid:-Seq)

2) Grid-Seqs seems to be working fine up to a point where it simply stops.  For example:   Starting with 431895 sets, the procedure divides them into 864 sets of 500 elements (the last one does not usually contain 500 elements).  Then I use res:=Grid:-Seq['tasksize'=9](myFunction(newSets[i],...,....),i=1..864).   The messages sent out by Grid:-Seq are 

Seq: using tasksize=9; number of elements= 864, number of partitions = 96

......

Seq: done sending all partitions

Seq: received results from all nodes; collating results

After two hours running and using 36 cores, the result is available in res.  The next step is to use the results in res for another cycle of calculations.  1503462 sets = 3007 sets of 500 elements.  The messages sent out by Grid:Seq are 

Seq: using tasksize=9; number of elements= 3007, number of partitions = 335

......

Seq: done sending all partitions

The last message showed up on the screen after an hour. During the process, I saw the current tasks finishing and new ones starting.  However I could not see "Seq: received results from all nodes; collating result" after a day running.  I am using timelimit to be sure that all calculations will finish no matter what.  

I have checked the system information and found that: 1) all 72 cores are running but they are jumping from 0% to 100% (in the example that works I could see all of them in 100% solid), 2) Memory is at 156 GB (200 Gb is the limit) and no swap to disk.

I have also noticed:

  1. If I use Maple 2017, not even the first example works.
  2. tasksize=9 somehow helps with similar problems.  If the size is left for Maple to decide, it seems that the problem happens for sets of smaller size.
  3. On linux I had to use "kill -9" to remove maple from every single core. My impression is that Grid:-Seq does not clean up the processes after they finished.  
  4.  The problem seems to be on "results from all nodes; collating result".

 

I know that the explanation above in rather vague, but if someone has any clue or guidelines on how to solve this problem, please share it with me.

 

Many thanks

 

Ed

 

 

 

Hi All,

https://www.maplesoft.com/support/helpJP/Maple/view.aspx?path=NAG%2ff11dec

This link shows that there are 3 options rgmres, cgs and bicgstab. When I use iterative solver, it uses the cgs option.

LinearAlgebra:-LinearSolve(
      A, b, method= SparseIterative)

LinearSolve:   "copying right hand side to enable external call"
LinearSolve:   "using method"   SparseIterative
LinearSolve:   "using method  "   SparseIterative
LinearSolve:   "calling external function"
LinearSolve:   "using CGS method"
LinearSolve:   "preconditioning with incomplete LU factorization"
LinearSolve:   "level of fill = "   0
LinearSolve:   "using complete pivoting strategy"
LinearSolve:   "dimension of workspaces for preconditioner = "   44
LinearSolve:   "using infinity norm in stopping criteria"
LinearSolve:   "setting maximum iterations to "   200
LinearSolve:   "setting tolerance to "   .10e-7
LinearSolve:   "NAG"   hw_f11zaf
LinearSolve:   "NAG"   hw_f11daf
LinearSolve:   "NAG"   hw_f11dcf
LinearSolve:   "number of iterations"   1
LinearSolve:   "residual computed last as"   3.33066907387547e-016
 

 

How can I force Maple to use BiCGSTAB?

thanks

I think the Maple Physics package has the promise to revolutionize the teaching of physics. Two recent tutorials have been very helpful (“Vectors in Spherical coordinates using tensor notation” and “A Complete Guide for performing Tensors computations using Physics”).   Unfortunately, despite these, I still have problems even when trying to use it for simple things. No doubt this is primarily a sign of my limitations. However, in the hope that others might share this, I have the following question.

As an exercise, I would like to use the Maple Physics Tensor notation to derive the expression for acceleration in spherical coordinates – identifying Coriolis force, etc.  I can’t get past the first step – how to define the tensor dx/dt.   That is, how do I write the time derivative of the Maple space coordinates [X].  I assume that this can be done in about 3 steps, if someone would be kind enough to humor my ignorance. Thanks in advance.

Why on earth is Maple giving me all these solutions compared to last year??

Last year:

Now:

I am trying to  find the funtion of this graph 

I tried
f := x -> a12*x^12 + a1*x^11 + a2*x^10 + a3*x^9 + a4*x^8 + a5*x^7 + a6*x^6 + a7*x^5 + a8*x^4 + a9*x^3 + a10*x^2 + a11*x + a13;
solve([f(-4) = 3, f(-3) = 1, f(-2) = 1, f(-1) = 1, f(0) = 0, f(1) = -1, f(3) = -5, f(4) = -5, f(5) = 1, eval(diff(f(x), x), x = -2.5) = 0, eval(diff(f(x), x), x = -1.5) = 0, eval(diff(f(x), x), x = 3.5) = 0, f(6) = 3], [a12, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a13]);

I got

[[a12 = 4.697405911*10^(-6), a1 = -0.00006250181861, a2 = -1.444112429*10^(-6), a3 = 0.002660698702, a4 = -0.004689494622, a5 = -0.04291772722, a6 = 0.08407481146, a7 = 0.3251529098, a8 = -0.4752692626, a9 = -1.066462933, a10 = 0.3958806924, a11 = -0.2183704462, a13 = 0.]]

plot(4.697405911*10^(-6)*x^12 - 0.00006250181861*x^11 - 1.444112429*10^(-6)*x^10 + 0.002660698702*x^9 - 0.004689494622*x^8 - 0.04291772722*x^7 + 0.08407481146*x^6 + 0.3251529098*x^5 - 0.4752692626*x^4 - 1.066462933*x^3 + 0.3958806924*x^2 - 0.2183704462*x, x = -4 .. 5)

It doesn't like the graph of the first picture. 

Since Maple comes with source code that one can display. Even though it is stripped of all comments, which makes it hard to follow sometimes, I was wondering if there are any tools to help one get the large picture of what is there without having to step and go through all the thousands and thousands of the help pages jumping from one to another and losing the path.

I am looking for something similar to the tree program one finds on Unix, but applied to Maple's logical package hierarchy.

Since Maple has thousands of packages and subpackages and some has sub subpackages and then thousands of commands below all these, such an automated tool will be useful.

For example, I could ask it to show me top level packages and subpackages only (and not show the names of all the functions below that). This will help one see what is out there at a glance. i.e. see the big picture.

Here is an example of tree command I found on the net. But instead of looking at directories, the maple one will look at logical package tree.

 

For example, I just made short example for the Student package now

 

But doing the above by hand for everything is not practical. The above is just partial view of one package, and there are hundreds others. 

It will be nice if there is a tool, where one can tell to show the Maple package tree and the level of details to show. This will help one learn Maple better also.

The output of such tool does not even have to graphical. It could plain text, something like this

 

Student
      LinearAlgebra
               Basis
               IntersectionBasis
               etc.....
      Calculus1
               ......
               ......
Physics
DataSets
.....

      
       

   

Alignment is done using tabs for example to help show the structure.

Any suggestions?

 

Taking the example below from the help page, showstat displays the content of a procedure. This is convenient when writing code. However, to perform copy & paste, I would like to get rid of the displayed line number. Is that possible?

f := proc(x) if x <= 2 then print(x); print(x^2) end if; print(-x); x^3 end proc:
showstat(f);

f := proc(x)
   1   if x <= 2 then
   2       print(x);
   3       print(x^2)
       end if;
   4   print(-x);
   5   x^3
end proc

 

Hi everyone, I hope you are staying safe from coronavirus.

I have a table of data points in excel (attached file) and want to plot a smooth surface plot in Maple, the plot will look like in the image below. How can I do it in Maple (2017)? I tried matrixplot(matrix) and the surface is good. However, I couldn't change the X, Y axes value since it should be the default value. 

Thank you very much.PlotTest.xlsx

The uploaded worksheet contains an apparently unsolvable ode.

Please see the text in the worksheet for a description of the problem.

Roller_coaster_loop.mw

Hi, 

I've define a list V of 2 random variables and saved the result in an .m file.
When I read this same file and try to sample V I get a message error which, after quick search, comes from the fact that the V I read is no longer a random variable.
How can I fix this?

TIA


 

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(Statistics):

V := [ RandomVariable(Normal(0, 1)), RandomVariable(Uniform(0, 1)) ]

[_R, _R0]

(2)

map(v -> [attributes(v)][3], V);
print~(map(Sample, V, 5)):

"[[Typesetting:-mi("_ProbabilityDistribution",italic = "true",mathvariant = "italic"), Typesetting:-mi("_ProbabilityDistribution0",italic = "true",mathvariant = "italic")]]"

 

Vector[row](5, {(1) = -1.07242412799827, (2) = -.329077870547065, (3) = -.617091936909790, (4) = .214466745245291, (5) = -0.254281280423846e-1})

 

Vector[row](%id = 18446744078251172318)

(3)

dir := currentdir():
f   := cat(dir, "/Desktop/rvs.m"):
save V, f

 

restart

with(Statistics):

dir := currentdir():
f   := cat(dir, "/Desktop/rvs.m"):
read f:

anames(user);
V;

dir, f, V

 

[_R, _R0]

(4)

print~(map(Sample, V, 5)):

Error, (in Statistics:-Sample) invalid input: expected distribution or algebraic expression with random variables, but received _R

 

attributes(V[1]); # The Vs are no longer random variables


 

Download Why.mw

Hi, 

I work for the University of Dundee as a packager for the staff and student desktops.

We have a licence for 2020 applied to our licance server, I only require the software.

Is your free version the full package that once it sees the licence server will unlock all the features do I need to download a specific version from yourselves,

Best regards

Colin 

restart;
plot([sin(x), sin(x), x=0..420]);

The matrix A := op([1,1], %)  has equal columns, so the bug is in the PLOT engine.
plot(A) generates the same plot.
See also the "circle":
plot([cos(x), sin(x), x=0..5000*Pi]);

 

help me for solve the error of plot

p1.mw

Hello everyone! I'm pretty new to Maple and struggling with some basics.

 

I want to use a for-loop to print out the square numbers from 11 to 20. And the outputs should be presented within a list.

This is what I have so far:

|> for i from 11 to 20 do print(i^2) od;


                              121

                              144

                              169

                              196

                              225

                              256

                              289

                              324

                              361

                              400

But I don't know how I can put all these results in a list, so that in the end it looks like this:

L: = [121,144,169,196,225,256,289,324,361,400]

 

I'm grateful for every answer :)

 

 

First 324 325 326 327 328 329 330 Last Page 326 of 2195