nm

10421 Reputation

19 Badges

12 years, 190 days

MaplePrimes Activity


These are replies submitted by nm

It happens on second and all next calls. Not on first call. May be it is a bug.

interface(version);

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

restart:

27752

ts_standard:=proc(k::anything)    
     interface(typesetting=standard):
     print(k);
     interface(typesetting=extended):
     NULL;
end proc:
k:=3/8*ln(55/52)+sin(x)+3/4*exp(x):

ts_standard(k);

(3/8)*ln(55/52)+sin(x)+(3/4)*exp(x)

ts_standard(k);

3*ln(55/52)*(1/8)+sin(x)+3*exp(x)*(1/4)

ts_standard(k);

3*ln(55/52)*(1/8)+sin(x)+3*exp(x)*(1/4)

 

 

Download fix_interface.mw

@C_R 

Could you please try with larger timeout to see if it will hang? 30,40,50 seconds? As it depends on the timeout and how fast the PC is. 

@C_R 

Thanks for checking. Does this mean it did hang for you on Maple 2024.0 but not on 2024.1?

I have no access to Maple 2024.1, I thought it was not released yet to try it.  But once it is out officially will upgrade and try for sure.

@Carl Love 

I meant to say implicit. Similar to Maple's solution. will correct now.

any reason integration by parts can not be used to isolate get implicit y solution?

 

@Joseph Poveromo 

Your ode has invalid syntax, You are using [ ] for grouping terms

May be it is a copy paste issue. I do not know. But you can't use [ ] in place of ( )

Maple 2024 on windows

do you have to use version()? Why not  one of these:

p1:=interface(version):
p2:=kernelopts(version):

They do not print anything on screen. Do not know if these will do what you want but they have the Maple version in there, You'd have to just parse it out which is easily done. on my PC  these give

@C_R 

Thanks for the investigation.

The point of this test is not parrallel rich or even int.  But just to show that Maple behavior is not deterministic where timelimit sometimes work and sometimes do not work (either very late, or completely lock). 

It is the only small test case I could make that clearly shows this.

I've been having this problem in Maple for many years, with random hangs at different places using same code with no solution. And this test is meant to show this.

In my main program I actually use 

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

To force Maple not to use threads and to use one core only in the hope this will prevent the random hangs. But unfortunately this did not solve the problem in my program. It still hangs at random places even thought I do not use parrallel risch.

Below is V4 of the trial worksheet which is the same as the one in my post, but I added the above code for each trial to prevent Maple from using more than one core and more than one thread. 

This now shows that indeed each trial now take similar but very long time to finish. Instead of around one minute, each now takes about 24 minutes to complete. So timelimit is still not working as was claimed in 2021 release. I understand that timelimit can't return at exact time asked. But to ask for one minute timeout and get 24 minutes timeout means the function is broken. I can understand 10 to 20 or even 30 percent off.

I do not understand why Maplesoft is unable to make timelimit work after all these years. It can't be that hard to fix.

So using one core core and one thread solved the problem of getting different timing for this test.

But since I am not using parallel risch in my main program and still get random hangs at different places in code, this means there is another Maple function I am using which does not support timelimit but I have no idea what it is in order to try not to use it or replace it with something else.

But for this specific question, I think your answer here solves it as it shows the cause of the different times was using threads.

 

``

restart;

24108

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 and is the same as the version installed in this computer, created 2024, June 13, 11:3 hours Pacific Time.`

 

Trial #1

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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)

48.761

Error, (in sdmp:-mul) time expired

"time taken ", 1464.989

 

Trial #2

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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 ", 1454.596

 

Trial #3

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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 ", 1420.149

 

Trial #4

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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 ", 1418.282

 

 

 

Trial #5

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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 ", 1418.214

 

Trila #6

 

restart;

24108

kernelopts(numcpus=1);
kernelopts(gcmaxthreads=1);

24

numcpus

_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 ", 1417.225

 

 


 

Download hangs_int_V4_june_16_2024.mw

@Thomas Richard 

opps. I was looking at this for 2 hrs and did not see this. I copied it by hand from a book.

Sorry about this noise. Should I then delete this now?

@C_R 

Did you run the updated worksheet with 6 trials? DO you get similar timings on them or some are slow and some fast as I show?

Which version are you using? 

THe integral is not solvalble. int() returns right away as expected. This is just made up one for testing.

@C_R 

Oh, I see what you meant. Will this do what you want in this case?

((x->x)=combine[trig])(expr);

For the third line. What is it supposed to do?  Did you mean

map(x->x=combine[trig](x),[trig])

I do not understand what  your

(x->x=combine[trig])(expr);

is supposed to do actually.

@C_R 

Well, I thought you just wanted the fraction*ln changed. That was your example. 

For general cases, you could try this and see. 
 

26000

restart;

26000

interface(typesetting=extended);

extended

make_nice:=proc(k::anything)
     evalindets(k,`&*`(fraction,anything),F->InertForm:-MakeInert(F));
end proc;

proc (k::anything) evalindets(k, `&*`(fraction, anything), proc (F) options operator, arrow; InertForm:-MakeInert(F) end proc) end proc

k:=3/8*ln(55/52);

(3/8)*ln(55/52)

make_nice(k)

`%*`(`%/`(3, 8), %ln(`%/`(55, 52)))

k:=3/8*ln(55/52)+sin(x)+3/4*exp(x);

(3/8)*ln(55/52)+sin(x)+(3/4)*exp(x)

make_nice(k)

`%*`(`%/`(3, 8), %ln(`%/`(55, 52)))+sin(x)+`%*`(`%/`(3, 4), %exp(x))


 

Download make_nice.mw

 

@acer 

Thanks. I did not relaize it is same underlining issue. I ended up writing my own function to verify the IC only using limits and it is working so far where odetest fail such as this example.

I only now use odetest to verify the solution, but not the initial conditions due to this problem in odetest.

@Preben Alsholm 

Yes, this is what I mean,.

If you look at my solution for second example, when using "solve" it is the same as what "dsolve" gave. So internally "dsolve" must have used "solve" in this example. The solution verifies in this case.

But when using "Solve", and everything else is same, now odetest do not verify the solution any more. Due to how the RootOf comes out.

So yes, it is not always better to use "Solve". Sometimes "solve" is better and sometimes "Solve" is better. Better in the sense that solution that results can be validated by odetest. It all depends on how the RooOf is written as you can see.

Both solve and Solve solutions are correct. But sometimes one form is more friendly to odetest than the other.

 

 

First 7 8 9 10 11 12 13 Last Page 9 of 82