Maple 18 Questions and Posts

These are Posts and Questions associated with the product, Maple 18

Hi all.  I have researched into this problem.  But I could not find a solution to this.

Here is an example.

I have a set of independent variables, say there are 5 of them.  They are 1. Gender 2. Age group 3. Full or part time 4. First language.

I have a set of dependent variables.  Let us consider for an example 6 of them.  They are (i) Develops breast cancer (ii) Develops skin cancer (iii) Develops lung cancer (iv) develops prostate cancer (v) Lives till 50 (vi) Lives till 60 ...

How do I perform the following prediction:

(A) If a person is male and above 50, what are the chances that he is likely to develop prostate cancer?

(B) If a person is female and works part time, what are the chances that she is likely to develop breast cancer and lives till 60?

I need to develop a code and formula to do this?  Can someone please advise?

Many thanks.

Kind regards,


If I type in a function in 2D Math, the text disappears. for example, if I type fsolve(), until fsolve, the text appears, but after i type (, the whole text disappears. How should I solve this? Thanks.


How can I pde with maple?please explain completely,and other question :How can I solve pde with plot in maple because some questions dont have exact answer?

Hi everyone

Right now I am working on a command that calculates the molar mass of molecules. Mostly it is working like a charm but in some cases the interpretation of the input goes wrong.
The command converts the input to a string, e.g.:

f:=convert(Ca3(PO4)2, string) = "Ca[3](PO[4])[2]"

f := StringTools:-Remove("[]_*^+-", f) = "Ca3(PO4)2"


However, sometimes information such as parentheses is lost (which is understandable considering the fact that maple does not know chemical syntax):

f := convert(NH[3][3]*PO[4], string) = "NH[3][3]*PO[4]"

f := StringTools:-Remove("[]_*^+-", f) = "NH33PO4"


In special cases it goes completely nuts (I am aware this is not a real molecule):

f := convert(Al(OH)2(NH3)2, string) = "Al(`#msub(mfenced(mi("OH")),mn("2"))`)(NH[3])[2]"


The problem could of course simply be solved by typing the input as a string with no subscripts but is looks much nicer with the correct chemical syntax as input.

Do any of you know a way to translate the input charactor by charactor into a (understandable) string?


Thanks in anvance,


I have an indexed equation that contains serval definite integrals in it. I want maple to evaluate the equation for different indices. But when I set the parameter "N=100" in the code, it takes maple lots of time for the evaluation. I am looking for some tricks to make the code numerically more efficient. I will be so thankful for any opinion and help.
you can find my code below. The code is so simple and just contains few lines. I will appreciate any help.

Thanks in advance.

Phil Yasskin (Texas A&M) has prepared a maplet for the Maplets for Calculus proiect. While this maplet works, in Malmem 18 it sometimes does NOT display the plot. We don't see this behavior in Maple 17, The maplet is attached for your convenience, if you are interested in seeing if it works for you.

The problem is difficult to describe. Basically, at the end of the problem, users can elect to see a plot of the function with(some) asymptotes. The code creates the plot when the problem is created, and displays this plot in the worksheet. But, when the plot is requested within the mapmlet, it sometimes does not show in the empty plot window.

Any explanations (or followup quesitons) will be greatly appreciated.


Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail:
Phone:  (803) 777-6183         URL:


I would like to start with the following set of 9 elements,
A = { E11, E12, E21, E22, E11+E12, E11+E21, E12+E22, E21+E22, E11+E12+E21+E22 }.

I need a procedure that takes each of those elements and creates 3 new ones in the following way: Eij becomes Eij1, Eij2, Eij1+Eij2. So for example, E11 will become: E111, E112, and E111+E112. And for example the fifth element in A (i.e. E11+E12) will become the 3 new elements: E111+E121, E112+E122, and E111+E121 + E112+E122.

Since each of the 9 elements gets triplicated, there will be a new set, call it B, with 27 elements.

B = {E111, E112, E111+E112, E121, E122, E121+E122, ... }

Now I want to repeat this process of triplicating again so that, for example, E111 becomes: E1111, E1112, and E1111+E1112. And so on. This new set C will have 81 elements. Now I want to repeat this one last time. The final set, D, will have 243 (3^5) elements. 

Step 2: 

For every pair of elements x and y in D, I want to compute z:=(x+y)mod2. If z already belongs to D, discard it, otherwise, place z in the set D2. Do this until there are no more elements to add together (note that if x+y is computed then I don't want y+x to be computed also--that's inefficient). Maybe the most efficient way is to perform all possibly combinations of x+y mod 2 to create the set D2 and then just go: D2 setminus D.

Step 3: For x in D and y in D2 perform all possible combinations of z:=(x+y)mod2 and place these in D3 then perform set subtraction again: D3 minus D2 minus D.

Repeat this process again: x in D and y in D3 to create new elements in D4. Repeat again until Dm is empty (that is, D(m-1) will be the last set that contains new elements). I'm expecting around 12 sets... 

The issue with this whole algorithm is that I often run out of memory so I need a clever way to do this, since this algorithm is essentially classifying 2^32 elements into disjoint sets. Thank you! 

When the loop variable can be written as a unit step sequence, I never really distinguish between using

seq( f(i), i=m..n ), and

f(i) $ i=m..n

However I recent came across a case where the 'seq' construct ran about 2.5x faster. Is using 'seq' always faster? Does it depend on the function being evaluated? Why is there such a large difference in execution time

The original example which exhibited the problem is shown below, although after some experimentation, I have found other cases where 'seq' is faster (and plenty where it doesn't seem to make any difference!)

Example code for implementation using '$' is

ans:= max
          ( { iquo(3*d, 7)/d $ d = 1..ulim }
t2:= time()-t1;

Example code for for implementation using 'seq' is

t1:= time():
ans:= max
        ( { seq
            ( iquo(3*d, 7)/d, d=1..ulim )
t2:= time()-t1;

On my machine, the version using the 'seq' construct runs 2.5x faster


Here is my code & the error mesage.  What's wrong?


X := Vector*([0, 5, 10, 15, 20, 25, 30], datatype = float);
Y := Vector*([38.8, 53.8, 82.4, 107.6, 130.7, 152.4, 173.2], datatype = float);
NonlinearFit(av^2+bv+c, X, Y, v);
Error, (in Statistics:-NonlinearFit) invalid input: PostProcessData expects its 1st argument, x, to be of type {array, list, rtable}, but received w


It seems that the command vrml is long gone (I have a lot of worksheets using this "command") and

has been replaced by saving  a graphic in x3d format.

That's ok I have a x3d renderer but the quality of Maple for the x3d format in not very good (for the moment).

Please reintroduce vrml :-)


Jean-Michel Collard


How to make Decimal number in maple by default? 

How to make radian to degrees? Think It is like this "degcos" but I cant see the correct result, because it is not showed in decimals

Why do I have to active all my varibles when I open the document after I have saved it?






  I have a loop code, such as




for i from 1 to i_max do
  blah blah blah

end do;



  I would like to clean memory, something like restart suppose to do, after each cycle. Restart could only work at top level. How should I do to clean memory after each cycle?


Hi everyone,

I'm running Maple 18 and MapleSim 6.4 on my macbook pro 13 " with retina display and the GUI is blurred like there is no smoothing or the antialiasing is not working properly. I tried to find something helpfull in the setting but with no luck.

Is there something I can do to fix this?




DirectSearch answer has confused me. How to reduce the residual.
See the

how i can trust in DirectSearch solution there any creteria?

my variable is intensity.

this is my code:

ep0 := 1/(4*3.14); el := 8.54*10^(-2); hbar := 1; vf := 1/300; kb := 1; tem := 2.586*10^(-2); ci := 1; p := 1.458*10^16; beta := 2; ai := 7.1*10^(-4); bi := ai/sqrt(3); enph := .196; d := enph/(kb*tem); n0 := 1/(exp(enph/(kb*tem))-1); gama := hbar*vf; intensity := 10000001; w := 1.55; impurity := 7.2*10^3;

g := hbar*beta/(bi^2*sqrt(2*p*enph)); aa := g^2*(n0+1)/(2*Pi*hbar*gama^2); bb := g^2*n0/(2*Pi*hbar*gama^2); cc := 2/(Pi*gama^2); l := (1*hbar)*w/(2*kb*tem);u := el^2*intensity/(32*w*hbar^2);


DirectSearch:-SolveEquations([op([((enph*ln(1+exp(c+enph/(kb*tem)))/(kb*tem)-polylog(2, -exp(c))+polylog(2, -exp(c+enph/(kb*tem))))*enph*(kb*tem)^2-(enph^2*ln(1+exp(c+enph/(kb*tem)))/(kb^2*tem^2)+2*enph*polylog(2, -exp(c+enph/(kb*tem)))/(kb*tem)+2*polylog(3, -exp(c))-2*polylog(3, -exp(c+enph/(kb*tem))))*(kb*tem)^3+(-exp(b)*enph*ln(1+exp(c+enph/(kb*tem)))+exp(c+d)*enph*ln(1+exp(b-d+enph/(kb*tem)))+exp(b)*kb*tem*polylog(2, -exp(c))-exp(c+d)*kb*tem*polylog(2, -exp(b-d))-exp(b)*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))+exp(c+d)*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem))))*enph*(kb*tem)^2/((exp(b)-exp(c+d))*kb*tem)+(exp(b)*enph^2*ln(1+exp(c+enph/(kb*tem)))-exp(c+d)*enph^2*ln(1+exp(b-d+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))-2*exp(c+d)*enph*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(3, -exp(c))-2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d))-2*exp(b)*kb^2*tem^2*polylog(3, -exp(c+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d+enph/(kb*tem))))*(kb*tem)^3/((exp(b)-exp(c+d))*kb^2*tem^2))*bb+u*(1/(1+exp(-l-c))-1/((1+exp(-l-c))*(1+exp(l-b))))-(((1*enph)*(enph-2*kb*tem*ln(1+exp(-b+enph/(kb*tem))))/(2*kb^2*tem^2)+2*kb^2*tem^2*(-polylog(2, -exp(-b+enph/(kb*tem)))+polylog(2, -cosh(b)+sinh(b))))*enph*(kb*tem)^2-(enph^2*(enph-3*kb*tem*ln(1+exp(-b+enph/(kb*tem))))-6*kb^2*tem^2*(enph*polylog(2, -exp(-b+enph/(kb*tem)))+kb*tem*(-polylog(3, -exp(-b+enph/(kb*tem)))+polylog(3, -cosh(b)+sinh(b)))))*(kb*tem)^3/(3*kb^3*tem^3)-(-exp(b)*enph^2+exp(c+d)*enph^2-2*exp(c+d)*enph*kb*tem*ln(1+exp(-b+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b))-2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d))-2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem))))*enph*(kb*tem)^2/((2*(-exp(b)+exp(c+d)))*kb^2*tem^2)-(exp(b)*enph^3-exp(c+d)*enph^3+3*exp(c+d)*enph^2*kb*tem*ln(1+exp(-b+enph/(kb*tem)))-3*exp(b)*enph^2*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*enph*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))-6*exp(b)*enph*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b))-6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d))-6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b+enph/(kb*tem)))+6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d+enph/(kb*tem))))*(kb*tem)^3/((3*(-exp(b)+exp(c+d)))*kb^3*tem^3))*aa-u*(1/(1+exp(l-b))-1/((1+exp(-l-c))*(1+exp(l-b)))) = 0, -cc*polylog(2, -exp(b))+cc*polylog(2, -exp(-c))-impurity = 0])], tolerances = 10^(-8), evaluationlimit = 20000)


First 12 13 14 15 16 17 18 Last Page 14 of 80