nm

7930 Reputation

19 Badges

11 years, 68 days

MaplePrimes Activity


These are questions asked by nm

I found another big problem. 

In 2022, I get Error, (in SolveTools:-Polynomial) too many levels of recursion when using alias(seq(c[k] = _C||k, k = 0..10)); at the top of my code and the solution to the ode has c[2],c[3] etc.. as constants of integration.

This solution was given by Kitonum in this answer

I had this for years in the code (i.e. the alias) code.

In Maple 2022 the following gives the above exception error from odetest. I am using 2022, because in 2023 it just hangs on the same code.  

If I remove the alias code, no error shows. (solution is wrong, but that is different story). 

Also, If I remove the alias code, 2023 no long hangs!  

restart;

#kernelopts('assertlevel'=2):

alias(seq(c[k] = _C||k, k = 0..10));

c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10]

ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+12*y(x) = 80*sin(2*x);
sol:=y(x) = -10*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*((-1/10*exp(4*I*2^(1/2)*x)+1/10)*c[2]-1/10*I*c[3]*exp(4*I*2^(1/2)*x)-1/10*I*c[3])/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3])*c[1]-10*I*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*(cos(2*x)-sin(2*x))*exp(2*I*2^(1/2)*x)*exp(2*I*2^(1/2)*x)^(-1/2*I*2^(1/2))/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3]);

odetest(sol,ode);

diff(diff(y(x), x), x)+4*(diff(y(x), x))+12*y(x) = 80*sin(2*x)

y(x) = -10*exp(-(1/2)*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*((-(1/10)*exp((4*I)*2^(1/2)*x)+1/10)*c[2]-((1/10)*I)*c[3]*exp((4*I)*2^(1/2)*x)-((1/10)*I)*c[3])*c[1]/((exp((4*I)*2^(1/2)*x)-1)*c[2]+I*c[3]*exp((4*I)*2^(1/2)*x)+I*c[3])-(10*I)*exp(-(1/2)*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*(cos(2*x)-sin(2*x))*exp((2*I)*2^(1/2)*x)*(exp((2*I)*2^(1/2)*x))^(-((1/2)*I)*2^(1/2))/((exp((4*I)*2^(1/2)*x)-1)*c[2]+I*c[3]*exp((4*I)*2^(1/2)*x)+I*c[3])

Error, (in SolveTools:-Polynomial) too many levels of recursion

 

Download odetest_error_june_15_2023.mw

Why using the alias line above causes this error?  If you remove the alias line, you will see it completes with no error.

But it hangs in 2023. I am no longer using 2023 but went back to 2022 due to too many hangs in 2023. I wonder now if it because of this alias line I had there all the time.  I will remove now and see if this solves some of the hangs I had in 2023.

Anyone can shed some more light on what is going on?

Windows 10.

I can't figure how to obtain list of all modules inside my .mla file.

I can see all the modules using the command LibraryTools:-Browse("..../my_file.mla") then clicking EDIT then VIEW option at top right corner.  Member type is automatically set to MODULE in the lower left corner. So I can see the names of all the modules. And using the slider, I can scrol down. I see 73 modules listed.

But I want to do this in code. Not using GUI.

I tried the command

          L:=LibraryTools:-ShowContents(my_file.mla):

And this gives L of lenght 15805. Looking at each entry in the above list, it shows things I do not understand and I do not want. It has names in there which I do not know where these came from.

There does not seem to be an option in LibraryTools:-ShowContents() to only return the names of the modules inside .mla. At least I can't find such option.

reference Maple help page

Any idea how to do this in code? Not using the maplet? 

Maple 2022 on windows 10

ps. I know I can use the GUI and do EXTRACT to save the list to a file. But this is not good solution. I need the list of names of the modules be in a list so I can do this all in a function with no manual steps.

Does Maple have a command to list all names of all procs (local and exported) given a name of module?

There is a question/answer here which shows how to list all procs in module. But I only want the names.

The reason I am asking, I am trying to see if I can code 

     trace(moduleA:-proc1,
               moduleA:-proc2,
               moduleB:-proc3,....,
               moduleE:-proc1000,
               statements = false)

Before running my programming in order to turn tracing on. The problem is that there are 1,000's of proc's in dozens of modules so I need a way to obtain a sequence of the names all such procs automatically each time.

Once I figure how to do it for one module (say moduleA), I will apply this to the other modules I have and collect all names in one long sequence and see if this will work.

Any suggestion how to do this?  I now have all my modules inside one .mla file if it helps. They are all build ito this .mla from source tree of dozens of .mpl files.

Maple 2022 on windows 10

When adding option trace: inside a proc, Maple display trace of all assignments. I only want to see the --> enter  and <-- exit messages,.

I can't figure how to do that. Any suggestions? 

Maple 2022 on windows

restart;

A := module()
 export foo:=proc(n,m,k)   
   option trace:
   local r;

   r:=n:
   B:-boo(r);
 end proc:
end module:
B := module()
 export boo:=proc(n)
   option trace:
   local k;

   k:=n;
   RETURN();
 end proc:
end module:

#kernelopts(tracelineinfo=2);
#printlevel := 10:
kernelopts(traceincidentalassign=false):
kernelopts(tracesplitmulassign=false):
kernelopts(traceshowspecassign=false):
kernelopts(traceincidentalassign=false):
kernelopts(tracesplitmulassign=false):
kernelopts(traceshowspecassign=false):
kernelopts(tracelineinfo=0):
A:-foo(1,2,diff(y(x),x)=sin(x))

{--> enter foo, args = 1, 2, diff(y(x), x) = sin(x)

1

{--> enter boo, args = 1

1

<-- exit boo (now in foo) = }

<-- exit foo (now at top level) = }

 

Download trace_june_14_2023.mw

Any workaround for this serious error in Maple 2023? Is this new bug? The problem is can't be cought so whole program crashes. Is this related to the new changes made in 2023 to simplification of of trig functions?

restart;

711624

interface(version);

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1463. The version installed in this computer is 1462 created 2023, June 10, 2:26 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

expr:=-1/7-(-1/7*I*7^(5/7)*exp(2/7*I*Pi)*sin(1/7*Pi)-1/7*cos(1/7*Pi)*7^(5/7)*exp(2/7*I*Pi))^(7/2);
simplify(expr);

-1/7-(-((1/7)*I)*7^(5/7)*exp(((2/7)*I)*Pi)*sin((1/7)*Pi)-(1/7)*cos((1/7)*Pi)*7^(5/7)*exp(((2/7)*I)*Pi))^(7/2)

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

 

Download simplify_error_june_13_2023.mw

Update

I just tried it in 2022, and it completes instantly with no error.

interface(version)

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

expr:=-1/7-(-1/7*I*7^(5/7)*exp(2/7*I*Pi)*sin(1/7*Pi)-1/7*cos(1/7*Pi)*7^(5/7)*exp(2/7*I*Pi))^(7/2);
simplify(expr);

-1/7-(-((1/7)*I)*7^(5/7)*exp(((2/7)*I)*Pi)*sin((1/7)*Pi)-(1/7)*cos((1/7)*Pi)*7^(5/7)*exp(((2/7)*I)*Pi))^(7/2)

-1/7-(1/7)*(-(-1)^(3/7))^(1/2)*(-1)^(2/7)

 

Download simplify_ok_2022.mw

1 2 3 4 5 6 7 Last Page 1 of 153