Maple 2019 Questions and Posts

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

Why doesn't

f:=ln(s + 2)^2 + 2*polylog(2, -1 - s) + 2*polylog(2, (1 + s)/(s + 2))

simplify to zero assuming s>0?

I solved this PDE by hand to verify Maple's solution. I think Maple solution is wrong. This PDE is the heat PDE on a bar (1D) with boundary coditions on both ends are function of time and zero initial conditions.

unassign('A,B,x,t,L,k,f');
pde := diff(u(x,t),t)= diff(u(x,t),x$2):
bc := u(0, t) = A(t), u(1, t) = B(t):
ic := u(x, 0) = 0:
sol1:=pdsolve([pde, ic, bc], u(x, t));

#now try when A(t)=sin(t),B(t)=t, use 20 terms for the sum
sol2:=simplify(subs([infinity=20,B(tau)=tau,A(tau)=sin(tau),A(0)=0,B(0)=0,A(t)=sin(t),B(t)=t],sol1)):
sol3:=simplify(value(subs(t=1,sol2))):
evalf(subs(x=0.5,sol3))

 

Also doing pdetest(sol1,pde); on the above solution does ot return zero as expected.

To verify more, I solved the same PDE again, but now using an explicit values for the boundary conditions A(t), B(t). Using A(t)=sin(t), B(t)=t. Then found the value again of the solution u at x=0.5 and t=1 like in the above, and it gives different value:

unassign('A,B,x,t,L,k,f');
pde := diff(u(x,t),t)= diff(u(x,t),x$2):
bc := u(0, t) = sin(t), u(1, t) = t:
ic := u(x, 0) = 0:
sol4:=pdsolve([pde, ic, bc], u(x, t));
sol5:=simplify(subs(infinity=20,sol4)):
sol6:=simplify(value(subs(t=1,sol5))):
evalf(subs(x=0.5,sol6))

Then I typed my hand solution into Maple and for the same values x=0.5, t=1 and same number of terms, I also get the same value 0.819. 

Full hand solution is long to post here, I post the final result.

I do not see at all where the function sin integral should come into play in this solution. 

Could some Maple expert please check to see what is going on with this solution to Maple? Here is my hand solution (final result)

Where in the above, f(x) is initial conditions (which is zero in the examples above), and L is length of the bar, which is 1 in the above examples, and k=1 also in the above examples.  You see, there is no Si function any where in the solution. Replacing in the above solution L=1,f=0,k=1,A=sin(t),B=t and evaluting the sum using 20 terms at x=0.5, t=1, gives 0.819... 

Using Maple 2019.1 and Physics version 370

 

I do not understand why Maple can simplify this expression below when told that n is integer and also positive using a "," to separate the assumptions, but does simpify the same expression when using "and" to build the assumptions.

Here is an example

restart;
result:=int(x*cos(n*Pi/5*x),x=0..5)
simplify(result) assuming n::integer and n>0

But this works

simplify(result) assuming n::integer, n>0

What are the semantic differences between writing assuming "n::integer and n>0" and "n::integer,n>0" ? I thought these would be the same, but clearly they are not.

Maple 2019.1 on windows.

Hello! I have a Maple sheet that is functional in some versions of Maple but not others. It works perfectly in Maple 18 (which is the version with which it was written), but when running it in Maple 2019, I see the following error:

  • "Error, (in Matrix) cannot determine if this expression is true or false: Distance(Vector[row](3, {(1) = 0., (2) = 1.313799622, (3) = 0}), Vector[row](3, {(1) = 0., (2) = -1.313799622, (3) = 0})) < 99999999999999999999/100000000000000000000"

And believe that it is related to the following lines of code:

  • R := Matrix(N, (i, j) -> Distance(coords[i], coords[j]) ;
  • S := Matrix(N, (i, j) -> if i = j then 1 elif R[i, j] < 3 then (1+C*R[i, j]+(2/5)*C^2*R[i, j]^2+(1/15)*C^3*R[i, j]^3)*exp(-C*R[i, j]) else 0 end if)

It seems as if it cannot compute a distance between two points (as given in the form of two vectors). I have imported the Student:-Precalculus package, along with ArrayTools and LinearAlgebra, at the start of the sheet, but am wondering if there is an issue with this package in other versions of Maple. The full sheet can be provided if more information is needed, but I'm pretty sure that portion is the problem. Any help would be greatly appreciated.

 

Sheet: testsheet.mw

Hi everybody and thank you all in advance.

This is my question. Suppose I have a list of lists like this:

[[1,2,3],[7,8,9],[13,12,11]]

I want to select all 3rd element from the list of lists and get:

[3,9,11]

Another example:

[1, [2, 3], [4, [5, 6], 7], [8, 3], 9] and select the first element from the list of lists and get:

[1, 2, 4, 8, 9]

Additionally suppose I want to sort a list of lists but base on the 3rd element of every sublist. Example:

From this list:

[[1,2,3],[7,8,2],[13,12,1]] sorted by the  3rd element I would get:

[[13,12,1], [7,8,2], [1,2,3]]

 

So, I am trying to write a method for array interpolation. I have a Matrix that is X by 3, where each column holds specific data (column 1 holds independent data 1, column 2 holds independent data 2, column 3 holds dependent data).

This data comes from a function with 2 independent variables, and I am creating a graph of this function, basically, with both independent variables going from 0 to 1 (approximately 300 values per variable, giving me a matrix with 90k values already). My goal is to use interpolation to get a lot of values in between the points I already calculated.

That being said, I don't know how to use the ArrayInterpolation command to achieve this. I will post my code below if anyone can help me out!

Code:

Interpolate := proc(M::Matrix)
  local i; local j;
  local M1 := Matrix(RowDimension(M),1);
  local M2 := Matrix(RowDimension(M),1);
  local M3 := Matrix(RowDimension(M),1);
  for i from 1 to RowDimension(M) do
    M1(i) := M(i,1);
    M2(i) := M(i,2);
    M3(i) := M(i,3);
  end do;
  print(M1,M2,M3);
  local M4 := Matrix(1000,1);
  local M5 := Matrix(1000,1);
  for j from 1 to 1000 do
    M4(j,1) := 0.001*j;
    M5(j,1) := 0.001*j;
  end do;
  ArrayInterpolation([M1,M2],M3,[M4,M5]);
end proc;

Hello everyone, here i Denmark we are using comma as a separator for decimal numbers. I have looked in the forum and found that if i changed my region in windows settings, but it is Denmark. When i use number formatting it tells me the output will be with comma as a separator,  but the output comes out with period as the separator. Is there a way to change it manually ?

 

 

Hi, 

I am trying to derive solutions for cubic equation using Maple.

Problem I encountered is it automatically cancles and simplifies, I cannot reach to the final form using Maple commands except modifying the equation by myself.

like, 

(-108*q - 12*sqrt(12*p^3 + 81*q^2))^(1/3)/6 into (-q/2 + sqrt(p^3/27 + q^2/4))^(1/3)

Another one, even though I want this fractional form, it becomes other form automatically

(-q/2 + sqrt(p^3/27 + q^2/4))^(1/3) into (-q/2 + sqrt(12*p^3 + 81*q^2)/18)^(1/3)

Thank you.

Hey there.

I've been using the threads package to parallelize some code. It's going well for the most part - my code runs way faster and I can observe with my System Monitor (ubuntu) that multiple cores are indeed being used. However, ~ 4 of every 5 times I try to run the exact same code, Maple will get stuck on a threaded calculation. If I follow the CPU usage in these instances, I see that one of the CPUs is maxed out at 100%. I am forced to quit Maple and kill the kernel process. Has anyone seen something like this before?

 

Thanks in advance.

Is there an option or setting to tell Maple not to return trivial solution as a solution to a PDE? Even though trivial solution is correct, it is not something I wanted, and it is making it hard for me to check if the solution is trivial or not. 

Here is an example:

pde:=I*diff(f(x,t),t)=-diff(f(x,t),x$2)+2*x^2*f(x,t):
bc:=f(-infinity ,t)=0,f(infinity,t)=0:
pdsolve([pde,bc],f(x,t))

Mathematica returns this

If there is no such option in Maple, what would be a good way to check for trivial solution using Maple code?

Just checking if rhs(sol)=0 does not work all the time, as some actual solutions are returned with 0 in rhs, like this example

pde := diff(u(x, y), x) + u(x,y)*diff(u(x, y),y) =0:
sol:=pdsolve(pde,u(x,y)):
sol:=DEtools:-remove_RootOf(sol)

So I need either find a way to tell Maple not to return trivial solution, or good robust way to check if solution returned is the trivial solution so I can reject it.

Any suggestion from the Maple experts how to handle this? I am now just interested in result from pdsolve, not dsolve.

The input is the PDE itself, read from a file. So this has to be done without visual inspection on the screen as the program reads the PDE from a file and process it. So the dependent variable and the independent variables are all included in the PDE itself. To make it more clear, I need a function such as

is_solution_trivial :=proc(pde,sol)
     #decide if sol is trivial solution or not.
     #one possibility is to find from the PDE the dependent variable
     #and the independent variables as in u(x,y,t,....) and then check
     #if sol  has the form u(x,y,t,....) =0 ?
end proc;

The above I can use until I figure how to tell Maple NOT to return trivial solution in first place!

 

   

Maple 2019.1

Hello,

I'm confused about Maple's adjoint function (in the DEtools package). When I take the adjoint of the derivative operator:

DEtools:-adjoint(Dx, [Dx, x])

 

I get back simply "Dx". However, doing the calculation by hand and integrating by parts seems to indicate that this should return the negative of Dx. The inner product I'm using is int(f(x)*conjugate(g(x)), x=0..1). Is Maple perhaps using a different inner product? Or is this a generalization that I'm unaware of? Or is it perhaps just a bug?

 

Thanks!

I installed Physics package 368 and when I run a test, I found that now the latex() command fails with internal  error which I have never seen before. I think this is first time I see latex() gives an error.

restart

lap:=VectorCalculus:-Laplacian(u(r,z,t),'cylindrical'[r,theta,z]):
bc:=u(r,0,t)=0,u(r,H,t)=0, u(a,z,t)=0:
ic:=u(r,z,0) = f(r,z):
sol:=pdsolve([diff(u(r,z,t),t) = k*lap,bc,ic],u(r,z,t)) assuming a>0,r<a,H>0,k>0;
latex(sol);

u(r, z, t) = `casesplit/ans`(Sum(Sum(4*BesselJ(0, lambda[n1]*r/a)*sin(n*Pi*z/H)*exp(-k*t*(Pi^2*a^2*n^2+H^2*lambda[n1]^2)/(a^2*H^2))*(Int(BesselJ(0, lambda[n1]*r/a)*r*(Int(sin(n*Pi*z/H)*f(r, z), z = 0 .. H, AllSolutions)), r = 0 .. a, AllSolutions))/(H*a^2*hypergeom([1/2], [1, 2], -lambda[n1]^2)), n = 1 .. infinity), n1 = 1 .. infinity), {And(lambda[n1] = BesselJZeros(0, n1), 0 <= lambda[n1])})

Error, (in latex/int) invalid arguments

lprint(sol)

u(r,z,t) = `casesplit/ans`(Sum(Sum(4*BesselJ(0,lambda[n1]/a*r)*sin(n/H*Pi*z)*
exp(-k*t*(Pi^2*a^2*n^2+H^2*lambda[n1]^2)/a^2/H^2)*Int(BesselJ(0,lambda[n1]/a*r)
*r*Int(sin(n/H*Pi*z)*f(r,z),z = 0 .. H,AllSolutions),r = 0 .. a,AllSolutions)/H
/a^2/hypergeom([1/2],[1, 2],-lambda[n1]^2),n = 1 .. infinity),n1 = 1 ..
infinity),{And(lambda[n1] = BesselJZeros(0,n1),0 <= lambda[n1])})

 


 

Download bug_june_6_2019.mw

Is this a new bug? Why latex() command now fails? It failed on the above output. When I try latex() on simpler output. no error is generated. So something to do with the above specific output seems to be the issue.

Maple 2019.1 using Physics 368 on windows 10.

 

This is a new error I have not seen before.  

Trying to verify my solution for the diffusion pde in cylinderical coordinates wth no angle theta dependency.

unassign('z,t,r,u');
lap:=diff(u(r,z,t),r$2)+ 1/r*diff(u(r,z,t),r)+diff(u(r,z,t),z$2);
bc:=u(r,0,t)=0,u(r,1,t)=0, u(1,z,t)=0;
ic:=u(r,z,0) = f(r,z);
pdsolve([diff(u(r,z,t),t) = lap,bc,ic],u(r,z,t)) assuming t>0

The error is

 

Error, (in assuming) when calling 'BesselJZeros'. Received: '0th zero of BesselJ(0,x) not defined'

Is this a bug or Am I doing something wrong? 

update

fyi, it also fails with same error when trying boundedseries HINT

restart;
unassign('z,t,r,u');
lap:=VectorCalculus:-Laplacian(u(r, z, t), cylindrical[r, theta,z]);
bc:=u(r,0,t)=0,u(r,1,t)=0, u(1,z,t)=0;
ic:=u(r,z,0) = f(r,z);
pdsolve([diff(u(r,z,t),t) = lap,bc,ic],u(r,z,t),HINT=boundedseries(r=0))

I am using Maple 2019.1 with Physics 366 on windows 10

 

Maple 2019.1 with Physics version 362  gives this strange error on this pde

restart;
pde := x*diff(u(x, y), x) + y*diff(u(x, y), y) = -4*x*y*u(x, y);
ic := u(x, 0) = exp(-x);
sol:=pdsolve([pde,ic],u(x,y));

Error is

Error, (in PDEtools:-casesplit) equation of unknown type integer : 1

Is this a bug? It shows only when using exp(-x). Changing it to exp(-x^2) or exp(x) do not show the error, even though Maple can't solve it.

On windows 10.

I was trying to verify some solution to pde in textbook using Maple. The book gives the Cauchy data for this first order PDE in the form that Maple does not like when I used it as input. Here is an example

When I typed

 

pde:=u(x,y)*(x+y)*diff(u(x,y),x)+u(x,y)*(x-y)*diff(u(x,y),y)=x^2+y^2;
ic:=u(x,2*x)=0;
pdsolve([pde,ic],u(x,y))

Maple complained

Error, (in PDEtools:-Library:-NormalizeBoundaryConditions) unexpected 
occurrence of the variables {x} in the 2nd operand of u(x, 2*x) in the given initial conditions

In Mathematica it accepts such form of Cauchy data:

pde=u[x,y]*(x+y)*D[u[x,y],x]+u[x,y]*(x-y)*D[u[x,y],y]==x^2+y^2;
ic=u[x,2*x]==0;
DSolve[{pde,ic},u[x,y],{x,y}]

(I have not verified the above answer is correct or not).

Am I doing something wrong in Maple?

Or is there a trick or option or method to allow Maple to accepts such initial conditions? The book I am looking at has many problems where Cauch data is given on such form (i.e. u=0 on specific curve or in 3D on some specific surface). Here is another example

 

Which I'd like write its initial conditions as u(x,1/x)=0 but can not.

I could ofcourse solve the pde without these initial conditions, and then post process the answer to find the constants of integration from the Cauchy data given. But it will be nice if Maple would accept the IC as is.

 

 

 

1 2 3 4 5 Page 1 of 5