nm

11353 Reputation

20 Badges

13 years, 10 days

MaplePrimes Activity


These are replies submitted by nm

@C_R 

I have not tried that. I do not even know now what options and settings I need to change to tell Maple to run/use only one core.

my PC has intel CPU with 16 cores and 24 logical processors. 

I just run Maple/start using whatever defaults it uses on windows 10.

@aroche 

Thanks for the fix. Great job.

But could you please explain to us in terms we could understand, why it was happing at random? This is the part which I do not understand.  

Should not Maple, after a restart behave the same way each time given same input?  You said

             There was a recursion error in `trig/normal` which has now been fixed:

Does Maple uses random number generator somewhere inside trig normal that was causing different behaviour even though the commands were all issued after restart?

I will do more tests, but initial tests shows this bug is fixed. But I need to run it on my main script which takes days to finish to make sure. 

Thanks again for the fix.

@manasp 

opps, thanks,. I did not read help carefully. It is 

           Grid:-Run(node,command,[args])

and not like I did

           Grid:-Run(node,command(args))

Btw, you have to give a node number, If you do not, like you showed, it will run the command on all nodes. I have 26 logical cores, so it solved it 26 times, in parallel.

So this is what I changed it to and now it worked

restart;

P:=[diff(x(t),t)=t*x(t)-y(t)+exp(t)*z(t),diff(y(t),t)=2*x(t)+t^2*y(t)-z(t),diff(z(t),t)=exp(-t)*x(t)+3*t*y(t)+t^3*z(t)]:

Grid:-Run(0,dsolve,[P],'assignto'='ans1'); #result of dsolve in ans1
Grid:-Wait();
ans1

And now it gives same answer as not using Grid.

@dharr 

Thanks, I was using link that google search gave and I did not know I landed on a "review" page of the application and that there was a "main" page also with more download links. 

if you have access to google AI, you can type this. It even gives code

 

ps. I assume code works. I did not try it.

@C_R 

fyi, I found another example of this random behaviour. I also tried your forget(all) before each call to odetest, but it had no effect.

Also this time the error is not related to sincos, but new one related to  too many levels of recursion.  But the common thing, is that it is also random.

In Maple 2024.2 on windows, it returns unevaluated. So there is no bug. Returning unevaluated is not a bug.

May be you are using older version of Maple and this was fixed?

interface(version)

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

int(cos(cos(x)),x=0..2*Pi)

int(cos(cos(x)), x = 0 .. 2*Pi)

evalf(int(cos(cos(x)),x=0..2*Pi))

4.807878861

evalf(2*Pi*BesselJ(0, 1))

4.807878862

int(cos(cos(x)),x=0..Pi)

Pi*BesselJ(0, 1)

int(cos(cos(x)),x=Pi..2*Pi)

int(cos(cos(x)), x = Pi .. 2*Pi)

 

 

Download no_bug_jan_14_2025.mw

@dharr 

thanks for confirming. I am sorry you had to reboot your pc. hope you did not lose any work. For me, CTRL-ALT-DEL then using task manager I was able to kill the whole Maple program. But I am using windows 10 pro. Not windows 11, may be this makes difference.

@Christian Wolinski 

The output solution was generated by a program.

But I am confused by your answer. You have given a workaround. Sure. A nice workaround also. But it is a workaround and does not explain what is going on.

Or are you saying or implying that because the user did not simplify the input as well as they could have, then Maple now is allowed to give different responses for same input or behave differently for same input?

How could this be possible?

@C_R 

Needs to be reported, IMO

The problem is that it is random. sometimes it happens and sometimes not. I've send bug reports before where I get reply they can't reproduce it, because tech support tries once and if they can't reproduce it, they will not enter it.

Here is worksheet, where I started Maple fresh, and had to do many trials to get this internal error to come up.

It seems Maple uses some random number generator to do something internally.  I can't explain this. Maple is the only CAS software I know where I can get different results running the same exact code.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

sol:=y(x) = 1/2*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*
2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+
I)^2)/((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)/(I*2^(1/2)+I);
ode:=x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*diff(y(x),x) = 0;

y(x) = (1/2)*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+I)^2)/(((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)*(I*2^(1/2)+I))

x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*(diff(y(x), x)) = 0

odetest(sol,ode,y(x));

0

odetest(sol,ode);

0

odetest(sol,ode);

0

odetest(sol,ode);

0

odetest(sol,ode,y(x));

0

odetest(sol,ode);

0

sol:=y(x) = 1/2*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*
2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+
I)^2)/((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)/(I*2^(1/2)+I);
ode:=x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*diff(y(x),x) = 0;

y(x) = (1/2)*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+I)^2)/(((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)*(I*2^(1/2)+I))

x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*(diff(y(x), x)) = 0

odetest(sol,ode,y(x));

0

restart;

sol:=y(x) = 1/2*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*
2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+
I)^2)/((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)/(I*2^(1/2)+I);
ode:=x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*diff(y(x),x) = 0;

y(x) = (1/2)*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+I)^2)/(((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)*(I*2^(1/2)+I))

x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*(diff(y(x), x)) = 0

odetest(sol,ode,y(x));

Error, (in trig/normal/sincosargs) too many levels of recursion

odetest(sol,ode,y(x));

Error, (in trig/normal/sincosargs) too many levels of recursion

restart;

sol:=y(x) = 1/2*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*
2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+
I)^2)/((I*2^(1/2)-1+I)*(I*2^(1/2)+1+I)^2)^(1/3)/(I*2^(1/2)+I);
ode:=x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*diff(y(x),x) = 0;

y(x) = (1/2)*x*(-1-(1+I*3^(1/2))*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(2/3)-2*((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)-I*((I*2^(1/2)+I)^2-1)*3^(1/2)+(I*2^(1/2)+I)^2)/(((I*2^(1/2)+(-1+I))*(I*2^(1/2)+1+I)^2)^(1/3)*(I*2^(1/2)+I))

x^3+3*x*y(x)^2+(y(x)^3+3*x^2*y(x))*(diff(y(x), x)) = 0

odetest(sol,ode,y(x));

0

 

 

Download why_odetest_sometimes_fail_internal_V2.mw

But I will send this report now to Maple tech support. Even though I am sure I will get reply that they can't reproduce it.

@acer 

Yes, this works! when I did convert(ode,D) I saw the output has (y)(x) and my eyes saw it as y(x) so I did not bother using has(..,y(x)) on it as I thought it will also return true. I should have tried it.    

Now I can get rid of the loop as not needed.

Thanks

@gkokovidis 

Thanks. I tried it, but it does not do what I want. Examples below. It seems dirfield=n means n arrows, and not n lines.

I want to change the number of field lines as in examples I showed using the other system. Not number or arrows.

So I am not able to get same effect as the other systems. Below are examples changing dirfield.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

the_sys:=[diff(x(t),t) = -3*x(t)-4*y(t), diff(y(t),t) = 2*x(t)+y(t)]:
DEtools:-DEplot(the_sys,[x(t), y(t)],t =0 .. 10,x = -4 .. 4,y = -4 .. 4,'labels' = [x(t),y(t)],'axes' = 'boxed', 'arrows'='medium','dirfield'=5)

DEtools:-DEplot(the_sys,[x(t), y(t)],t =0 .. 10,x = -4 .. 4,y = -4 .. 4,'labels' = [x(t),y(t)],'axes' = 'boxed', 'arrows'='medium','dirfield'=50)

DEtools:-DEplot(the_sys,[x(t), y(t)],t =0 .. 10,x = -4 .. 4,y = -4 .. 4,'labels' = [x(t),y(t)],'axes' = 'boxed', 'arrows'='medium','dirfield'=300)

 

 

Download change_number_of_arrows_dirfield_jan_4_2025.mw

I've seen this error before myself few times. Not many, may be dozen times over the years.

I could never figure where it comes from. 

If I am reading this right, your ode (which you called pde2), which is equation (7) is second order non-linear ode, right? 

But the solution you are trying to verify (eq (8)) has only one constant of integration c__1, right?

But there should be two constants of integrations, since second order.

@Christian Wolinski 

without the wait, it seems to hang. Did it work for you? Here is a work sheet. Nothing happens, and I when hit restart, nothing happens. It seems to be stuck inside thread. Added print after calling dsolve and nothing is printed.

I think Wait is needed to wait for threads, otherwise how does one know they are finished?

I have to close the whole worksheet to run it again. You can try this and see if you get better result. I am on windows 10.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

restart;

g_list:=[sin(t)*diff(x(t),t$2)+cos(t)*diff(x(t),t)+2*x(t)=0,
         diff(y(x),x)=lambda*sin(lambda*x)*y(x)^2+a*cos(lambda*x)^n*y(x)-a*cos(lambda*x)^(n-1)]:

work_func:=proc(i::posint)  
  local sol;
  print("i=",i);
  sol:=dsolve(g_list[i]);
  print("sol is ",sol);
end proc:

Threads:-Seq( Threads:-Create( work_func(i)), i=1..2) ;

"i=", 2

"i=", 1

24, 25

1+1; #no answer

 

 

Download thread_seq.mw

First 8 9 10 11 12 13 14 Last Page 10 of 91