Maple 2019 Questions and Posts

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

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.

 

 

 

Is it considered a bug when pdetest does not give zero for a solution given by pdsolve? 

restart;
pde := x*diff(w(x,y,z),x)+  a*z*diff(w(x,y,z),y)+b*y*diff(w(x,y,z),z)=c:
sol:=pdsolve(pde,w(x,y,z));
pdetest(sol,pde)

Gives

which is not zero.

This is the first time I've seen this happen. 

Maple 2019.1 using Physics version 362

 

 

I need to use gamma as a "free" symbol in pde that I pass to pdsolve, so that the latex comes out as \gamma OK in the solution.

in other words, the pde itself uses the symbol gamma (as it is written in the textbook and I want to keep it the same). This gamma is not the known constant gamma. Something similar to using alpha and beta or x and y. 

But gamma in a known constant in Maple and I am worried this will affect some computation inside pdsolve if I use gamma  as known number in the PDE (even though I think it should not change the result of pdsolve as there are no other numbers in the PDE input, I just wanted to be safe).

I am not able to clear gamma

unassign(gamma)  gives error since it is protected.

Is  there a way around this? Should I use wrap the name with 'gamma'  or `gamma` for example? 

Here is an example

pde := a*diff(w(x,y,z),x)+ b*diff(w(x,y,z),y)+c*diff(w(x,y,z),z)= alpha*x+beta*y+gamma*z+delta;

It is the gamma above I am worried about using in the input. What is the correct way to do this?  

I have thought that   D(y)(0)=C1  and  eval(diff(y(t),t),t=0)=C1  mean exactly the same thing which is derivative of y wr.t. "t" evaluated at specific point t=0 is C1.

If you agree they are exactly the same thing, then why dsolve works with both forms used for initial conditions if the option 'series' is not used.

When using the 'series' option, dsolve stops working when using  eval(diff(y(t),t),t=0) form? All else is the same.

ode:=diff(y(t),t$2)+3*diff(y(t),t)+2*y(t)=0;
bc_form_1:=y(0)=C1,eval(diff(y(t),t),t=0)=C2;
bc_form_2:=y(0)=C1,D(y)(0)=C2;
sol1:=dsolve([ode,bc_form_1],y(t));
sol2:=dsolve([ode,bc_form_2],y(t))

Both the above work

But now when I use the 'series' option, the first form stops working!

ode:=diff(y(t),t$2)+3*diff(y(t),t)+2*y(t)=0;
bc_form_1:=y(0)=C1,eval(diff(y(t),t),t=0)=C2;
bc_form_2:=y(0)=C1,D(y)(0)=C2;
sol1:=dsolve([ode,bc_form_1],y(t),'series');
sol2:=dsolve([ode,bc_form_2],y(t),'series')

 

 

Is this a bug? 

Just updated to Maple 2019.1  on windows 10.

I have reinstalled Maple 2019 several times, including its latest update. But when trying to graph the following:

plot(sin(x), x = -2*Pi .. 2*Pi)

But I get this:

Error, (in plot) expected a range but received x = -2*Pi .. 2*Pi

And if I enter:

sin(x)

The result is:

2.73949338633639*10-116 + 2.73949338633639*10-116*I

When trying this:

plot3d(x*exp(-x^2 - y^2), x = -2 .. 2, y = -2 .. 2, color = x)

I get this:

And if I try it with Graph Theory:

with(GraphTheory);
G := Graph({{a, b}, {a, c}, {b, c}});
G := Graph 1: an undirected unweighted graph with 3 vertices and 3 edge(s)

DrawGraph(G)

Error, (in GraphTheory:-DrawGraph) invalid input: modp received I, which is not valid for its 2nd argument, m
 

I do not know what is the reason for this anomalous behavior of Maple 2019, it will be some software bug or it will be an error caused by my computer...
I would like to know if this problem happens to other people or just to me. Any help or guidance on this problem will be greatly appreciated.


Best regards

 

In Maple 2019 it is not possible to change to "1-D Math Input".

But it is possible to convert (right mouse->convert to-> 1D Math Input)

In this mode I get the following results:


> 6/2*(1 + 2);
                               9
> 6/2(1 + 2);
                               3
I have the feeling the 2nd result is wrong.
If I change to "Maple input", I get the following result:
> 6/2(1 + 2);
                               9
 
In this editor, where I write this post, it is possible to insert Maple Math.
If I enter there "6/2(1 + 2)", in the preview is written "3".
and
If I enter there "6/2(1 + 2+9)", in the preview is written "3".
 
The parser gives no error message, but a wrong result.
 
If I enter nonsense, there is the following message "You have entered an invalid Maple expression". 
 
Are you aware of this?
 

If I do:

df:=DataFrame(Matrix(3,4,[seq(1..12)]), rows=[a,b,c],columns=[A,B,C,D]);Tabulate(df, width=100)

 

The font that Maple uses for the Tablulate is much larger than the font used to display the Dataframe. How does one choose the font size that Tabluate() uses? 

Peter

As always, thank you all in advanced.

I found this challenge by chance.

solve 615+x^2=2^y over integers.

I rushed to Maple and tried to solve it  with “solve” and "assuming" but I did not get results.

solve(615+x^2=2^y) assuming x::integer,y::integer   did not work.

How could this equation be suitably formulated for Maple to solve it?
 

 

I was trying to see if Maple can solve this problem from my class textbook

When I tried boundary conditions all zero on the Laplace PDE in semicircular cylinder, pdsolve generates internal error.

The boundary conditions should not all be zero for nontrivial solution, but the question is why Maple generate this internal error? Is this a bug? Using Physics package 362, Maple 2019 on windows 10.

restart;

unassign('r,theta,z,f,H');
pde:=VectorCalculus:-Laplacian(u(r,theta,z),'cylindrical'[r,theta,z])=0;
bc:=u(r,theta,0)=0, u(r,theta,H)= f(r,theta), u(r,0,z)=0, u(r,Pi,z)=0,u(a,theta,z)=0;
sol:=pdsolve([pde,bc],u(r,theta,z)) assuming a>0,r<a,H>0,theta>0,theta<Pi

(diff(u(r, theta, z), r)+r*(diff(diff(u(r, theta, z), r), r))+(diff(diff(u(r, theta, z), theta), theta))/r+r*(diff(diff(u(r, theta, z), z), z)))/r = 0

u(r, theta, 0) = 0, u(r, theta, H) = f(r, theta), u(r, 0, z) = 0, u(r, Pi, z) = 0, u(a, theta, z) = 0

"sol := "

unassign('r,theta,z,f,H');
pde:=VectorCalculus:-Laplacian(u(r,theta,z),'cylindrical'[r,theta,z])=0;
bc:=u(r,theta,0)=0, u(r,theta,H)= 0, u(r,0,z)=0, u(r,Pi,z)=0,u(a,theta,z)=0;
sol:=pdsolve([pde,bc],u(r,theta,z)) assuming a>0,r<a,H>0,theta>0,theta<Pi

(diff(u(r, theta, z), r)+r*(diff(diff(u(r, theta, z), r), r))+(diff(diff(u(r, theta, z), theta), theta))/r+r*(diff(diff(u(r, theta, z), z), z)))/r = 0

u(r, theta, 0) = 0, u(r, theta, H) = 0, u(r, 0, z) = 0, u(r, Pi, z) = 0, u(a, theta, z) = 0

Error, (in assuming) when calling '`PDEAdvisor/2nd_order/Series/ThreeVariables`'. Received: 'invalid input: rhs received _Z3, which is not valid for its 1st argument, expr'

 


 

Download bug3.mw

Good day,

I was recently using Maple 2019 for work on a project, and ran into an error. This error (which will be copied and pasted below for others to test) occurs when making assumptions across multiple lines (whether using the additionally function or not) while using IntegrationTools[Change]. It seems that, if during the process a variable that was within both the assumptions is subtracted from itself, the subtraction fails to happen and leaves what effectively equals 0 in the workings, making further workings impossible.

I'm wondering if anyone else is able to reproduce this error? I know the fix for it is to not disjoint the assumptions, but I am curious if others can easily reproduce it or if others have experiences with it!

As promised, below you will find my workings in order to reproduce this error!

Base Error:

restart;
assume(a>0,b>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
assume(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Simple Fix:

restart;
assume(a>0,b>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Error Without Interface Change:

restart;
assume(a>0,b>a,c>0,t>0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
assume(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Error When Using Additionally:

restart;
assume(a>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
additionally(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)

 

Dear Maple friends~

Recently I am thinking a question about how to use Maple to prove an equation based on a known partial differential equationand its boundary conditions.

Although I can Prove it with hand computation ,it still has some difficulty and it will be really hard if its partial differential equation become more complex(As a matter of fact, it will happen).So I think of Maple and want to take advantage of computer.However,I get few ideas how to realize it .The details are as follows:

alias(u=u(x,t)):
pde:=diff(u,t)-diff(u,x$2,t)+4*u^2*diff(u,x)=3*u*diff(u,x)*diff(u,x$2)+u^2*diff(u,x$3);
N:=5;#actually N can be any positive integer!
bcs:=eval(u,x=-infinity)=0,seq(eval(diff(u,x$ha),x=-infinity)=0,ha=1..N),eval(u,x=infinity)=0,seq(eval(diff(u,x$ha),x=infinity)=0,ha=1..N);
E:=Int(u^4+2*u^2*diff(u,x)^2-diff(u,x)^4/3,x=-infinity..infinity);

#try to prove the following equation
diff(E,t)=0

The written proof is as follows:

Therfore,I submit such a problem and look forward your solutions and suggestions sincerely~

restart;
with(Physics);
with(LinearAlgebra);
N := 4;


Cf := Matrix(6, 6, (z, p) -> C[z, p, 1], shape = symmetric);
sigma[1] := Vector(6, [sigma[1, 1, 1], sigma[2, 2, 1], sigma[3, 3, 1], sigma[1, 2, 1], sigma[1, 3, 1], sigma[2, 3, 1]]);
varepsilon[1] := Vector(6, [varepsilon[1, 1, 1], varepsilon[2, 2, 1], varepsilon[3, 3, 1], gamma[1, 2, 1], gamma[1, 3, 1], gamma[2, 3, 1]]);
sigma[1] := Cf . (varepsilon[1]);





for i from 2 to N do
    C[i] := Matrix(6, 6, (z, p) -> C[z, p, i], shape = symmetric);
    sigma[i] := Vector(6, [sigma[1, 1, i], sigma[2, 2, i], sigma[3, 3, i], sigma[1, 2, i], sigma[1, 3, i], sigma[2, 3, i]]);
    varepsilon[i] := Vector(6, [varepsilon[1, 1, i], varepsilon[2, 2, i], varepsilon[3, 3, i], gamma[1, 2, i], gamma[1, 3, i], gamma[2, 3, i]]);
    sigma[i] := (C[i]) . (varepsilon[i]);
end do;



B[1] := 0;

for i to N do
    Parameters(epsilon11c, C[1, 1, i], C[1, 2, i], C[2, 2, i], C[2, 3, i], R[i], A[i], B[i + 1], P);
end do;



g[1](r);
ux[1] := (x, r) -> epsilon[1][1]*x + g[1](r);
ur[1] := r -> A[1]*r + B[1]*1/r;
varepsilon[1][1] := epsilon11c;
varepsilon[1][2] := r -> (A[1]*r + B[1]*1/r)*1/r;
varepsilon[1][3] := r -> diff(ur[1](r), r);
varepsilon[1][3](R[2]);



for i from 2 to N - 1 do 
g[i](r); 
ux[i] := (x, r) -> epsilon[i][1]*x + g[i](r); 
ur[i] := r -> A[i]*r + B[i]*1/r; 
varepsilon[i][1] := epsilon11c; 
varepsilon[i][2] := r -> (A[i]*r + B[i]*1/r)*1/r; 
varepsilon[i][3] := r -> diff(ur[i](r), r); 
varepsilon[i][2](r); i;
end do;
i;
varepsilon[2][2](r);

Hi everyone,

 

I am currently writing a code on maple and I am finding difficulties in this section.

When I define the functions this way, the result I get from the loop "for" for varepsilon[i][2](r) is the same and doesnt depend on i value. I also tried to define it another way that would give me different results but I would end up with being unable to replace the variable "r" with its values (I would get r(R2)).

I would be grateful if you could advice me with this matter.

Thank you in advance.

1 2 3 4 5 6 Page 3 of 6