Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

How do i pipe maple output to the clipboard and vice versa (assigning clipboard content to a variable declared in a maple worksheet)?


With the Curvefitting[Spline] command I calculate a piecewise function from discrete points. I perform this action 250 times and save the piecewise functions into a matrix. The process takes quite a while. Is it possible to save said matrix to a file such that I may call it from other maple worksheets, instead of re-calculating the matrix every time I want to use it?


I have a simple proc that generates some arrays based in some input values.

I have a function that uses the proc to do math on the array. I have anoother function that uses that function to do more things. The last function does not evaluate because it says that it is unable to evaluate the sequence in the proc.


It seems that because I am summing over the first function and the sum variable is "unknown" the proc cannot create the arrays. Maple is trying to "simply" bottom up rather than top down and craps out.


It really has nothing to do with the sequence though but that the input that ultimately gets to the proc involves a negative index. Even though I've attempted to prevent that every possible way such as max(0,j)... even though j is negative higher up in the evaluation maple insists in not clamping it first.



f cannot deal with negative indicides(even though I also have an if j < 0 then return 0; fi; in the proc)


Maple is trying to do some magic annd failing. I've ran in to this problem before and I solved it, I thought, bu using ` ` around the function name... it does not work here.


It seems that maple tries to evaluate everything in the proc regardless of the actual inputs used or the if statements before the evaluation(unlike traditional programming which can be sequentially reasoned).

How to stop it from doing this nonsense and just give me what I want?

Error, (in f) out of bound assignment to a list


f := proc(i) local A; A := [3,4,5]; if i < 0 then return 0; fi; return A[i]; end;


f(-1) works


but when used in other things with a variable it fails.




Hi. I'm using the interactive plot builder. I click in add button in the expression section and then enter:


and click the accept button and I get an error message saying "Please enter a valid Maple expression". How am I supposed to enter the equation of the plane?

Thanks in advance!

PDE :=  diff(y(x,t), t)-diff(y(x,t), x,x,t)-diff(y(x,t), x$2)+ diff(y(x,t), x)+y(x,t)*diff(y(x,t),x)=exp(-t)*(cos(x)-sin(x)+1/2*exp(-t)*sin(2*x));

# Initial/boundary conditions 
  BCs:=y(0,t) = 0, y(Pi,t)=0;
  ICs:=y(x,0) =sin(x) ;

pdsolve(PDE, {BCs,ICs});
Test1:=pdetest(exact_solution,[PDE, BCs,ICs]); 

The solution of the PDE is exp(-t)*sin(x).

I want to check whether it is right or not by Maple. 

I wrote the code. You can download the  

But, the code doesn' t work. What is the problem?



  1. The member() function doesn't find the value in a table if that value is associated with the key (aka index)  '0'
  2. Doesn't seem to matter if the table is created explicitly (ie by calling table()) or implicitly (ie by simple indexed assignment)
  3. member() doesn't seem to have the same issue with a zero-based Array()
  4. I'm pretty sure that this is a bug, but I'd like some opinions before I report it
  5. This behaviour has been around for a while: same thing happens all the way back to Maple 18. (I can't check anything earlier)

Check the ouput of member(10,t1) in the attached



`Standard Worksheet Interface, Maple 2019.1, Windows 7, May 21 2019 Build ID 1399874`


# Explicit table creation: same thing
# happens if table is created "implicitly"
  t1:=table([0=10, 1=12]);

table( [( 0 ) = 10, ( 1 ) = 12 ] )






# Zero-based Array
  A:=Array(0..1, [10, 12]);

Array(%id = 18446744074528920750)








This is a solution to a PDE. I solved this by hand and got a much simpler solution. Maple solution is also correct but very complicated. They are both the same, as when I plot them  for different t values, they match. I am sure they are the same. 

How would one simplify Maple solution to the simpler one? Tried number of options to simplify, but can't get Maple to simplify it to the hand solution. Also tried different assumptions on t and x (real, positive etc..) nothing helps.

Maple 2019.1 on windows 10. Physics 436

pde := diff(u(x,t), t) +1/(x^2+4)*diff(u(x,t),x) =0:


hand_sol:=exp(x^3 - 3*t + 12*x); #this is much simpler









Recently I discovered you can get the wolfram language and Mathematica for free if you buy a Raspberry Pi. 

Will there be something similar with Maple?

I'm guessing since Mathematica has secured a contract with Raspberry Pi, that would exclude competitors, ie Maple

Dear experts,

I am sorry to bother you again with different questions. I am attempting to get a solution with various methods so that I can grasp my problem as clear as possible. 

I am attempting maximizing this problem, so I am looking for functional solution of c(t). However, as you can see, in the optimization problem there is one bothering expression, which is a integral of c(h) from 0 to t. 

I looved optimal control theory book, but still I could not find a protocol example. 


int([int(e^(-rh)*[log(c(h)) + w - p*c(h)], h = 0 .. t)]*b*[int(c(h), h = 0 .. t)]*e^(-b*int(c(h), h = 0 .. t)), t = 0 .. infinity) 


How shall I approach this problem with Euler Lagrange in Maple? Thank you



I am new to parallel computing, but as my current desktop is struggling with caclulating Groebner bases (i've been locked out for most of a week), I've contacted my universities center for scientific computing in the hope that they could do the caclulations.

However, I've been told that maple doesn't run in a distributed-memory parallel sense; as parallelisation in maple is very new - and i couldn't find discussion of this in the documentation - I thought it would be best to ask here if it does.

Secondarily can commands from the GB package be implemented in a way that would benefit?
if not can other similar commands like solve or eliminate?

I have a condition delta(k-r-1);k and  r are integers;

if k-r-1=0,then delta(k-r-1)=1;

if k-r-1 not equal to 0,then delta(k-r-1)=0;

How to write this in if statement?

I want to solve the following partial differential equation set with boundary condition.So,what is the code for solving the equation set?The equation set is in the photo.I am grateful for your help.

I'm struggling to get a simple answer out of pdsolve solving this PDE:  

eqn := Mu*diff(`&xi;r`(r, t), t, t) = kappa*diff(`&xi;r`(r, t), r, r);
ic := `&xi;r`(r, 0) = sin(Pi/(2*r)), D[2](`&xi;r`)(r, 0) = 0;
bc := `&xi;r`(0, t) = 0, D[1](`&xi;r`)(1, t) = 0;
sol := (pdsolve([eqn, ic, bc], Zeta(r, t)) assuming (0 < kappa, 0 < Mu));

The outcome pdsolve comes up with is rather complex, with summation and integral. To my best knowledge, the simple solution of this PDE is:


How can I get this simple solution out of pdsolve? 

Any suggestion is welcome.


The worksheet below animates a hamster running back and forth on a linear floor within a wheel. Its motion is such that the wheel remains stationary.

What math would describe the hamster running back and forth such that the wheel oscillates with a constant frequency and the floor's vertical angle oscillates between plus and minus an angle greater than zero and less than 2 Pi?

How is it possible in Maple to keep hold of pre determined results for comparison with subsequent results so that a recursive decision can be made to either modify the list of “kept” data or to continue to the next calculation, etc... ?

Example: a simple “subtract or double” sequence. If subtracting (say 1) from the current number would result in a term we already have,  then double it instead, and start over again with subtraction.

Formally: a(0)=0, a(1)=1, and for n>=1,

a(n+1) = a(n)-1 if that number has not been found already, else a(n+1)=2*a(n).


The arithmetic operations are facile but how to organise the keeping and comparison process??



2 3 4 5 6 7 8 Last Page 4 of 1594