MaplePrimes Questions

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.

Hello 

I have implemented FDM for  nonlinear coupled equation 

I that I have to plot U versus Y=i*h and C versus Y 

As well Theta(T) versus Y 

And I want to calculate U(0.5) T(0.5) and C(0.5)

For different values of M 

Like M=1,2,3

Please give me command for the plot and table value of U ,T,&C (0.5)

restart;
# Parameter values:
 Pr:=1:E:=1:A:=0.1:Sc:=0.01: K:=0.5:

a := 0: b := 1: N := 9:
h := (b-a)/(N+1): k := (b-a)/(N+1):

 lambda:= 1/h^2:  lambda1:= 1/k^2:
# Initial conditions
for i from 0 to N do
  U[i, 0] := h*i+1:
end do:

for i from 0 to N do
  T[i, 0] := h*i+1:
end do:
for i from 0 to N do
  C[i, 0] := h*i+1:
end do:

# Boundary conditions
for j from 0 to N+1 do
  U[0, j] := exp(A*j*lambda);
  U[N+1, j] := 0;
  T[0, j] := j*lambda1;
  T[N+1, j] := 0;
  C[0, j] := j*lambda1;
  C[N+1, j] := 0
end do:

#Discretization Scheme
for i to N do
  for j from 0 to N do
    eq1[i, j]:= lambda1*(U[i, j+1]-U[i, j]) = (Gr/2)*(T[i, j+1]+T[i,j])+(Gr/2)*(C[i, j+1]+C[i,j])+(lambda^2/2)*(U[i-1,j+1]-2*U[i,j+1]+U[i+1,j+1]+U[i-1,j]-2*U[i,j]+U[i+1,j])-(M/2)*(U[i,j+1]+U[i,j]) ;
    eq2[i, j]:= lambda1*(T[i, j+1]-T[i, j]) = (1/Pr)*(lambda^2/2)*(T[i,j+1]-2*T[i,j+1]+T[i+1,j+1]+T[i-1,j]-2*T[i,j]+T[i+1,j])+(E*lambda^2)*((U[i+1,j]-U[i,j])^2);
    eq3[i, j]:= lambda1*(C[i, j+1]-C[i, j]) = (1/Sc)*(lambda^2/2)*(C[i,j+1]-2*C[i,j+1]+C[i+1,j+1]+C[i-1,j]-2*C[i,j]+C[i+1,j])+(K/2)*((C[i,j+1]+C[i,j]))  
  end do
end do:
 

  `union`(  seq(seq( indets( eq1[i,j], name), i=1..N), j=0..N),
            seq(seq( indets( eq2[i,j], name), i=1..N), j=0..N),
            seq(seq( indets( eq3[i,j], name), i=1..N), j=0..N)
          );

   numelems(%):

  numelems(eq1)+numelems(eq2)+numelems(eq3);

{Gr, M, C[1, 1], C[1, 2], C[1, 3], C[1, 4], C[1, 5], C[1, 6], C[1, 7], C[1, 8], C[1, 9], C[1, 10], C[2, 1], C[2, 2], C[2, 3], C[2, 4], C[2, 5], C[2, 6], C[2, 7], C[2, 8], C[2, 9], C[2, 10], C[3, 1], C[3, 2], C[3, 3], C[3, 4], C[3, 5], C[3, 6], C[3, 7], C[3, 8], C[3, 9], C[3, 10], C[4, 1], C[4, 2], C[4, 3], C[4, 4], C[4, 5], C[4, 6], C[4, 7], C[4, 8], C[4, 9], C[4, 10], C[5, 1], C[5, 2], C[5, 3], C[5, 4], C[5, 5], C[5, 6], C[5, 7], C[5, 8], C[5, 9], C[5, 10], C[6, 1], C[6, 2], C[6, 3], C[6, 4], C[6, 5], C[6, 6], C[6, 7], C[6, 8], C[6, 9], C[6, 10], C[7, 1], C[7, 2], C[7, 3], C[7, 4], C[7, 5], C[7, 6], C[7, 7], C[7, 8], C[7, 9], C[7, 10], C[8, 1], C[8, 2], C[8, 3], C[8, 4], C[8, 5], C[8, 6], C[8, 7], C[8, 8], C[8, 9], C[8, 10], C[9, 1], C[9, 2], C[9, 3], C[9, 4], C[9, 5], C[9, 6], C[9, 7], C[9, 8], C[9, 9], C[9, 10], T[1, 1], T[1, 2], T[1, 3], T[1, 4], T[1, 5], T[1, 6], T[1, 7], T[1, 8], T[1, 9], T[1, 10], T[2, 1], T[2, 2], T[2, 3], T[2, 4], T[2, 5], T[2, 6], T[2, 7], T[2, 8], T[2, 9], T[2, 10], T[3, 1], T[3, 2], T[3, 3], T[3, 4], T[3, 5], T[3, 6], T[3, 7], T[3, 8], T[3, 9], T[3, 10], T[4, 1], T[4, 2], T[4, 3], T[4, 4], T[4, 5], T[4, 6], T[4, 7], T[4, 8], T[4, 9], T[4, 10], T[5, 1], T[5, 2], T[5, 3], T[5, 4], T[5, 5], T[5, 6], T[5, 7], T[5, 8], T[5, 9], T[5, 10], T[6, 1], T[6, 2], T[6, 3], T[6, 4], T[6, 5], T[6, 6], T[6, 7], T[6, 8], T[6, 9], T[6, 10], T[7, 1], T[7, 2], T[7, 3], T[7, 4], T[7, 5], T[7, 6], T[7, 7], T[7, 8], T[7, 9], T[7, 10], T[8, 1], T[8, 2], T[8, 3], T[8, 4], T[8, 5], T[8, 6], T[8, 7], T[8, 8], T[8, 9], T[8, 10], T[9, 1], T[9, 2], T[9, 3], T[9, 4], T[9, 5], T[9, 6], T[9, 7], T[9, 8], T[9, 9], T[9, 10], U[1, 1], U[1, 2], U[1, 3], U[1, 4], U[1, 5], U[1, 6], U[1, 7], U[1, 8], U[1, 9], U[1, 10], U[2, 1], U[2, 2], U[2, 3], U[2, 4], U[2, 5], U[2, 6], U[2, 7], U[2, 8], U[2, 9], U[2, 10], U[3, 1], U[3, 2], U[3, 3], U[3, 4], U[3, 5], U[3, 6], U[3, 7], U[3, 8], U[3, 9], U[3, 10], U[4, 1], U[4, 2], U[4, 3], U[4, 4], U[4, 5], U[4, 6], U[4, 7], U[4, 8], U[4, 9], U[4, 10], U[5, 1], U[5, 2], U[5, 3], U[5, 4], U[5, 5], U[5, 6], U[5, 7], U[5, 8], U[5, 9], U[5, 10], U[6, 1], U[6, 2], U[6, 3], U[6, 4], U[6, 5], U[6, 6], U[6, 7], U[6, 8], U[6, 9], U[6, 10], U[7, 1], U[7, 2], U[7, 3], U[7, 4], U[7, 5], U[7, 6], U[7, 7], U[7, 8], U[7, 9], U[7, 10], U[8, 1], U[8, 2], U[8, 3], U[8, 4], U[8, 5], U[8, 6], U[8, 7], U[8, 8], U[8, 9], U[8, 10], U[9, 1], U[9, 2], U[9, 3], U[9, 4], U[9, 5], U[9, 6], U[9, 7], U[9, 8], U[9, 9], U[9, 10]}

 

270

(1)

  fsolve( eval( [ seq(seq(eq1[i,j], i=1..N),j=0..N),
                  seq(seq(eq2[i,j], i=1..N),j=0..N),
                  seq(seq(eq3[i,j], i=1..N),j=0..N)
                ],
                [Gr=1.0, M=2]
              )
        );

plot(eval([seq([i*h, U])],thickness = 4, axes = boxed, labels = [U, y], color = red, title = "FDM"));

NULL

Download FDM_nonlinear_ode.mw

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

Hi everyone, Could anyone help me to draw horizontal and vertical line in a plot? Also, How to add command for legends to show inside the plot at empty space. I every time edit legends in paint manually. For reference, I am attaching a picture

Help_graph_and_legends_place.mw

 

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

Apparently functions working on lines do not work on segments.

I can't see any logical explanation why that should be so.

Please consider expanding functionality in future Maple versions.

segprojection.mw

Is there a way to determine the version of MapleSim used to create a model from the model file or within MapleSim when an older model was loaded?

Hei

Vet noen om Windows 11 støtter Maple 2020? Eller støttes det bare av Windows 10.

If I understand right, the form  is equivalent to  (where the optional index variable is omitted), which produces a sequence of n occurrences of y. But how to explain the following output (of p1())? 

restart;

kernelopts(version)

`Maple 2023.0, X86 64 WINDOWS, Mar 06 2023, Build ID 1689885`

(1)

p0 := proc()
    local a := 1, b := 2;
    seq('assign(('a', 'b') = (a + 1, 2*b))', 1 .. 3);
    print(a, b)
end:

p1 := proc()
    local a := 1, b := 2;
    seq('assign(('a', 'b') = (a + 1, 2*b))', 3);
    print(a, b)
end:

p2 := proc()
    local a := 1, b := 2;
    'assign(('a', 'b') = (a + 1, 2*b))' $ 3;
    print(a, b)
end:

p3 := proc()
    local a := 1, b := 2;
    to 3 do
        assign(('a', 'b') = (a + 1, 2*b))
    od;
    print(a, b)
end:

p0()

p1()

p2()

p3()

4, 16

 

5, 32

 

4, 16

 

4, 16

(2)


Download singular_behaviour_of_`seq`.mw

Main code: 

p1 := proc()
    local a := 1, b := 2;
    seq('assign(('a', 'b') = (a + 1, 2*b))', 3);
    print(a, b)
end:
p1():
3 4 5 6 7 8 9 Last Page 5 of 2237