MaplePrimes Questions

A minor question .... 

Does anybody know how to format a matrix so all elements are presented in whole numbers? 

It's more a niggle than anything .. I want to retain decimals in my worksheet but wish only to have the matrix display integer values.

Thank you!

 May I know which commands able to generate large prime up to 2000 bits in maple? 

I believe this is a bug:

subsindets(%, anything^rational, proc(x) if type(x, specfunc(anything, Q)^rational) then 'Q(x)' else 'x' fi end)<>
subsindets(%, specfunc(anything, Q)^rational, Q);

Suppose we have a number of points, n, in the x-y plane and the location of each point is known.

I wish to evaluate the straight-line distance from point to point and tabulate these values (i.e. A to B, A to C, A to D, B to C, B to D, etc) and then plot the points in question.

In this attached worksheet, I have given an example of 4 points and I would welcome all suggestions on how to do this. 

Thanks for reading.


I'm new to Maple.

My problem is that if I input the command sqrt(3.0), for example, I get this strange result:

1.81847767202745*10^(-58) + (7.53238114626421*10^(-59))*I

The results is the same, no matter the argument of sqrt.

Also, when using ln, I get this:

-265.745524189222 + 0.785398163397448*I

Again, no matter the argument of ln, the result is the same.

What is happening?

Dear maple user  any one suggest me how to solve  second order coupled differential equation using galerkin finite element method for 8 elements and 10 elements using maple codes


I thought I remembed how to do this once in Maple, or asking something like this here, but may be it was something similar. But I am not able to figure it now or remember.

Given an expression, I want to find all occuranes of a pattern in it.  Not just one.  So this is like using patmatch but over and over again untill all patterns found. I'll give an example to make it easy to explain.


expr := y^2*sin(1/y) + y^(3/2) + y + x*y^7;

I want to find all patterns of form y^n  so the result should be 

{y^(3/2), y^7, y^2, 1/y, y}

This below is how it is done in Mathematica, but having hard time translating this code to Maple.

The last line below does the actual repeated pattern matching. That line was not written by me. It is something from Mathematica forum at stackexchange and I use it all the time and it works well.

expr = y^2*Sin[1/y] + y^(3/2) + y + x*y^7;
pat = y^n_.;
Last@Reap[expr /. a : pat :> Sow[a], _, Sequence @@ #2 &]

I looked at hastype also. But hastype will only tell me if the pattern is there or not. May be I did not use it right.


Gives true

I tried patmatch, but again, it only find one:

if patmatch(expr,a::anything+y^(n::anything)+b::anything,'la') then

And the above is not even robust for finding one. Since I have to change the pattern again to account for multiplication/addition cases between terms. 

Is it possible to do in Maple the same thing I show in Mathematica? I am sure it is possible, but can't now find the right function in Maple.

Maple 2019.1

Should I adjust numcpus while running thread command

I want to extract lists that are term by term smaller than a fix one.

To be clearer, I want to create something like

if a[i] <= b[i] for all i=1..min(nops(a),nops(b)) then ...

I tried with the forall call, but it doesn't work:

if forall( i=1..min(nops(a),nops(b)),a[i] <= b[i]) then ...

I also tried the assuming call with the is call. It works, but doesnt't give me the result I want:


if is(a[i] <= b[i]) assuming(1 <= i, i <= min(nops(a),nops(b))) then...

Is there a way to have a chain of conditions in a if statement like I am trying to do?



How to show the y-axis numbers in the second plot ?   y is in [0,3]. 

I try the following but it shows a negative axis. 

display(P, L, axis = [tickmarks = [5, subticks = 3], thickness = 2]);  this is not correct

The file is attached.





I do not understand why the following is not working. I have a package which has a module inside it. The module is exported by the package.

Inside that module, there is a proc, which is also exported by the module.

So why can't one call the proc from outside the package? What Am I doing wrong? and how to correct it? I'd like to be able to call the proc directly. 

  option package;
  export B;
  B := module()
      export foo;

           print("in foo");
      end proc;

  end module;
end module;   

Now when typing (A::B):-foo() Maple is not happy and says Error, module does not export `foo`

I tried different syntax from the above, but can't get it to work. For example A::B:-foo() gives Error, `B` does not evaluate to a module


Maple 2019.1

P; Q; lma; [3 -42] [-, ---] [2 25 ] [22649 -2304] [-----, -----] [5523 1841 ] 1.627112258 with(geometry); point(Pp, P[1], P[2]); point(Qp, Q[1], Q[2]); ellipse(p, ['foci' = [Pp, Qp], 'MajorAxis' = lma]); Error, (in geometry:-ellipse) the given polynomial/equation is not an algebraic representation of a ellipse; I can't understand this error

Hi I’m a student, running Maple on a student license, and I have an issue with the way the Maple 2019 setup is.

I'm sorry if my answer is a bit hard to understand, I don't really know how to explain it.

My Maple 2018 expired and I was forced to upgrade to Maple 2019, however for me there is a huge difference in how the setup is in therms of “math” and “text” mode. 


Before, I was able to easily switch between “text” and “math” mode in a paragraph (the red “>”) in my worksheet, by using “cmd+R” and “cmd+T”. So I would have paragraphs for text, where i could switch between “math” and “text” for writing, and then I would have paragraphs only for math for when I would calculate things. (I’ve tried to screenshot how it would typically look)


Mt problem with Maple 2019, is that when I switch a paragraph into text and start writing and want to switch to “math” by using “cmd+R”, Maple executes the formula whenever I press “enter”, and give me an output I don’t want.


How do I change the settings to get back to the way they were on Maple 2018 and the years before this?

Thanks in advance.

(I know I can put a ":" after the "math" part in my text, but i don't wan't to do it every time)




When making a proc that accepts positional and keyword based arguments, Maple allows the caller to put the keyword arguments before or after the positional arguments, or in between.

Is there a way to force the keyword arguments (if they are used) to only be placed after the (required) positional arguments during the call? 

An example will make it more clear. Given this proc

foo := proc(a::integer, b::integer, {c::integer:= 1, d::integer:= 1},$)
    print("a=",a," b=",b," c=",c," d=",d);
end proc:

It can be called as any one of these cases

foo(1,2);                                #case 1                                             
foo(1, 2,'c' = 1, 'd' = 2);              #case 2
foo('c' = 1, 1, 'd' = 2, 2);             #case 3
foo('c' = 1, 1, 2);                      #case 4
foo(1, 'c'=1, 2);                        #case 5
#more combinations possible

Is it possible to change how proc is defined, so that Maple will accept case1, and case 2 only in the above when the call is made and give an error otherwise?

i.e. only allow keyword arguments after all positional arguments.  I read  and it says

After all arguments matching keyword parameters have been processed, matching of required positional and optional or expected ordered parameters is carried out

So from above, it looks like what I am asking for is not really possible. But I thought to ask, in case there is some way.

I find ability to put keyword arguments in the call anywhere and in-between required positional arguments confusing that is all.

Maple 2019.1

Can anybody tell me any lecture series on parallel processing in maple

5 6 7 8 9 10 11 Last Page 7 of 1777