Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Here's a very simple example, working as intended:

 

 

Now, if I try to use the exception indexing function:

 

 

We can notice that b[1] isn't using exception anymore (as if the fourth input overwrote the second one) and that b[1][2] isn't linked to the value "two". However, if I define the tables first, I get the expected result:

 

 

Why does the exception indexing function prevent me from getting an existing table entry in the second case?

Hi,

how to generate a graph of ellipsoid from ellipse equation ( revolution x axis or y axis) ?

Thanks

QEllipsoide.mw

Hi Guys,

I am trying to intgrate a function involving hyperbolic functions in a range of 0 to 1 and it is giving me very large value of 10^94. However, on doing integration terms terms i can see that some large terms involving 10^191 cancel out with each other and I can have a fnite value of this integration. It would be really helpful if someone can help me out why it is happening with int function and how can I solve this case involving hyperbolic function. For reference maple file is attached. Thanks in advance and much appreciated.

With Regards

Sunit

question.mw

I've drawn shape with the Graph function and all the lines are drawn as the same length even though the shape is weighted and when I do the WeightMatrix function I get the right weights.  What do I need to do to have the lines drawn to the correct length?

THE ISSUE: It's returning a list of [1] when it should be returning [1,1,1,7]

##Find remainder##
rm := proc(a, b) local n; n := 0; while 0 <= b - n*a do n := n + 1; end do; b - (n - 1)*a; end proc;
rm := proc (a, b) local n; n := 0; while 0 <= b-n*a do n := n+1 

   end do; b-(n-1)*a end proc


rm(8, 3657);
                               1

rm(16, 12345);
                               9

##FINDING THE WHOLE NUMBER PORTION ##
whole := proc(a, b) local r, i; r := 0; i := 0; if a < b then r := rm(a, b); i := (b - r)/a; else 0; end if; end proc;
whole := proc (a, b) local r, i; r := 0; i := 0; if a < b then 

   r := rm(a, b); i := (b-r)/a else 0 end if end proc


whole(8, 3657);
                              457

whole(16, 12345);
                              771

 


j = whole(8, 3657);
                            j = 457

k = rm(8, 3657);
                             k = 1

L := [];
                            L := []

L := [op(L), rm(8, 8657)];
                            L := [1]

j = whole(8, 457);
                             j = 57


##GETTING THE LIST OF DIGITS (BEFORE REVERSING)##
HELPER := proc(a, b, L) local j; j := whole(a, b); [op(L), rm(a, b)]; if 0 < j then HELPER(a, j, L); else ; end if; L; end proc;
HELPER := proc (a, b, L) local j; j := whole(a, b); [op(L), 

   rm(a, b)]; if 0 < j then HELPER(a, j, L) else  end if; L end 

   proc


CNS := proc(a, b) HELPER(a, b, L); end proc;
          CNS := proc (a, b) HELPER(a, b, L) end proc

 

CNS(8, 3657);
                              [1]

 

HELPER(8, 3657, L);
                              [1]

 

There is an interesting preprint here, on a method for integration of some pseudo-elliptic integrals.

It was mentioned in a (sci.math.symbolic) usenet thread, which can be accessed via Google Groups here.

Inside the paper, the author mentions that the following is possible for some cases -- to first convert to RootOf form.

restart;

kernelopts(version);

`Maple 2020.0, X86 64 LINUX, Mar 4 2020, Build ID 1455132`

ig:=((-3+x^2)*(1-6*x^2+x^4)^(-1/4))/(-1+x^2);

(x^2-3)/((x^4-6*x^2+1)^(1/4)*(x^2-1))

int(ig,x);

int((x^2-3)/((x^4-6*x^2+1)^(1/4)*(x^2-1)), x)

infolevel[int] := 2:

S:=simplify([allvalues(int(convert(ig,RootOf),x))],size):

Stage1: first-stage indefinite integration

Stage2: second-stage indefinite integration

Norman: enter Risch-Norman integrator

Norman: exit Risch-Norman integrator

int/algrisch/int: Risch/Trager's algorithm for algebraic function

int/algrisch/int: entering integrator at time 9.029

int/algrisch/int: function field has degree 4

int/algrisch/int: computation of an integral basis: start time 9.031

int/algrisch/int: computation of an integral basis: end time 9.038

int/algrisch/int: normalization at infinity: start time 9.039

int/algrisch/int: normalization at infinity: end time 9.048

int/algrisch/int: genus of the function field 3

int/algrisch/int: computation of the algebraic part: start time 9.059

int/algrisch/int: computation of the algebraic part: end time 9.060

int/algrisch/int: computation of the transcendental part: start time 9.063

int/algrisch/transcpar: computing a basis for the residues at time 9.068

int/algrisch/residues: computing a splitting field at time 9.068

int/algrisch/transcpar: basis for the residues computed at time 9.103

int/algrisch/transcpar: dimension is 2

int/algrisch/transcpar: building divisors at time 9.300

int/algrisch/transcpar: testing divisors for principality at time 9.605

int/algrisch/goodprime: searching for a good prime at time 9.606

int/algrisch/goodprime: good prime found at time 9.704

int/algrisch/goodprime: searching for a good prime at time 9.704

int/algrisch/goodprime: good prime found at time 9.762

int/algrisch/areprinc: the divisor is principal: time 10.084

int/algrisch/areprinc: the divisor is principal: time 11.833

int/algrisch/transcpar: divisors proven pincipal at time at time 11.833

int/algrisch/transcpar: generators computed at time 11.834

int/algrisch/transcpar: orders are [1 1]

int/algrisch/transcpar: check that the candidate is an actual antiderivative

int/algrisch/transcpar: the antiderivative is elementary

int/algrisch/transcpar: antiderivative is (1/2)*ln((RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^3*_z^3-RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^2*_z^4+RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^2*_z^2-3*_z^3*RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)+RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)*_z-5*_z^2+1)/((_z+1)*(_z-1)*_z^2))+(1/2)*RootOf(_Z^2+1)*ln((RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^2*RootOf(_Z^2+1)*_z^4+RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^3*_z^3-RootOf(_Z^2+1)*RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)^2*_z^2+3*_z^3*RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)-5*RootOf(_Z^2+1)*_z^2-RootOf(_Z^4*_z^4-_z^4+6*_z^2-1 index = 1)*_z+RootOf(_Z^2+1))/((_z+1)*(_z-1)*_z^2))

int/algrisch/int: computation of the transcendental part: end time 12.040

int/algrisch/int: exiting integrator for algebraic functions at time 12.041

S[1];

(1/2)*ln(-((x^4-6*x^2+1)^(3/4)*x+(x^4-6*x^2+1)^(1/2)*x^2+(x^4-6*x^2+1)^(1/4)*x^3+x^4-(x^4-6*x^2+1)^(1/2)-3*(x^4-6*x^2+1)^(1/4)*x-5*x^2)/((x+1)*(x-1)))+((1/2)*I)*ln((-(x^4-6*x^2+1)^(3/4)*x+(I*x^2-I)*(x^4-6*x^2+1)^(1/2)+(x^3-3*x)*(x^4-6*x^2+1)^(1/4)-I*x^2*(x^2-5))/((x+1)*(x-1)))

S[2];

(1/2)*ln(-((x^4-6*x^2+1)^(3/4)*x+(x^4-6*x^2+1)^(1/2)*x^2+(x^4-6*x^2+1)^(1/4)*x^3+x^4-(x^4-6*x^2+1)^(1/2)-3*(x^4-6*x^2+1)^(1/4)*x-5*x^2)/((x+1)*(x-1)))-((1/2)*I)*ln((-(x^4-6*x^2+1)^(3/4)*x+(-I*x^2+I)*(x^4-6*x^2+1)^(1/2)+(x^3-3*x)*(x^4-6*x^2+1)^(1/4)+I*x^2*(x^2-5))/((x+1)*(x-1)))

simplify( diff(S[1],x) - ig ), simplify( diff(S[2],x) - ig );

0, 0

 

Download int_pe.mw

Let E all triplets as X=(p,q,r) such as p^2+q^2=r^2. We define the application f of E dans C complex as X in E f(X)=(p+Iq)/r=Z. Calculate abs(Z). Show that in E the law noted * defined by
X1*X2=(p1*p2-q1*q2,p2*q1+p1*q2,r1*r2) is an internal law. Calculate f(X1*X2). Then if X0=(3,4,5), find
X0*X0, X0*(X0*X0).Thank you for the help.

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

First 9 10 11 12 13 14 15 Last Page 11 of 1678