Maple 2018 Questions and Posts

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

 We know the following facts: 

The SequenceGraph command returns a graph with the specified degree sequence given as input, if such a graph exists. It raises an exception otherwise. 
 But  If I  want to get more graphs  that satisfy this condition of degree sequence ? (If graphs are not many ,I want get all graphs better)
what should I do.?
For example: DrawGraph(SequenceGraph([3, 2, 2, 1, 1, 1]));  It returns the first graph below, but it is obvious that the second graph also fits the condition.

Hello Dear,

I have the following equation

 This equation is satisfied if the coefficients are zero.

So I need an order in Maple to write that



Good morning everyone, 

I have a problem, when I try to evaluate the definite integral below, Maple can not provide a result. What can I do so that the Maple can calculate this integral?

This is the Maple code with the result:







N := 1:

M := 2:


for i to N do rpv1 || i := 0; rpv2 || i := 0; rpv3 || i := 0; for j to M do rpv1 || i := VectorCalculus:-`+`(rpv1 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), Phi || i || j)); rpv2 || i := VectorCalculus:-`+`(rpv2 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), `ϕ` || i || j)); rpv3 || i := VectorCalculus:-`+`(rpv3 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), gamma || i || j)) end do; rp || i := Matrix([[rpv1 || i], [rpv2 || i], [rpv3 || i]]) end do:


for i to N do rppv1 || i := 0; rppv2 || i := 0; rppv3 || i := 0; for j to M do rppv1 || i := VectorCalculus:-`+`(rppv1 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), Phi || i || j)); rppv2 || i := VectorCalculus:-`+`(rppv2 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), `ϕ` || i || j)); rppv3 || i := VectorCalculus:-`+`(rppv3 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), gamma || i || j)) end do; rpp || i := Matrix([[rppv1 || i], [rppv2 || i], [rppv3 || i]]) end do:



for i to N do for j from 0 to 0 do U || i || j := 0 end do end do:

for i to N do for j from 0 to 0 do V || i || j := 0 end do end do:

for i to N do for j from 0 to 0 do W || i || j := 0 end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do U || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(U || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do V || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(V || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do W || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(W || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do f || i := VectorCalculus:-`+`(Typesetting:-delayDotProduct(VectorCalculus:-`*`(Typesetting:-delayDotProduct(E, A), 1/mu), VectorCalculus:-`+`(VectorCalculus:-`+`(rpp || i, VectorCalculus:-`-`(VectorCalculus:-`*`(rpp || i, 1/evalc(norm(Re(rp || i), 2))))), VectorCalculus:-`*`(Typesetting:-delayDotProduct(rp || i, Typesetting:-delayDotProduct(rp || i^%T, rpp || i)), 1/evalc(norm(Re(rp || i), 2))^3))), Typesetting:-delayDotProduct(g, e3)) end do:

for i to N do for j to VectorCalculus:-`+`(M, -1) do fun || i || j := int(VectorCalculus:-`*`(U || i || j, Row(f || i, 1)), s = xi || i .. L || i) end do end do;


(int((s-xi1)*(E*A*(2*Phi12/L1^2-2*Phi12/(sqrt((gamma11/L1+2*gamma12*s/L1^2-2*gamma12*xi1/L1^2)^2+(`ϕ11`/L1+2*`ϕ12`*s/L1^2-2*`ϕ12`*xi1/L1^2)^2+(Phi11/L1+2*Phi12*s/L1^2-2*Phi12*xi1/L1^2)^2)*L1^2)+(Phi11/L1+(2*(s-xi1))*Phi12/L1^2)*((2*(Phi11/L1+(2*(s-xi1))*Phi12/L1^2))*Phi12/L1^2+(2*(`ϕ11`/L1+(2*(s-xi1))*`ϕ12`/L1^2))*`ϕ12`/L1^2+(2*(gamma11/L1+(2*(s-xi1))*gamma12/L1^2))*gamma12/L1^2)/((gamma11/L1+2*gamma12*s/L1^2-2*gamma12*xi1/L1^2)^2+(`ϕ11`/L1+2*`ϕ12`*s/L1^2-2*`ϕ12`*xi1/L1^2)^2+(Phi11/L1+2*Phi12*s/L1^2-2*Phi12*xi1/L1^2)^2)^(3/2))/mu+g*e3)/L1, s = xi1 .. L1))*e[x]








Thank you !


What is the minimum period of the following equation.


d := evalf(expand((100+100*cos(6*t)+200*cos(12*sqrt(2)*t))^2))





Download period



  I want list all  diameter-2  Nonisomorphismgraphs  of order n . I use the following code, but its running speed  is slow with  order of graph gradually increasing . (for example,n=10)
 Are there other ways to Improve it? 
Graphs_data:=[NonIsomorphicGraphs(4,restrictto =[connected], output = graphs, outputform =graph)]:

  By the way,  Why doesn't size=[50,50] work ?


    As a first step to my question, let  G be  a graph and  I'd like to know  whether it contains a C4 (cycle of 4) as its subgraph.
     For example: .   it contains C4.  So  program may be return true.  
    I'm most concerned about the following thing ( it is important problem for me, since in graphtheory, we usually consider some class graphs contain no sepecific graph ) :
   1 Further , I want to  get all connected graphs of order less than 6  which  contains no C4 .
   2 More generally, I want  to konw  a graph  whether contains some graph as its subgraph.For example : does it contain K4CompleteGraph(4)K32  CompleteGraph(3, 2)  and so on ?
    I read the  function subgaph.  But  It didn't solve my problem. Many thanks for your help or advise.
   # I  just know there is a function  IsTriangleFree which test if graph is triangle-free ( graph comtains no C3 in Maple 2019. I think my question and how to program may be  meaningful.


Versions concerned:  [ Maple 2015 ... Maple 2018 ]

I use DocumentTools:-Tabulate to display a matrix of numbers while coloring them according to some condition.
(line DocumentTools:-Tabulate(M, color=((M,i,j)->`if`(M[i,j]>3,....) below ... please note the output is not loaded for some unknown reason).
The fact is that the matrix appears with black characters meaning 'color' doesn't work.

In a second attempt I convert matrix M into a matrix of strings and use now
DocumentTools:-Tabulate(S, color=((S,i,j)->`if`(parse(S[i,j])>3,...)
I get now the desired result with some blue and red numbers.

So converting to strings could be a workaround.
But think to matrices where elements would be algebraic expressions, for instance 
M := Matrix(2, 2, (i,j)->exp(x^i)+cos(x*j))
and that we use the coloring scheme is color=((M,i,j)->`if`(i+j>3, "Red", "Blue")
Converting M to a string matrix will display the element [2, 2] in red and the others in blue, but what you get then is a no longer a 2D pretty output but, literally, things like exp(x^2)+cos(x*2) 

The "convert to string" workaround is thus far from perfect.
Is the fact that 'color' only acts on strings a "normal and known" behaviour?
Is it possible to change the color of the font for non "string type matrices" ?


M :=Matrix(2, 2, (i,j)->i+j)

M := Matrix(2, 2, {(1, 1) = 2, (1, 2) = 3, (2, 1) = 3, (2, 2) = 4})


DocumentTools:-Tabulate(M, color=((M,i,j)->`if`(M[i,j]>3, "Red", "Blue")), width=30)

S :=convert~(M, string):
DocumentTools:-Tabulate(S, color=((S,i,j)->`if`(parse(S[i,j])>3, "Red", "Blue")), width=30)




Dear friends~

Recently I wanted to create some funny gif with Maple based on other interesting pictures but I met some problems:(1)I read many commands in ImageTools but few can aid me.(2)If I use “plot(,background=file_address)”,then the whole background will be filled with pictures but I just want it to be a part of my gif.I finally noticed that “plot3d(,image=file_address)”can realize my idea to some extents if I adjust orientation’s value  suitably.

However,I still think my operations can be improved(for example,my code consumes a fair amount of  memory) and there maybe one better approach to be good too. Hence I upload my code and sincerely look forward your suggestions and help~

#Janesefor do it in 2019/4/15 13:20 with Maple2018~
# smile.jpg's address

display(seq(display(textplot3d([0,1,4.5,cat(str[1..ha])],align='right'),textplot3d([0,3.5,-4.5,"By Janesefor ~"],align='right'),plot3d([0,s,t],subs(y=ha-1,[s=y-dy..y+dy,t=location_func-dz..location_func+dz])[],image=cat(image_file,"smile.jpg"),axes=none,scaling=constrained,orientation=[180,90,-180],view=[default,0..10,-5..5],glossiness=0,lightmodel=light4)),ha=[`$`(1..nops([str]))]),insequence=true);

Dear Support

I am attempting to model quantum dynamics, and have defined a coupled set of nonlinear PDEs I would like to solve for coupled solutions u(x,y,t) and v(x,y,t) using MAPLE 18.

I attach an image of part of the worksheet the pair of PDEs...The initial conditions u(x,y,0), v(x,y,0) are a pair of respectively positive and negative 2D gaussians on the x,y, domain.

Before I go any further, please would you check that MAPLE 18 is in principle capable of finding solutions u(x,y,t), v(x,y,t) solutions, and let me know whether it is worth pursuing the solution?  I have had a look at the MAPLE documentation, but am not sure whether MAPLE can solve this system.

As a warm-up, I successfully solved a 1-D system u(x,t), v(x,t) using pdsolve[numeric], but I am not clear whether MAPLE 18 can solve for u(x,y,t), v(x,y,t) either numerically or analytically on the [x,y,t] domain.

I hope you can provide help/guidance. An image the equations in MAPLE is displayed here...

Melvin Brown


I can  this equation.

restart; c__v := 1.2; `τ__q` := 8.5*10^(-12); `τ__T` := 90.0*10^(-12); rho := 1000; k := 10







k*(diff(T(x, t), x, x))+k*`τ__T`*(diff(T(x, t), t, x, x)) = rho*c__v*(diff(T(x, t), t))+(diff(T(x, t), t, t))*c__v*rho*`τ__q`+(1/2)*c__v*rho*`τ__q`^2*(diff(T(x, t), t, t, t))

10*(diff(diff(T(x, t), x), x))+0.9000000000e-9*(diff(diff(diff(T(x, t), t), x), x)) = 1200.0*(diff(T(x, t), t))+0.1020000000e-7*(diff(diff(T(x, t), t), t))+0.4335000000e-19*(diff(diff(diff(T(x, t), t), t), t))


Boundary condition:

T(0, t) = 300; T(10, t) = 300




T(x, 0) = 300; (D[1](T))(x, 0) = 0, (D[2](T))(x, 0) = 0

(D[1](T))(x, 0) = 0, (D[2](T))(x, 0) = 0








The help page TimeSeriesAnalysis, ExponentialSmoothingModel contains an error.
The command that generates the output (7) should be
esm2 := ExponentialSmoothingModel(seasonal={"A","M"},constraints=admissible)
instead of
esm2 := ExponentialSmoothingModel(seasonal={A,M},constraints=admissible)

PS : there is no tag relative to TimeSeriesAnalysys

  As we  known, in Graphtheory , a loop is an edge that joins a vertex to itself (for example  fig1 vertex1) and multiple edges (for example Fig2)are two or more edges that join the same two vertices.  But in Maple,  G := Graph({{a, b}, {a, c}, {b, c}}). The Edges(G) function returns a set  (not list )of the edges of G.  So, for example I can't create loop{1,1} by G:=Graph({{1,1},{1,2},{1,5},{2,5},{2,3},{5,4},{3,4},{4,6}})   . But in my research, I consider a graph which exist loops or multiple edges. I want to create  it  .How should I do?  Thanks in advance.

my code like this



How I can get integral by part.

I want to calculate these integral.

Thank you



How I can take Laplace Transform from equation.



Right now I am going through Bishop's ML book and as a part of the first exercise I need to define a polynomial that goes like this.

y(x,w) = w_0 + w_1 * x + w_2 * x^2 ... + w_m * x^m = sum (k=0 to m) w_k * x^k

Here is how I've written it out in Maple.

f := proc (x, w) options operator, arrow; sum(w[k]*x^k, k = 0 .. nops(w)) end proc

Sorry for the raw code, Maple Math won't accept the code I've written as a valid Maple expression for some reason. When I try to use this I get an error that says too many levels of recursion.

f(2, [a, b, c]);
Error, (in limit/mrv/limsimpl) too many levels of recursion

Where am I going wrong here?

1 2 3 4 5 6 7 Last Page 2 of 34