Markiyan Hirnyk

Markiyan Hirnyk

7198 Reputation

25 Badges

11 years, 270 days

MaplePrimes Activity


These are Posts that have been published by Markiyan Hirnyk

The is and coulditbe commands of Maple are known to be buggy.
Here are some math inventions done by these commands in Maple 2016.2.

restart; assume(x::real, y::real);
is(exp(x+I*y) <> 0);
                             false
coulditbe(exp(x+I*y) = 0);
                              true
coulditbe(exp(x+I*y) = infinity);
                              true
coulditbe((x+I*y)^2 = infinity);
                              true

It should be noticed that

is((-infinity)::real);
                             false

though

exp(-infinity+0*I);
                               0

The latter means

limit(exp(x),x=-infinity);
                                   0

, no more and no less.

Let us consider 

sol := pdsolve({diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) = (1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t}, {u(0, t) = 0, u(x, 0) = 0, v(0, t) = 0, v(x, 0) = 0}, time = t, numeric, timestep = 0.1e-1, spacestep = 0.1e-1, range = 0 .. 1); 
sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 .. 1);

A nice plot similar to the one produced by Mma (see the  attached pdf file pdesystem.pdf) is expected. 
The exact solutions u(x,t)=x*t,v(x,t)=x*t^2 are known

pdetest({u(x, t) = x*t, v(x, t) = x*t^2}, {diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) =
(1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t});
                              {0}

But the wrong result

               module() ... end module         
Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.26000000000000006):
solution becomes undefined, problem may be ill posed or method may be ill suited to solution

is obtained. Also 

sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 ..0.1);


 

The plot 

sol:-plot3d(v(x, t), x = 0 .. .5, t = 0 .. .1);

is not better.

Let us consider the help to RectangleWindow SignalProcessing-RectangleWindow.pdf SignalProcessing-RectangleWindow.mw.
Let us execute the example, taking N:=4 (in order to display the outputs).

with(SignalProcessing):
N := 4;
a := GenerateUniform(N, -1, 1);
         Matrix(1, 4, [[.396167882718146, -.826878267806025, -0.908376742154361e-2, .324899681378156]])         
RectangleWindow(a);
         Vector[row](4, [.396167882718146, -.826878267806025, -0.908376742154361e-2, .324899681378156])      
c := Array(1 .. N, 'datatype' = 'float'[8], 'order' = 'C_order'):
RectangleWindow(Array(1 .. N, 'fill' = 1, 'datatype' = 'float'[8], 'order' = 'C_order'), 'container' = c);
              Vector[row](4, [1., 1., 1., 1.])
u := `~`[log](FFT(c)):
plots:-display(Array([plots:-listplot(Re(u)), plots:-listplot(Im(u))]));



We see an uncommented code which (intentionally or unintentionally) produces two empty plots.
The questions arise:

  • What is the aim of the RectangleWindow command which does nothing 
    but the conversion of a Matrix(1,N,...) /Array(1..N,...) to a Vector[row](N,...)? 
  • Could such help be called friendly to Maple users?

There are many questions to Maplesoft and there are no answers from them: strategic silence.
RectangleWindow.mw

 

Let us consider the linear integer programming problem:

A := Matrix([[1, 7, 1, 3], [1, 6, 4, 6], [17, 1, 5, 1], [1, 6, 10, 4]]):
 n := 4; z := add(add(A[i, j]*x[i, j], j = 1 .. n), i = 1 .. n):
restr := {seq(add(x[i, j], i = 1 .. n) = 1, j = 1 .. n), seq(add(x[i, j], j = 1 .. n) = 1, i = 1 .. n)}:
 sol := Optimization[LPSolve](z, restr, assume = binary);

Error, (in Optimization:-LPSolve) no feasible integer point found; 
use feasibilitytolerance option to adjust tolerance

sol1 := Optimization[LPSolve](z, restr, assume = binary, feasibilitytolerance = 100, integertolerance = 1);

Error, (in Optimization:-LPSolve) no feasible integer point found;
 use feasibilitytolerance option to adjust tolerance

That was OK in Maple 16, outputting

.

The bug in one of the principal Maple commands lasts since Maple 2015, where the above code causes "Kernel connection has been lost". The SCRs about it were submitted three times (see http://www.mapleprimes.com/questions/204750-Bug-In-LPSolve-In-Maple-20151).

Let us consider 

restart; 
MultiSeries:-limit(sin(n)/n, n = infinity, complex);
0

The answer is wrong: in view of the Casorati-Weierstrass theorem the limit does not exist. Let us try another limit command of Maple

limit(sin(n)/n, n = infinity, complex);


(lim) (sin(n))/(n)

which fails. Therefore, Maple user does not obtain the correct answer. 

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