Here is a simple bug:

If I define a function f via

>f:=x->solve(-x*(x+1)+y^(2/x),y);

I can plot(f(x), x=0.2..5) and evaluate f(3) but plot(f,0.2..5) yields an error message ( wrong argument  (f) in plot) and f(1.5) crashes Maple 12–connection to kernel lost.

If I define the function using fsolve or using unapply as in
> g:=unapply(exp((1/2)*ln(x^2+x)*x),x);

I can plot(g,0.2..5) or plot(g(x),x=0.2..5) or evaluate g(1.5) without problems.
 

Any idea whee the bug is?

 

Here is another curous situation. I want to define 2 arrays of  random digits.
If I use randomize and place the commands on separate lines all is well e.g.

restart;
randomize();A:=Array(1..10,rand(0..9)):
                                 1256399515

randomize();B:=Array(1..10,rand(0..9)):
                                 1256399518

A, B;
       [3, 8, 6, 3, 7, 2, 0, 5, 6, 7], [7, 6, 6, 6, 1, 9, 2, 2, 6, 4]

However, if I put the commands on the same line line the arrays are duplicates.


restart;
randomize();A:=Array(1..10,rand(0..9)):randomize();B:=Array(1..10,rand(0..9)):A, B;
                                 1256399426
                                 1256399426
       [4, 9, 2, 4, 0, 1, 3, 1, 8, 6], [4, 9, 2, 4, 0, 1, 3, 1, 8, 6]

Both Arrats use the same seed but why are tey duplicated?

If I do not bother to reset the seed all is well again:

restart;A:=Array(1..10,rand(0..9)):B:=Array(1..10,rand(0..9)):A,B;
       [6, 9, 5, 1, 3, 5, 4, 0, 7, 4], [9, 1, 1, 3, 7, 2, 8, 9, 1, 7]
 

Any ideas?

 

thanks,

 


Please Wait...