Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello there, 

When I tried to write an expression with the '1d' subscript, I found that it was automatically translated as '1.'. The following worksheet shows an example. Is there any chance to preserve the expression as I intended to see?



eq3_130:= Psi[fd] = L[ffd]*i[fd]+L[f1d]*i[1d]-L[ad]*i[d];

Psi[fd] = -L[ad]*i[d]+L[f1d]*i[1.]+L[ffd]*i[fd]





Our user wondered about using PolynomialIdeals:

1.  If we have n+1 polynomials,  f, g1,...,gn,  how to determine if  f  is in the ideal generated by  g1,...,gn?

2.  If so, how to write  f  as a polynomial combination of   g1,...,gn? 

We suggested that;

The nicest interface to answer the first question is given by the ?PolynomialIdeals,Operators page: you can write

J := <g1, g2, ..., gn>;
f in J; # true or false

To answer the second question, you need to use the lower level  package (which underlies the  package). This will also answer the first question for you. In particular the  command. You can write:

G := [g1, g2, ..., gn];
ord := tdeg(x,y,z); # replace x, y, z with the appropriate variables; you can also use other variable orders -- see ?Groebner,MonomialOrders

b := Basis(G, ord);
n := NormalForm(f, b, ord, 'Q');
# if n = 0 then f is in the ideal; Q is the list of coefficients:
f - add(Q[i] * G[i], i = 1 .. numelems(b)); # this will be equal to n.

Really , the complex plotting possibilities in Maple are difficult to decipher. 

I tried something, but  in general the visualizing for me is not that easy

Now i must look at the complexplot where i got a circle for  the complexplot(sin(x + I), x = -Pi .. Pi) example ?


     Can you enter debug in a worksheet vs a proc?   

    I have a for loop that is crashing in the middle with a bad calculated number to provide to a thermoprops function.   Is there a way to single step through a for loop (1500 iterations) to see which line is getting tripped up?  I can not post the worksheet as it's private development.   The question is generic to any "for loop".

   I have also tried "porting" into a code edit region, but still can not enter the debugger mode.   Is proper debugger only available if I turn the "for loop" into a proc?   If yes, what is the availability of packages called right after restart for the worksheet for a proc, or do all the pre-calcs developed in the worksheet and the packages to be variables fed into the proc or packages re-declared insde a new proc ???

  Sorry if this is a trival question.

Thanks in advance,

I solve numerically a DAE system whose independent variable is named t and the dependent variables are d[1](t), ..., d[n](t).
I would like to to 2D or 3D plots of the solutions and color the resulting curve using a function f(...) of the remaining dependent variables.

Here is a simple example.





sys := {
   diff(x(t), t) = v(t)
  ,diff(v(t), t) = cos(t)
  ,x(0) = -1
  ,v(0) = 0

  ,px(t) = piecewise(x(t) >=0, 1, -1)
  ,pv(t) = piecewise(v(t) >=0, 1, -1)

sol := dsolve(sys, numeric):


odeplot(sol, [t, x(t), v(t)], t=0..4*Pi)


# I would like to color this space curve depending on the signs of x(t) and y(t)
# for instance, f being a "color function"
f := proc(s)
  local a, b:
  if s::numeric then
    a := round(eval(px(t), sol(s))):
    b := round(eval(pv(t), sol(s))):
    return piecewise(a+b = 2, "Green", a = 1, "Red", b = 1, "Blue", "Gold")
  end if:
end proc:

SOL := proc(s)
  if s::numeric then
    eval([t, x(t), v(t)], sol(s))
  end if:
end proc:

# I would like to make something like this to work

plot3d(SOL(s), s=0..4*Pi, colorfunc=f(s)):  #... which generates a void plot


# In some sense a continuous version of this

opts := symbol=solidbox, symbolsize=20:
display( seq(pointplot3d({SOL(s)}, opts, color=f(s)), s in [seq](0..6, 0.1)) );




How can I fix (if possible) the syntax in the command 

plot3d(SOL(s), s=0..4*Pi, colorfunc=f(s)):


Thanks in advance

Has someone tried to connect Grasshopper with Maple yet?

Grasshopper is a visual programming environment on Rhino.


I am facing "Error, too many levels of recursion" in loops. kindly guide me. Thanks


restart; printlevel := 3

restart; with(LinearAlgebra); with(linalg); with(CodeGeneration); with(plots); Digits := 30; `&epsilon;` := 0.1e-1; k := .5; m := 1; c := 1; q := 1

L[time] := 1:








ICff := 1.0*exp(-p^2/(2.0))*(1.0+epsilon*cos(1.0*k*x))/sqrt(2.0*Pi):

for i from 0 while i <= N[x] do for j from 0 while j <= N[p] do f[0, i, j] := eval(ICff, [x = i*`&Delta;x`, p = j*`&Delta;p`]) end do end do:

for n from 0 while n <= T do for j from 0 while j <= N[p] do f[n, 0, j] := 0; f[n, N[x], j] := 0 end do end do:

for n from 0 while n <= T do for i from 0 while i <= N[x] do f[n, i, 0] := 0; f[n, i, N[p]] := 0 end do end do:


for n1 from 0 while n1 <= T-1 do for i1 while i1 <= N[x] do for j1 while j1 <= N[p] do f[n1+1, i1, j1] := f[n1, i1, j1]-`&Delta;t`*j1*`&Delta;p`*(f[n1+1, i1+1, j1]-f[n1+1, i1-1, j1]+f[n1, i1+1, j1]-f[n1, i1-1, j1])/((4*`&Delta;x`)*(1.0)) end do end do end do

Error, too many levels of recursion




I am facing error in code. Kindly guide me. Thanks in advance.

Dear esteem Colleagues,

Please how do I modify the following two files (though similar) to get consistent errors? I am not sure where I made the mistake.

Any modifications would be appreciated.

Thank you all for your time and mentorship. Best regard

I would like to emphasize a particular region of my plot by shading the whole strip between x=0 and x=1. I learned of the command shadebetween, but the functions it takes as arguments for the boundaries of the region to shade must be functions of x.

Does someone know how to shade between two vertical lines?

I am a new user to Maple, but have used PTC's Mathcad and Prime.

I have several matrices that I need to combine both vertically and horizontally.  The command augment will combine the matrices horizontally.  I was unable to find a command to combine the matrices vertically.  I tried the stack command (Prime command).  The Maple stack command appears to have a different functionality.  Could you suggest which command would do the job?  The matrices are large and I would like to limit the number of rows and columns shown in the document.

The next step will be sorting the data. I am researching this at this time.

Thank you for the support,

David Tietje

Alternating serie


sum((-1)^(n+1)/(2*n-1), n = 1 .. infinity)




sum((-1)^(n + 1)/(2*n - 1), n = 1 .. infinity):

sum((-1)^(n+1)/(2*n-1), n = 1 .. 4)



expand(sum((-1)^(n + 1)/(2*n - 1), n = 1 .. 4),symbolic);




series(sum((-1)^(n + 1)/(2*n - 1), n = 1 .. infinity),n=0,5);




Info series


How to get for n= 4  "for (&sum;)(((-1)^(n+1))/(2 n-1))  =   symbolic term 1+ symbolic term 2+... "





 a := x^2;
 b := x[1]^2;


Do you know why cg0 =/= x[0]*x[0]?

Hello people in MaplePrimes,

I can't understand a code with PLOT3D using GRID in it.
I hope you will give me explanation about it.


I cannot understand the correspondence between points in the graph and lists in the code such as [1,2,10], [1,1,8].

 As two ranges in GRID augments in the code are 1..2 and 1..3, x takes value from 1 to 2, and
y from 1 to 3 in the picture.
And, as k is k:=[[1,2,10],[1,1,8],[0,1,5],[0,0,6]], which means this list of lists are 4 X 3, so in the picture
as for x the interval of 1 to 2 is divided to three sections with the points of value of 0, 1/3, 2/3 and 3/3, which total number is 4.
And, as for y the interval of 1 to 3 is devided to two sections with the points of value of 1, 2 and 3, which total number is 3.

And, I cannot understand why from the grid of [1,1,8] in the code, which I think is the coodinate of (1, 1) on x-y plane, does not mean that the value of z on that point on the graph is not 8, but 1.

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