Question: Is Maple behavior deterministic?

I use one engine per one worksheet. So one would expect that doing restart; command; to always behave the same way. Right?

Because each time, new or refreshed mserver.exe is used.  But here is a worksheet, where I run it few times (all with restart each time), where sometime the command timelimit hangs, and sometime does not. I do not mean it takes little longer sometime. I mean completely hang.

I've waited 10-20 minutes and nothing happens. And sometime I saw it return back in 2 or 3 minutes. But most of the time it hangs.

I wish someone could explain this to me. If it hangs each time, or not hang each time, I can understand. (ofcourse timelimit should never hang, as it was supposed to have been fixed in 2021, but this is separate issue).

But why it hangs sometimes and not other times? Does Maple use some sort of random number generator inside it to decide on things? For me, software should behave the same each time when run from same initial state.

It also depends on the amount of timeout given if it hangs or not.

What can cause this different behavior and most important, what can one do to make it behave same way each time? I thought that what restart supposed to do.

Any insight what can cause this is welcome.

I also found that closing the worksheet completely and opening it again, results in different behavior in the timing. It looks like restart does not clear everything, as what happens when closing the worksheet and reopeing it again.

i.e. Sometimes when it completes and not hang, then issuing restart again and running the int() command, it will also not hang most likely.

It seems Maple have remembered something. But closing the worksheet and opening it again, it will hang again most of the times.

The point of all this, is that Maple behaves differently each time. But why??

9704

``

restart;

24868

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1762. The version installed in this computer is 1757 created 2024, June 6, 14:53 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1)

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

time();
#hangs sometimes and not other times. Most of the time it hangs. increasing time
#will improve the chance it will hang
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
time();

.375

Download hangs_int_june_16_2024.mw

Here is one screen shot of one of those times where it returned back. Took little over one minute. Good.

Here is second screen shot where it took about1,800 real time seconds to return. (30 minutes, even though timelimit was one minute). Same exact code.

update

I tried the suggestion given below to use _EnvProbabilistic:=0 but it had no effect on making Maple behavior consistent each time.

Below worksheet shows this. I tried 6 trials, each with restart. 

First trial it timeout at 74 second. good. Second trial took 1403 seconds !  Third trial went back to 74 seconds again (good).  Trial 4 took also took about 74 seconds (good). trial 5 went back to being slow and took about 1400 seconds again. Trial 6 went back to being fast and took about 74 seconds.

So the pattern seems to be 

                     fast SLOW fast fast SLOW fast.....

But I also tried this whole test again, by closing the worksheet and opening. Now the pattern changed to

                     SLOW fast fast fast SLOW SLOW ....

I also attached the worksheet for the above below.

So Maple still behaves in random fashion in doing the integration above. sometimes it is slow, sometimes fast. All using same exact code and same integral. Extra points to anyone who could find out why and how to fix this.  

This worksheet have pattern    fast SLOW fast fast SLOW fast....

1036

restart;

1036

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1762. The version installed in this computer is 1757 created 2024, June 6, 14:53 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

 

Trial #1

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]();
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

4019.660

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 74.618

 

Trial #2

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in sdmp:-mul) time expired

"time taken ", 1403.978

 

Trial #3

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 73.979

 

Trial #4

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 73.732

 

 

 

Trial #5

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in sdmp:-mul) time expired

"time taken ", 1396.089

 

Trila #6

 

restart;

1036

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in anonymous procedure called from PDEtools/NumerDenom) time expired

"time taken ", 73.383

 

 

Download hangs_int_V2_june_16_2024.mw

This worksheet below have pattern      SLOW fast fast fast SLOW SLOW ....

 

restart;

21096

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1762. The version installed in this computer is 1757 created 2024, June 6, 14:53 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

 

Trial #1

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]();
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

28.483

Error, (in sdmp:-mul) time expired

"time taken ", 1400.316

 

Trial #2

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 74.404

 

Trial #3

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 73.993

 

Trial #4

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in PDEtools/NumerDenom) time expired

"time taken ", 73.550

 

 

 

Trial #5

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in sdmp:-mul) time expired

"time taken ", 1373.684

 

Trila #6

 

restart;

21096

_EnvProbabilistic:=0;
expr:=-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp(4*I*(polylog(2,exp(I*x)))-polylog(2,-exp(I*x) ))*csc(x)*x*(tan(x)^2-1);
st:=time[real]():
timelimit(60,int(expr,x,method=_RETURNVERBOSE));
print("time taken ",time[real]()-st);

0

-4*(1-exp(I*x))^(-4*x)*(exp(I*x)+1)^(4*x)*exp((4*I)*polylog(2, exp(I*x))-polylog(2, -exp(I*x)))*csc(x)*x*(tan(x)^2-1)

Error, (in sdmp:-mul) time expired

"time taken ", 1383.174

 

 

Download hangs_int_V3_june_16_2024.mw

Observation: When it finishes fast, timeout is always in  PDEtools/NumerDenom.

When it takes long time, timeout is always in sdmp:-mull

Any other suggestions what to try are welcome.

Please Wait...