nm

11353 Reputation

20 Badges

13 years, 11 days

MaplePrimes Activity


These are questions asked by nm

in this link   https://maplesoft.com/applications/Preview.aspx?id=123874  there is paper/application 

which is supposed to have Maple package called with(PSsolver);

But when downloading the application (by clicking on the download link) and opening it, it only has one file 

              an_extension_of_prelle-singer_method_and_maple_implementatio.mws

Where will the package (source code) itself PSolver be?  I can't see any other link in the Maple page above to download additional files which might include the package itself.

The worksheet above says this

Before actualy introducing the ideas concerning our program, let us first load it to the Maple section. (Please, put the library file into directory `c:/DirectoryWhereIputtheLibrary`).

I googled and not able to find it also. This was written almost 24 years ago, so trying to contact the author now might not be good idea.

Should not the Maple application be all self contained with all the files needed to run it?

Any one has copy of this package by any chance?

Is there something one can do to make Maple give same result each time? It seems all random.

Calling odetest sometimes gives internal error. 

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

But it is random when and how it happens. Worksheet below shows that sometimes when adding infolevel[odetest]:=5; make the error go away. sometimes trying 2 or 3 times also makes the error go away.

This makes it impossible to reason about things, as sometimes I get different result using same exact code.

Is there something one can do to remove this internal error? Why it happens sometimes only?  Do I need to clear something before calling odetest to make sure same result is obtained each time?

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;

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

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

infolevel[odetest]:=5;

5

odetest(sol,ode);

odetest: Performing an implicit solution test

odetest: Performing an explicit (try hard) solution test

odetest: Performing an implicit solution (II) test

odetest: Performing another explicit (try soft) solution test

0

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

odetest: Performing an implicit solution test

odetest: Performing an explicit (try hard) solution test

odetest: Performing an implicit solution (II) test

odetest: Performing another explicit (try soft) solution test

0

infolevel[odetest]:=0;

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

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

0

Download why_odetest_sometimes_fail_internal.mw

Add tracelast; after an error gives long output with this at end

...
#(\`trig/normal\`,8): sincosargs := [\`trig/normal/sincosargs\`(a)];
 \`trig/normal/sincosargs\` called with arguments: ((-2472*2^(1/2)+3496)*3^(1/2)-4288*2^(1/2)+6064)*(10+7*2^(1/2))^(1/2)+(6008*6^(1/2)-8496*3^(1/2)+10408*2^(1/2)-14720)*cos((1/24)*Pi)
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))
 \`trig/normal/sincosargs\` called with arguments: ((-2472*2^(1/2)+3496)*3^(1/2)-4288*2^(1/2)+6064)*(10+7*2^(1/2))^(1/2)
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))
 \`trig/normal/sincosargs\` called with arguments: (-2472*2^(1/2)+3496)*3^(1/2)-4288*2^(1/2)+6064
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))
 \`trig/normal/sincosargs\` called with arguments: (-2472*2^(1/2)+3496)*3^(1/2)
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))
 \`trig/normal/sincosargs\` called with arguments: -2472*2^(1/2)+3496
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))
 \`trig/normal/sincosargs\` called with arguments: -2472*2^(1/2)
 #(\`trig/normal/sincosargs\`,2): return op(map(procname,{op(x)}))

Not only is it random error, it also can not be cought using try/catch. So the whole program now stop and there is no way around it. If it was at least possible to trap the error, then it will not be a big deal. But when not even possible to trap Maple errors, then what is one to do? 


Update Jan 18, 2025

I did not want to make new post on this, even though the error is different, but it is similar issue to this post.

I found another example of this random failure of odetest using same input.  May be this will help Maplesoft find the cause. 

The internal error this time is Error, (in depends) too many levels of recursion

In this worksheet below. the same ode and 3 solutions were used. As you see, sometimes odetest do not generate internal error, and sometimes it does. All happen on 3rd call to odetest. 

So it is completely random why this happen. The first and 4ht tries generate no error, but the second and the third do. All were run after restart is called. So one would expect same output from each try,

restart;

interface(version);
Physics:-Version();

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

`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.`

First Try

 

ode:=1+y(x)^2+(x-exp(-arctan(y(x))))*diff(y(x),x) = 0;
sol_1:=y(x) = -tan(LambertW(-x/exp(_C1))+_C1);
timelimit(30,odetest(sol_1,ode,y(x)));

sol_2:=x*exp(arctan(y(x)))-arctan(y(x)) = _C1;
timelimit(30,odetest(sol_2,ode,y(x)));

sol_3:=y(x) = tan(-LambertW(-x*exp(_C2))+_C2);
timelimit(30,odetest(sol_3,ode,y(x)));

1+y(x)^2+(x-exp(-arctan(y(x))))*(diff(y(x), x)) = 0

y(x) = -tan(LambertW(-x/exp(_C1))+_C1)

4*LambertW(-x*exp(-c__1))*exp(-I*arctanh(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)-1/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1))+(2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2*x*(1+LambertW(-x*exp(-c__1))))+4*exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2*(1+LambertW(-x*exp(-c__1))))

x*exp(arctan(y(x)))-arctan(y(x)) = c__1

0

y(x) = tan(-LambertW(-x*exp(_C2))+_C2)

Error, (in depends) too many levels of recursion

 

 

 

 

Second Try

 

restart;

ode:=1+y(x)^2+(x-exp(-arctan(y(x))))*diff(y(x),x) = 0;
sol_1:=y(x) = -tan(LambertW(-x/exp(_C1))+_C1);
timelimit(30,odetest(sol_1,ode,y(x)));

sol_2:=x*exp(arctan(y(x)))-arctan(y(x)) = _C1;
timelimit(30,odetest(sol_2,ode,y(x)));

sol_3:=y(x) = tan(-LambertW(-x*exp(_C2))+_C2);
timelimit(30,odetest(sol_3,ode,y(x)));

1+y(x)^2+(x-exp(-arctan(y(x))))*(diff(y(x), x)) = 0

y(x) = -tan(LambertW(-x/exp(_C1))+_C1)

4*exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2*(1+LambertW(-x*exp(-c__1))))+4*LambertW(-x*exp(-c__1))*exp(-I*arctanh(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)-1/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1))+(2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((1+LambertW(-x*exp(-c__1)))*x*(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2)

x*exp(arctan(y(x)))-arctan(y(x)) = c__1

0

y(x) = tan(-LambertW(-x*exp(_C2))+_C2)

4*LambertW(-x*exp(c__2))*exp((2*I)*LambertW(-x*exp(c__2))+(2*I)*c__2+I*arctanh(-exp((2*I)*LambertW(-x*exp(c__2)))/(exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))+exp((2*I)*c__2)/(exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))))/((exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))^2*(1+LambertW(-x*exp(c__2)))*x)+4*exp((2*I)*c__2+(2*I)*LambertW(-x*exp(c__2)))/((exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))^2*(1+LambertW(-x*exp(c__2))))

 

 

 

Third  Try

 

restart;

ode:=1+y(x)^2+(x-exp(-arctan(y(x))))*diff(y(x),x) = 0;
sol_1:=y(x) = -tan(LambertW(-x/exp(_C1))+_C1);
timelimit(30,odetest(sol_1,ode,y(x)));

sol_2:=x*exp(arctan(y(x)))-arctan(y(x)) = _C1;
timelimit(30,odetest(sol_2,ode,y(x)));

sol_3:=y(x) = tan(-LambertW(-x*exp(_C2))+_C2);
timelimit(30,odetest(sol_3,ode,y(x)));

1+y(x)^2+(x-exp(-arctan(y(x))))*(diff(y(x), x)) = 0

y(x) = -tan(LambertW(-x/exp(_C1))+_C1)

4*LambertW(-x*exp(-c__1))*exp(-I*arctanh(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)-1/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1))+(2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((1+LambertW(-x*exp(-c__1)))*x*(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2)+4*exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2*(1+LambertW(-x*exp(-c__1))))

x*exp(arctan(y(x)))-arctan(y(x)) = c__1

0

y(x) = tan(-LambertW(-x*exp(_C2))+_C2)

Error, (in depends) too many levels of recursion

 

 

 

4th  Try

 

restart;

ode:=1+y(x)^2+(x-exp(-arctan(y(x))))*diff(y(x),x) = 0;
sol_1:=y(x) = -tan(LambertW(-x/exp(_C1))+_C1);
timelimit(30,odetest(sol_1,ode,y(x)));

sol_2:=x*exp(arctan(y(x)))-arctan(y(x)) = _C1;
timelimit(30,odetest(sol_2,ode,y(x)));

sol_3:=y(x) = tan(-LambertW(-x*exp(_C2))+_C2);
timelimit(30,odetest(sol_3,ode,y(x)));

1+y(x)^2+(x-exp(-arctan(y(x))))*(diff(y(x), x)) = 0

y(x) = -tan(LambertW(-x/exp(_C1))+_C1)

4*LambertW(-x*exp(-c__1))*exp(-I*arctanh(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)-1/(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1))+(2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((1+LambertW(-x*exp(-c__1)))*x*(exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2)+4*exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)/((exp((2*I)*LambertW(-x*exp(-c__1))+(2*I)*c__1)+1)^2*(1+LambertW(-x*exp(-c__1))))

x*exp(arctan(y(x)))-arctan(y(x)) = c__1

0

y(x) = tan(-LambertW(-x*exp(_C2))+_C2)

4*exp((2*I)*c__2+(2*I)*LambertW(-x*exp(c__2)))/((exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))^2*(1+LambertW(-x*exp(c__2))))+4*LambertW(-x*exp(c__2))*exp((2*I)*LambertW(-x*exp(c__2))+(2*I)*c__2+I*arctanh(-exp((2*I)*LambertW(-x*exp(c__2)))/(exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))+exp((2*I)*c__2)/(exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))))/((exp((2*I)*LambertW(-x*exp(c__2)))+exp((2*I)*c__2))^2*(1+LambertW(-x*exp(c__2)))*x)

 

Download bug_odetest_jan_18_2025.mw

sometimes I need to check if an ode is missing y(x) or not. Since diff(y(x),x) has y(x) in it, then can not just check if the ode has y(x) or not as is, as this will always gives true if diffy(y(x),x) is there of any order.

Currently what I do, is change all y',y'',y''', etc... to Z,Z^2,Z^3,etc... and then after that it is safe to check if y(x) exist or not.

Is there a better way to do this? Below is what I currently do and it works. Just wondering if there could a more elgent way to do this.

restart;

interface(version);

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

ode:=y(x)*diff(y(x),x$2)^2+diff(y(x),x$3)+y(x)*sqrt(diff(y(x),x))+3*x+3=1/(x*y(x)*diff(y(x),x$5));
ode_order := Student:-ODEs:-DifferentialOrder(ode,y(x)):
ode:=convert(ode,D):
for N from 1 to ode_order do
    ode:=eval(ode,[(D@@N)(y)(x)=Z^N]);
od:
ode

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

y(x)*Z^4+Z^3+y(x)*Z^(1/2)+3*x+3 = 1/(x*y(x)*Z^5)

has(ode,y(x))

true

 

 

Download find_if_any_ode_has_yx_jan_6_2025.mw

For plotting phase plot of two system of equations (autonomous), is there an option to increase of reduce number of arrows/line drawn?  I am not able to find such an option from help.

Below is an example. Google AI says stepsize should change the number of arrows, but it does not. It had no effect. Below is worksheet showing one example where I like to reduce number of arrows (not the size of the arrow, which is set to medium now).

I also tried numpoints option and it had no effect of how many arrows are drawn

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

 

 

Download change_number_of_arrows_jan_4_2025.mw

For reference, I'd like to do something similar using another system as below where it has option to change number of arrows.

something I always wondered about. On Maple website it says

Notice the date above., December 26.

On my Maple, with latest update, same version is printed, but the date is way off.

It says December 2, not 26.

Why is that? Should not the date be the same sicne same version 1840 of Physics update?

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

 

 

Download physics_version.mw

First 10 11 12 13 14 15 16 Last Page 12 of 199