Quantcast
Channel: MaplePrimes - Questions and Posts tagged with solve
Viewing all articles
Browse latest Browse all 1088

internal symbol _Z1 causes Error, (in SolveTools:-Inequality:-Piecewise) piecewise takes at least 2 parameters

$
0
0

When I run a proc, I get an error

Error, (in SolveTools:-Inequality:-Piecewise) piecewise takes at least 2 parameters


But when I do restart; and then run the same command where the error was generated from inside the proc, but outside the proc, I get no error.

So I did not understand why it fails inside the proc, as I am typing the same exact command.

It turned out that an internal symbol _Z1 must have got messed up due to earlier calls made in the proc. It seems to have assumptions on it. To show this, here is screen shot. Only when I cleared the assumptions on _Z1, did it work. I do not use _Z1 any where in my code. This came back from a Maple call.

 

 

Now to proof this:

restart;
assume(_Z1::integer);
solve({x <> (  (1/2)*Pi+_Z1*Pi ), x < infinity, -infinity < x},{x})

 

I never set _Z1 myself in my code. This was done by Maple internally somewhere and caused this error. In my proc, I made call to singular and to solve only. And noticed this problem. 

What should I do to avoid this problem? Why Maple fails above when its own _Z1 symbol is assumed integer? Is this a bug?


As a workaround for now, I could do this

_Z1:='_Z1'; #when I clear this, the error goes away. Why?
sol:=solve({x <> (1/2)*Pi+_Z1*Pi, x < infinity, -infinity < x},{x}):
simplify(sol) assuming _Z1::integer;

ofcourse,  I do not know that Maple will use _Z1 all the time, since I have to hardcode this in the code for now to pass through this problem. So this is a temp. solution for me.


 

 

 

 


Viewing all articles
Browse latest Browse all 1088

Trending Articles