MaplePrimes Questions

my program which reads random problems, read one large one. This cause plot to fail with internal error. 

I this known issue?

The expression is too large to post here, so I will only attach worksheet without displaying the actual ff function.

V 2023 on windows 10.

bug_plot_may_29_2023.mw

is this known limitation?

restart;
s:="regular";
MmaTranslator:-FromMma(s);
MmaTranslator:-Mma:-LeafCount(s);

Error, (in MmaTranslator:-Mma:-LeafCount) too many levels of recursion

V 2023 on windows.

1021448

restart;

1021448

s:="regular";
MmaTranslator:-FromMma(s);

"regular"

regular

MmaTranslator:-Mma:-LeafCount(s);

Error, (in MmaTranslator:-Mma:-LeafCount) too many levels of recursion

 

Download crash_leafcount_may_29_2023.mw

For reference, it should have leafcount of 1

Update

Here is another way to cause this error 

124672

expr:=Sum((n+r)*a[n]*x^(n+r-1),n = 0 .. infinity)+(-1-1/x)*Sum(a[n]*x^(n+r),n = 0 .. infinity) = 0;
MmaTranslator:-Mma:-LeafCount(expr);
length(expr);

Sum((n+r)*a[n]*x^(n+r-1), n = 0 .. infinity)+(-1-1/x)*(Sum(a[n]*x^(n+r), n = 0 .. infinity)) = 0

41

148

expr:=Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("1"),Typesetting:-mo("⋅"),Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mstyle(Typesetting:-mo("∑",Typesetting:-msemantics = "inert")),Typesetting:-mrow(Typesetting:-mi("n"),Typesetting:-mo("="),Typesetting:-mn("0")),Typesetting:-mi("∞")),Typesetting:-mo("⁡"),Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi("a"),Typesetting:-mi("n")),Typesetting:-mo("⁢"),Typesetting:-msup(Typesetting:-mi("x"),Typesetting:-mrow(Typesetting:-mi("n"),Typesetting:-mo("+"),Typesetting:-mi("r"))))))),Typesetting:-_Hold([1 %* Sum(a[n]*x^(n+r),n = 0 .. infinity)])),Typesetting:-mo("−"),Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mi("x")),Typesetting:-mo("⋅"),Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mstyle(Typesetting:-mo("∑",Typesetting:-msemantics = "inert")),Typesetting:-mrow(Typesetting:-mi("n"),Typesetting:-mo("="),Typesetting:-mn("0")),Typesetting:-mi("∞")),Typesetting:-mo("⁡"),Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi("a"),Typesetting:-mi("n")),Typesetting:-mo("⁢"),Typesetting:-msup(Typesetting:-mi("x"),Typesetting:-mrow(Typesetting:-mi("n"),Typesetting:-mo("+"),Typesetting:-mi("r"))))))),Typesetting:-_Hold([(1/x) %* Sum(a[n]*x^(n+r),n = 0 .. infinity)])));

Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("1"), Typesetting:-mo("⋅"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mstyle(Typesetting:-mo("∑", Typesetting:-msemantics = "inert")), Typesetting:-mrow(Typesetting:-mi("n"), Typesetting:-mo("="), Typesetting:-mn("0")), Typesetting:-mi("∞")), Typesetting:-mo("⁡"), Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi("a"), Typesetting:-mi("n")), Typesetting:-mo("⁢"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mrow(Typesetting:-mi("n"), Typesetting:-mo("+"), Typesetting:-mi("r"))))))), Typesetting:-_Hold([`%*`(1, Sum(a[n]*x^(n+r), n = 0 .. infinity))])), Typesetting:-mo("−"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mi("x")), Typesetting:-mo("⋅"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mstyle(Typesetting:-mo("∑", Typesetting:-msemantics = "inert")), Typesetting:-mrow(Typesetting:-mi("n"), Typesetting:-mo("="), Typesetting:-mn("0")), Typesetting:-mi("∞")), Typesetting:-mo("⁡"), Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi("a"), Typesetting:-mi("n")), Typesetting:-mo("⁢"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mrow(Typesetting:-mi("n"), Typesetting:-mo("+"), Typesetting:-mi("r"))))))), Typesetting:-_Hold([`%*`(1/x, Sum(a[n]*x^(n+r), n = 0 .. infinity))])))

MmaTranslator:-Mma:-LeafCount(expr);

Error, (in MmaTranslator:-Mma:-LeafCount) too many levels of recursion

length(expr)

863

 

Download crash_leafcount_V2_may_29_2023.mw

in V 2023 on windows, I can get server.exe to crash each time on this call. Do others see the same problem? I have not tried this on V 2022 to see if this new bug or not.

make sure to save ALL your work before trying this. I found Maple itself hangs also after the server.exe crash, so might not be able to save any work you have in your worksheets that are open at the time. 

I do not know if there is a workaround this. Does the program need to check for something to make sure it will not crash Maple before using this function? try/catch does not help with this. So now my program simply crash each time when it reads this problem.

restart;


expr:=1/(3*2^(2/3)*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)+3*(1/(1+(256*u^3+1)^(1/2))^(1/3)*((8*2^(1/6)*u-2^(1/2)*(1+(256*u^3+1)^(1/2))^(2/3))*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)-4*2^(1/6)*(1+(256*u^3+1)^(1/2))^(1/3))/((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2))^(1/2)*2^(7/12)-16*u);


rationalize(expr);

Attached worksheet.
 

433648

interface(version);

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

restart;

433648

expr:=1/(3*2^(2/3)*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)+3*(1/(1+(256*u^3+1)^(1/2))^(1/3)*((8*2^(1/6)*u-2^(1/2)*(1+(256*u^3+1)^(1/2))^(2/3))*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)-4*2^(1/6)*(1+(256*u^3+1)^(1/2))^(1/3))/((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2))^(1/2)*2^(7/12)-16*u);

1/(3*2^(2/3)*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)+3*(((8*2^(1/6)*u-2^(1/2)*(1+(256*u^3+1)^(1/2))^(2/3))*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)-4*2^(1/6)*(1+(256*u^3+1)^(1/2))^(1/3))/((1+(256*u^3+1)^(1/2))^(1/3)*((2^(1/3)*(1+(256*u^3+1)^(1/2))^(2/3)-8*u)/(1+(256*u^3+1)^(1/2))^(1/3))^(1/2)))^(1/2)*2^(7/12)-16*u)

rationalize(expr);

Download crash_may_28_2023.mw

 hi,

 Does anyone know why my code is not running?

 eqs.mw

I am using this command: plotsetup(png, plotoutput = "titleofmylistofplots", plotoptions = "width=1920,height=1080")

in the execution block right before a sequence of split execution blocks, each made of plots:-display( seq( plot( [$ 20], series1of8[1..20,j], color=cols1[j]), j=1..3)); (I have 8 series: series1of8, series2of8, series3of8 and so on...)

When I open the output .png file, it only contains the last plot, that is the plot of series8of8. I want my file to contain all 8 plots. How to change the plotsetup() command accordingly?

My program simply keeps hanging.

It takes me 5 days to complete something which should take 2-3 hrs, since Maple keeps hanging, and I have to keep terminating server.exe and start again. Sometimes when I start again it does not hang where it was. I do this dozens of time per day.

even though I use timelimit on every possible Maple call. The problem also is that when timelimit works, it takes 10-20 times more time than asked. I ask for 10 second timeout, sometimes it timesout after 3-10 minutes if I am lucky.

So I keep trying to make workarounds and I am tired of all of this. Just waste of time. This is getting worst with each new Maple release not better.

Here is an example

restart;
expr:=-1/3*2^(2/3)/((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*((-1/2*a^2*p-1/2*p^2*a+1/2*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*a-3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+2^(2/3)*(-(a+3/2*p)*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a^2*p+5/2*p^2*a+3/2*p^3+3)*p)/(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p)/(-1/2*2^(2/3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+p*(p*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(1/3)+2^(1/3)))/p^2;

try 
    t0:=time[real]();
    timelimit(20,int(expr,p));
catch:
    print("time used ",time[real]()-t0,"seconds");
    print("timed out");
end try;

in Maple 2023, with 128 GB RAM and very fast PC and nothing else is running, it hangs. I could leave it for hrs, the server.exe  is running at full CPU and timelimit is ignored. Timelimit in Maple is useless.

I do not know what else to do. if someone can suggest something, I am willing to try anything before I finally give up.

 

For the function coulditbe it says

The environment variable _EnvTry can be used to specify the intensity of the testing by the is and coulditbe routines. Currently _EnvTry can be set to normal (the default) or hard. If _EnvTry is set to hard, is and coulditbe calls can take exponential time.

But how does one know the current value of _EnvTry which is supposed to be set to normal.? If I do   _EnvTry it does not show any value.  And when I do 

anames('environment');
anames('environment','active');

I do not see _EnvTry even listed.  I wanted to make sure I am setting it correctly.

Is it enough to do this?

 

foo:=proc()
 _EnvTry:='hard';
  #now use coulditbe, it should use hard value?
  #coulditbe(....)
end proc;

foo();

Would the above actually tell coulditbe to try hard? I wanted to use this inside a proc without affecting any global setting it might have. It is not possible to tell by just calling it if it actually using the hard option or not.

I do not think I am setting this right, I just tried

foo:=proc()
 _EnvTry:='hard';
 _EnvTry:='XXXX';
  #now use coulditbe, it should use hard value?
  coulditbe(1=2)
end proc;

And it did not complain or anything. Any value I put seems to work. I must be not setting this correctly as coulditbe does not complain.

I wish help would give example usages. But Maple help is not good at all as it has no usage examples to help users.

btw, I think the use of environment variables is bad in programming.

Each function should instead accept options as argument and one should set an option explictly.  So coulditbe should have an explicit optional argument to pass it. This makes the code more clear when looking at the call also.

Programming environment variables are just like global variables.

Bad way to program as in large program one can lose track of these settings.

I have FORTRAN namelist files, that have the form like

<space>&namelist_name

<space>varName1=0.600

<space>varName2=123

<space>varName3=345.0

<space>&end

In these files there are no blank lines as automatically put in above,

The goal is to read such files into Maple and have the same varNames created in Maple to be names/symbols with the values shown in the FORTRAN file assigned to those Maple names. In other words, Maple should then have

varName1 := 0.600:

varName2 := 123:

varName3 := 345.0:

This would enable the Maple to use these variables in the usual way to make calculations, etc.

I know how to read the FORTRAN files and get the varNames and values into two separate Maple tables, but I haven't found a way to then make the Maple assignments that are required. There must be a way to accomplish the goal.

Thank you for any suggestions.

      --- Mike

Write a Maple procedure called "matricediag" which takes as input a square matrix M of m rows and m columns and which returns The smallest element below the main diagonal and its position.

When I look for petrov type II vacuum solutions in the Metric search, one of the metrics i get is Stephani [33,8,3].

But when I load the metric and calculate the Ricci or the Einstein tensor, they are not identically zero.
Am I using the metric search wrong or is there a glitch in the program?

Download Temp.mw

Let  denote the factors of the "absolute factorization" of the following bivariate polynomial (i.e., ): 

p := product(x^3*k^2 + (x*(y + 2) + 2)*k - x^3 + y^3 + y + 1, k = RootOf(_Z^3 + _Z + 1)):
f__0 := (evala@AFactors)(p)[2, .., 1]; # Assume that we do not know the extension field in advance.

It is unfortunate that the output is not easy to read, so I have to simplify it here. However, it appears that none of the results (i.e., , , and ) is eminently readable. 
 

restart;

p := product(x^3*(k^2-1)+(x*(y+2)+2)*k+y^3+y+1, k = RootOf(_Z^3+_Z+1))

-3*x^9+8*x^6*y^3-5*x^3*y^6+y^9-4*x^7*y+3*x^4*y^4-8*x^7+8*x^6*y-x^5*y^2+6*x^4*y^3-10*x^3*y^4+x^2*y^5+3*y^7-4*x^5*y+3*x^4*y^2-5*x^3*y^3+4*x^2*y^4+3*y^6-4*x^5+5*x^4*y-11*x^3*y^2+5*x^2*y^3+4*x*y^4+3*y^5-2*x^4-16*x^3*y-x^2*y^2+8*x*y^3+6*y^4-11*x^3-16*x^2*y+4*x*y^2+8*y^3-20*x^2+3*y^2-16*x+7*y-3

(1)

f__0 := (`@`(evala, AFactors))(p)[2, () .. (), 1]

[x^3+((-(106/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+1486/3267+(1/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2)*y+2972/3267-(212/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(2/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2)*x+(-(4/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2-3040/3267+(61/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*y^3+(-(4/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2-3040/3267+(61/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*y-68/3267-(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(2/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2, x^3+(((106/3267)*RootOf(10501+_Z^3+51*_Z)+(106/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+1486/3267+(1/3267)*(-RootOf(10501+_Z^3+51*_Z)-RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))^2)*y+2972/3267+(212/3267)*RootOf(10501+_Z^3+51*_Z)+(212/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(2/3267)*(-RootOf(10501+_Z^3+51*_Z)-RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))^2)*x+(-(4/3267)*(-RootOf(10501+_Z^3+51*_Z)-RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))^2-3040/3267-(61/3267)*RootOf(10501+_Z^3+51*_Z)-(61/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*y^3+(-(4/3267)*(-RootOf(10501+_Z^3+51*_Z)-RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))^2-3040/3267-(61/3267)*RootOf(10501+_Z^3+51*_Z)-(61/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*y-68/3267+(151/3267)*RootOf(10501+_Z^3+51*_Z)+(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(2/3267)*(-RootOf(10501+_Z^3+51*_Z)-RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))^2, x^3+((-(106/3267)*RootOf(10501+_Z^3+51*_Z)+1486/3267+(1/3267)*RootOf(10501+_Z^3+51*_Z)^2)*y+2972/3267-(212/3267)*RootOf(10501+_Z^3+51*_Z)+(2/3267)*RootOf(10501+_Z^3+51*_Z)^2)*x+(-(4/3267)*RootOf(10501+_Z^3+51*_Z)^2-3040/3267+(61/3267)*RootOf(10501+_Z^3+51*_Z))*y^3+(-(4/3267)*RootOf(10501+_Z^3+51*_Z)^2-3040/3267+(61/3267)*RootOf(10501+_Z^3+51*_Z))*y-68/3267-(151/3267)*RootOf(10501+_Z^3+51*_Z)-(2/3267)*RootOf(10501+_Z^3+51*_Z)^2]

(2)

f__1 := evala(f__0)

[34/3267-(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(2/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)+(2/3267)*RootOf(10501+_Z^3+51*_Z)^2+(2870/3267)*x-(212/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(2/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)-(2/3267)*x*RootOf(10501+_Z^3+51*_Z)^2-(2836/3267)*y+(61/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(4/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)+(4/3267)*y*RootOf(10501+_Z^3+51*_Z)^2+(1435/3267)*x*y-(106/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(1/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)-(1/3267)*x*y*RootOf(10501+_Z^3+51*_Z)^2+x^3-(2836/3267)*y^3+(61/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(4/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)+(4/3267)*y^3*RootOf(10501+_Z^3+51*_Z)^2, x^3+(106/3267)*x*y*RootOf(10501+_Z^3+51*_Z)+(106/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1435/3267)*x*y+(1/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)+(2870/3267)*x+(212/3267)*x*RootOf(10501+_Z^3+51*_Z)+(212/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(2/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)-(4/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)-(2836/3267)*y^3-(61/3267)*y^3*RootOf(10501+_Z^3+51*_Z)-(61/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(4/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z)-(2836/3267)*y-(61/3267)*y*RootOf(10501+_Z^3+51*_Z)-(61/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+34/3267+(151/3267)*RootOf(10501+_Z^3+51*_Z)+(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(2/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)*RootOf(10501+_Z^3+51*_Z), x^3-(106/3267)*x*y*RootOf(10501+_Z^3+51*_Z)+(1486/3267)*x*y+(1/3267)*x*y*RootOf(10501+_Z^3+51*_Z)^2+(2972/3267)*x-(212/3267)*x*RootOf(10501+_Z^3+51*_Z)+(2/3267)*x*RootOf(10501+_Z^3+51*_Z)^2-(4/3267)*y^3*RootOf(10501+_Z^3+51*_Z)^2-(3040/3267)*y^3+(61/3267)*y^3*RootOf(10501+_Z^3+51*_Z)-(4/3267)*y*RootOf(10501+_Z^3+51*_Z)^2-(3040/3267)*y+(61/3267)*y*RootOf(10501+_Z^3+51*_Z)-68/3267-(151/3267)*RootOf(10501+_Z^3+51*_Z)-(2/3267)*RootOf(10501+_Z^3+51*_Z)^2]

(3)

f__2 := simplify(f__0, size)

[(1/3267)*(-4*y^3+(-4+x)*y-2+2*x)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2+(1/3267)*(61*y^3+(61-106*x)*y-151-212*x)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(3040/3267)*y^3+(1/3267)*(1486*x-3040)*y+x^3-68/3267+(2972/3267)*x, (1/3267)*(-4*y^3+(-4+x)*y-2+2*x)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)^2+(1/3267)*((-8*y^3+(-8+2*x)*y-4+4*x)*RootOf(10501+_Z^3+51*_Z)-61*y^3+(106*x-61)*y+212*x+151)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1/3267)*(-4*y^3+(-4+x)*y-2+2*x)*RootOf(10501+_Z^3+51*_Z)^2+(1/3267)*(-61*y^3+(106*x-61)*y+212*x+151)*RootOf(10501+_Z^3+51*_Z)-(3040/3267)*y^3+(1/3267)*(1486*x-3040)*y+x^3-68/3267+(2972/3267)*x, (1/3267)*(-4*y^3+(-4+x)*y-2+2*x)*RootOf(10501+_Z^3+51*_Z)^2+(1/3267)*(61*y^3+(61-106*x)*y-151-212*x)*RootOf(10501+_Z^3+51*_Z)-(3040/3267)*y^3+(1/3267)*(1486*x-3040)*y+x^3-68/3267+(2972/3267)*x]

(4)

f__3 := simplify(f__0, RootOf)

[34/3267-(2836/3267)*y^3+(61/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(2870/3267)*x-(106/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(2836/3267)*y+(61/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1435/3267)*x*y+x^3-(212/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1/3267)*(-x*y-2*x+4*y^3+4*y+2)*RootOf(10501+_Z^3+51*_Z)^2+(1/3267)*(-2*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+2*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+4*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+4*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*RootOf(10501+_Z^3+51*_Z), x^3-(61/3267)*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(151/3267)*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1435/3267)*x*y+34/3267+(2870/3267)*x-(2836/3267)*y^3-(2836/3267)*y+(106/3267)*x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(212/3267)*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-(61/3267)*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+(1/3267)*(-61*y-61*y^3+151+2*x*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+106*x*y-4*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)-4*y^3*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+x*y*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2)+212*x-2*RootOf(_Z^2+_Z*RootOf(10501+_Z^3+51*_Z)+51+RootOf(10501+_Z^3+51*_Z)^2))*RootOf(10501+_Z^3+51*_Z), x^3+((-(106/3267)*RootOf(10501+_Z^3+51*_Z)+1486/3267+(1/3267)*RootOf(10501+_Z^3+51*_Z)^2)*y+2972/3267-(212/3267)*RootOf(10501+_Z^3+51*_Z)+(2/3267)*RootOf(10501+_Z^3+51*_Z)^2)*x+(-(4/3267)*RootOf(10501+_Z^3+51*_Z)^2-3040/3267+(61/3267)*RootOf(10501+_Z^3+51*_Z))*y^3+(-(4/3267)*RootOf(10501+_Z^3+51*_Z)^2-3040/3267+(61/3267)*RootOf(10501+_Z^3+51*_Z))*y-68/3267-(151/3267)*RootOf(10501+_Z^3+51*_Z)-(2/3267)*RootOf(10501+_Z^3+51*_Z)^2]

(5)

Unfortunately, none of f__0, f______1__, f__2, and f______3__ is very readable.
It can be proved that the following one is also the factors.

f__4 := [x^3 + RootOf(3*_Z^3 - 4*_Z^2 + _Z - 1, index = 3)*(x*(y + 2) + 2) + RootOf(3*_Z^3 + 8*_Z^2 + 5*_Z + 1, index = 3)*(y^3 + y + 1), x^3 + RootOf(3*_Z^3 - 4*_Z^2 + _Z - 1, index = 2)*(x*(y + 2) + 2) + RootOf(3*_Z^3 + 8*_Z^2 + 5*_Z + 1, index = 1)*(y^3 + y + 1), x^3 + RootOf(3*_Z^3 - 4*_Z^2 + _Z - 1, index = 1)*(x*(y + 2) + 2) + RootOf(3*_Z^3 + 8*_Z^2 + 5*_Z + 1, index = 2)*(y^3 + y + 1)];

evala(p+3*`?()`(`*`, f__4))NULL

[x^3+RootOf(3*_Z^3-4*_Z^2+_Z-1, index = 3)*(x*(y+2)+2)+RootOf(3*_Z^3+8*_Z^2+5*_Z+1, index = 3)*(y^3+y+1), x^3+RootOf(3*_Z^3-4*_Z^2+_Z-1, index = 2)*(x*(y+2)+2)+RootOf(3*_Z^3+8*_Z^2+5*_Z+1, index = 1)*(y^3+y+1), x^3+RootOf(3*_Z^3-4*_Z^2+_Z-1, index = 1)*(x*(y+2)+2)+RootOf(3*_Z^3+8*_Z^2+5*_Z+1, index = 2)*(y^3+y+1)]

 

0

(6)

`~`[length]([f__ || (0 .. 4)])

[3858, 4389, 1410, 3608, 513]

(7)

`~`[MmaTranslator:-Mma:-LeafCount]([f__ || (0 .. 4)])

[935, 1047, 391, 881, 166]

(8)

As you can see, f__4 is of lower mathematical complexity.


 

Download fully_simplify_f_0.mw

The  above (whose "size" is smaller) comes from manual simplification, but this is not a easy work. Is there a way to get the much simplified result programmatically?

I am not able to make a MWE for this error, as it only shows in the debugger. So it seems Maple internal memory changes or some other library is loaded to cause this. Inside the debugger, I get to a function which does this

DBG> simplify(JacobiDN(x,k)^2*n)

Error, invalid input: simplify/Jacobi/JacobiDN expects its 1st argument, k, to be of type posint, but received 0

Version 2023 on windows 10

In a worksheet, the above works just fine

restart;
simplify(JacobiDN(x,k)^2*n)

Back to the debugger, if I write (2*n) instead of 2*n, then the error goes away

DBG> simplify(JacobiDN(x,k)^(2*n))
JacobiDN(x,k)^(2*n)

The values of x,k,n are all symbols and have no values in the code running:

I have no idea why this happend when I run the code only. It think x is zero in the above for some reason.

Sorry can't make MWE, I wish I can. Something strange happens when I run the code that does not show otherwise. 

Any suggestions how to invetigate this more? Stepping into the simplify code it fails in

DBG> next
`simplify/check_constant`:
   3   return type(r,'And(constant,Or(Not(function),satisfies(f -> evalb(op(f)
         <> NULL))))')

DBG> r
JacobiDN(x,k)^2*n^2

DBG> type(r,'And(constant,Or(Not(function),satisfies(f -> evalb(op(f)          <> NULL))))')
false

DBG> step
`simplify/Jacobi`
`simplify/do`:
  84               userinfo(1,simplify,'applying',new_simp,
                     `function to expression`);

 85               new_r := new_simp(r,symb_mode);  

Here it generate the error.


It has nothing to do with simplify. Here is a call to integrate which gives same error

DBG> lhs(ode)
diff(diff(xi(x),x),x)-k^2*JacobiSN(x,k)*JacobiCN(x,k)/JacobiDN(x,k)*diff(xi(x),x)+(-k^2*JacobiCN(x,k)^2+k^2*JacobiSN(x,k)^2-k^4*JacobiSN(x,k)^2*JacobiCN(x,k)^2/JacobiDN(x,k)^2-JacobiSN(x,k)^2*k^2*n^2+n^2)*xi(x)

DBG> int(lhs(ode),x)
Error, invalid input: simplify/Jacobi/JacobiDN expects its 1st argument, k, to be of type posint, but received 0

DBG> x
x

DBG> k
k

DBG> xi(x)
xi(x)

 

alias(b = JacobiCN(sqrt(2)*sqrt(x), sqrt(2)*_Z/2)^2);
                          lessthan, b

I could not find an explanation on the help page.

I would have expected simply b as the return value.

Update:
A worksheet that generates the output


 

RootOf(JacobiCN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z)^2*_Z^2+_Z^2-2)

RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2)

(1)

plot(RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2), x = 0 .. 5)

 

convert(JacobiCN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z)^2, Elliptic_related)

1-JacobiSN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2

(2)

convert(RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2), Elliptic_related)

RootOf(JacobiSN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2-2*_Z^2+2)

(3)

alias(b = JacobiSN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z))

lessthan, b

(4)

``

Download alias_with_lessthan_output.mw

First 196 197 198 199 200 201 202 Last Page 198 of 2428