Maple 2021 Questions and Posts

These are Posts and Questions associated with the product, Maple 2021

I have been experiencing an error in the 2-D math text in Maple 2021. Every time I use the shift button the command seems to double. So if I for instance want to define A:=2 it will write; AA::==2 making the command useless. This only happens in 2-D math.

I have tried restarting Maple, my PC and uninstalling then installing maple 2021 again but nothing changes. This error appeared after updating maple the 6th of january 2022 to Maple 2021.2. I have a MacBook Air M1 2020. 

Please help as I have an exam soon

Hello, I'm using Maple 2021.2 to approximate the solution to a differential equation using a pseudospectral expansion in the basis of Hermite polynomials. After setting up some equations, I get a non-linear system of equations that I try to solve using the Maple's function solve, but Maple suddenly crashes during the execution of this function.

My code is the following:

HN := (n, y) -> exp(-1/2*y^2)*simplify(HermiteH(n, y))/sqrt(sqrt(Pi)*2^n*n!):

u7 := a0*HN(0, y) + a1*HN(1, y) + a2*HN(2, y) + a3*HN(3, y) + a4*HN(4, y) + a5*HN(5, y) + a6*HN(6, y):

resid := diff(u7, y $ 2) + 4*y*diff(u7, y)*u7 + 2*u7^2:

r := evalf(allvalues(RootOf(HermiteH(7, x), x)));
equations := {evalf(eval(u7, y = 0) - 1)};
for root_r in r do
    if root_r != 0 then
        equations := {op(equations), evalf(eval(resid, y = root_r))};
    end if:
end do:

solutions := solve(equations, {a0, a1, a2, a3, a4, a5, a6}):

Does anyone have any idea about what is happening? Is there any better way of solving a non-linear system of equations?

A user wonders if they can customize Maple output to show, for example x^2 instead of x2 in 2D output. 

We suggest they either set 

interface(prettyprint=0);

globally, or use

lprint(x^2)

for individual outputs. 

A user wonders if there is a straightforward way to show US states with names using the WorldMap Data Set in Maple

We suggest something like the attached: map-of-us-with-states.mw

 

restart; with(DataSets:-Builtin); r := Reference("GeoNames"); states := r[[Country = "United States", Type = "first-order administrative division"]]; w := WorldMap(); w:-AddPoints(w, states); Display(w, mapdata = fine, style = polygonoutline, size = [2000, 1500])

 

 

What/Whare are the maple initialization files.

I have a problem with libname.

According to maple help, I should create/modify ~/.mapleinit.

> cat ~/.mapleinit

libname := "/usr/local/Maple2021/lib","/home/tomdean/maple/toolbox/maplev/lib","/home/tomdean/maple/toolbox/Syrup/lib";

But, when I start maple (in emacs), libname is only the first part, "/usr/local/Maple2021/lib",

I installed the cloud version of Syrup with xmaple, by clicking the cloud icon, etc. It is loaded with xmaple and cmaple. But, not in maple running in emacs.

with(Syrup);
(**) Error, invalid input: with expects its 1st argument, pname, to be of type
{module, package}, but received Syrup
(**) 

Tom Dean

I am attempting to use maplev mode for emacs. Ubuntu 20.04.3, Emacs 26.3, maplev-mode from git, release-2.36-59-g142c03. maple 2021.

I copied mload from an older computer and added a line to define maple, after the original maple definition line.

MAPLE=${MAPLE:-maple} # Maple script
MAPLE=/usr/local/Maple2021/bin/maple  <=== added

I compiled and installed maplev-mode. I had to touch doc/version.texi because the file did not exist. But, otherwise, I saw no errors.

I added lines to my emacs init.el as per the README.md.

maplev-mode seems to load when I edit a .mpl file.

However, mint is not defined.  Where should I change to define the location of mint?

/usr/local/Maple2021/bin/mint

Tom Dean

In this example, i have a top module A. Inside it, I have module named my_RECORD (which happened to be option object) that I want to return back to caller when they call a proc.

Maple allows me to declare the proc to return my_RECORD. No problem., But when making a local variable inside the proc and using o::my_RECORD it complains  that my_RECORD does not exist. 

The solution is to change o::my_RECORD to o::A:-my_RECORD

My question why it did not complain the same way on the return value on the proc?   for me, they are both semantically the same. One says the proc returns this type, and the other says the local variable is this type. So why had to do A:-my_RECORD on one but not the other? 

Here is an example. Maple 2021.2 on windows 10.

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

3

A:=module()
 #this is the RECORD to return
  local module my_RECORD()
   option object;
   export data::string:="";
  end module;
   
  export do_analysis:=proc()::my_RECORD;   
    local o::my_RECORD; #error here. But this is the same above line above?    
    o:=Object(my_RECORD);
    o:-data:="test";
    return o;        
  end proc;
end module;

_m2642451182336

A:-do_analysis()

Error, (in do_analysis) type `my_RECORD` does not exist

#FIXED BELOW
restart;

A:=module()
    #this is the RECORD to return
    local module my_RECORD()
        option object;
        export data::string:="";
    end module;
   
    export do_analysis:=proc()::my_RECORD;
          local o::A:-my_RECORD;    
          o:=Object(my_RECORD);
          o:-data:="test";
          return o;        
    end proc;
end module;

_m2642339719872

A:-do_analysis()

module my_RECORD () export data::string; option object; end module

 

Download A_no_lib.mw

Hi, I am trying to enter into the Mini-Course Computer Algebra for Physicists from the help, but instead of going to the page I get the help page of Physics[FeynmanIntegral]. Can anyone confirm that this happens to them on Maple 2021.2?

Kevin

Correction

Please ignore this question. dsolve does hang, but I had typo in the timelimit command itself when I wrote the test. Fixing this, now it timesout OK.

Maybe someone can look why dsolve hangs on this ode. But since timelimit does work, there is a workaround.

Original question

I was checking Maple's dsolve on this textbook problem

The book gives the answer in the back as

When using Maple's dsolve, I found it hangs. The stange thing, is that adding timelimit() also hangs. I can understand dsolve() hanging sometimes. But what I do not understand is why with timelimit it also hangs?

I've waited 20 minutes and then gave up. As you see, the timelimit is 20 seconds. May be if I wait 2 hrs or 20 hrs or 20 days, it will finally timeout. I do not know but can't wait that long.

Do others see same problem on this ode? Does it hang for you? How about on the mac or Linux?

During this time, I see mserver.exe running at very high CPU. I restarted Maple few times, but this did not help.

Maple 2021.2 on windows 10. May be one day Maplesoft will fix timelimit so it works as expected. 

interface(version)

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1122 and is the same as the version installed in this computer, created 2021, December 22, 16:3 hours Pacific Time.`

restart;

ode:=x*diff(y(x),x)=y(x)*cos(ln(y(x)/x));
try
   timeout(20,dsolve(ode));
catch:   
   print("timedout");       
end try;   
print("OK");

x*(diff(y(x), x)) = y(x)*cos(ln(y(x)/x))

 

Download test_ode_hang.mw

on DLMF page, they show this transformation on independent variable for second order ode

https://dlmf.nist.gov/1.13#Px7

About half way down the page, under Elimination of First Derivative by Change of Independent Variable section.

I tried to verify it using Maple dchange. But the problem it looks like dchange wants the old variable to be on the left side (z in this example) and the new variable (eta in this example) to be on the right side in the transformation. But on the above web page, it is the other way around.

Here are my attempts

restart;
ode:=diff(w(z),z$2)+f(z)*diff(w(z),z)+g(z)*w(z)=0;

tranformation:=eta=int(exp(-int(f(z),z)),z);

PDEtools:-dchange({tranformation},ode,known={z},unknown={eta});
PDEtools:-dchange({tranformation},ode,{eta},known={z});
PDEtools:-dchange({tranformation},ode,{eta});

All give errors

Error, (in dchange/info) missing a list with the new variables
Error, (in dchange/info) the new variables are not contained in the rhs of the direct transformation equations
Error, (in dchange/info) the new variables are not contained in the rhs of the direct transformation equations

The problem it does not seem possible to invert the transformation shown on the webpage, so that the old variable z show on the left side and the new variable (eta) on the right side.  

Why is this restriction on dchange  Since one tells it which is the new variable and which is the old variable? May be I am not using dchange correctly in this example.

Any suggestion for a workaround to use dchange to verify the above result?

Here is my hand derivation (pdf file attached also)

Can the above be done using dchange?

Maple 2021.2 on windows 10

sol.pdf

Has somebody experienced something like that before?

I was searching for a bug in a sheet, and was absolute unable to find out why some results in a sheet were different from another sheet.

Found out that it actually was a pure graphics problem. With normal zoom (100%) the minus signum is not visible.

Blowing up the zoom to 125% shows the signum again.

I would like to open a specially formatted document from start/new document. I set  up one with a fixed width table to make it easy to print to A4. I find the very useful for taking notes.

Currently I just save it as  a usual document. The attached shows the basic setup I use. Contents arn't too relivant.

restart

``

 

 

 

"R(m2,m3,m4,...)&equiv;((2 m2+3 m3+4 m4+...)!)/((1+m2+2 m3+3 m4+...)!m2!m3!m4!...)"

 

 

  

Xterm := factorial(2*m+3*n+4*p+5*q)*c[2]^m*c[3]^n*c[4]^p*c[5]^q/(factorial(1+m+2*n+3*p+4*q)*factorial(m)*factorial(n)*factorial(p)*factorial(q))

factorial(2*m+3*n+4*p+5*q)*c[2]^m*c[3]^n*c[4]^p*c[5]^q/(factorial(1+m+2*n+3*p+4*q)*factorial(m)*factorial(n)*factorial(p)*factorial(q))

(1)

k := 5

5

(2)

x := add(add(add(add(Xterm, q = 0 .. 4*k), p = 0 .. 3*k), n = 0 .. 2*k), m = 0 .. k)

nops(x)

22176

(3)

NULL

nops(TestPoly)

1

(4)

ldegree(TestPoly)

1

(5)

NULL

NULL

NULL
NULL

mtaylor(TestPoly, [c[2], c[3], c[4], c[5]], k+2)

TestPoly

(6)

C1 := 1; C2 := -2; C3 := 3; C4 := -4; C5 := 5

5

(7)

Poly1 := expand((y+C1)*(y+C2)*(y+C3)*(y+C4)*(y+C5))

y^5+3*y^4-23*y^3-51*y^2+94*y+120

(8)

NULL

Poly1 := Poly1/coeff(Poly1, y, 0)

(1/120)*y^5+(1/40)*y^4-(23/120)*y^3-(17/40)*y^2+(47/60)*y+1

(9)

NULL

Poly1 := expand((y+C1)*(y+C2)*(y+C3)*(y+C4)*(y+C5))

y^5+3*y^4-23*y^3-51*y^2+94*y+120

(10)

NULL

Poly1 := Poly1/coeff(Poly1, y, 0)

(1/120)*y^5+(1/40)*y^4-(23/120)*y^3-(17/40)*y^2+(47/60)*y+1

(11)

fsolve(Poly1, y)

-5., -3., -1., 2., 4.

(12)

coeff(Poly1, y, 1)

47/60

(13)

Poly2 := algsubs(y = -z/coeff(Poly1, y, 1), Poly1)

-(6480000/229345007)*z^5+(324000/4879681)*z^4+(41400/103823)*z^3-(1530/2209)*z^2-z+1

(14)

"(->)"

-0.28254e-1*z^5+0.66398e-1*z^4+.39876*z^3-.69262*z^2-1.*z+1.

(15)

"(->)"

 

solve(Poly2, z)

-47/30, -47/15, 47/12, 47/20, 47/60

(16)

-%/coeff(Poly1, y, 1)

2, 4, -5, -3, -1

(17)

NULL

 

 

``

``

NULL

Download A4_format.mw

I can't move files in the navigator window anymore in Maple 2021.2.

Anyone else with the same problems?

sometimes complicated equation is generated and attempt to solve it fail, which is OK. But there is a case, where Maple generates an internal error from solve(). The problem is that it is not possible to even capture this error using try...catch... end try so the whole program crashes.

Is there a way to trap such errors, so at least it can bypass it without solving it but without terminating the whole program? 

According to help it says

The try statement provides a mechanism for executing statements in a controlled environment, where errors will not just cause the execution to halt with no warning.

Well. The above is not really true.

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1115 and is the same as the version installed in this computer, created 2021, December 15, 10:0 hours Pacific Time.`

restart;

eq:=-t^m*y+1/12*(-6*(-(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(2/3)+96*t^m*y)/(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3))^(1/2)+1/12*6^(1/2)*((-(-6*(-(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(2/3)+96*t^m*y)/(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3))^(1/2)*(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(2/3)+96*t^m*y*(-6*(-(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(2/3)+96*t^m*y)/(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3))^(1/2)+72*(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3))/(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3)/(-6*(-(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(2/3)+96*t^m*y)/(108+12*(6144*(t^m)^3*y^3+81)^(1/2))^(1/3))^(1/2))^(1/2) = t^(m-1)*(-y+1/12*(-6*(-(108+12*(6144*y^3+81)^(1/2))^(2/3)+96*y)/(108+12*(6144*y^3+81)^(1/2))^(1/3))^(1/2)+1/12*6^(1/2)*((-(-6*(-(108+12*(6144*y^3+81)^(1/2))^(2/3)+96*y)/(108+12*(6144*y^3+81)^(1/2))^(1/3))^(1/2)*(108+12*(6144*y^3+81)^(1/2))^(2/3)+96*y*(-6*(-(108+12*(6144*y^3+81)^(1/2))^(2/3)+96*y)/(108+12*(6144*y^3+81)^(1/2))^(1/3))^(1/2)+72*(108+12*(6144*y^3+81)^(1/2))^(1/3))/(108+12*(6144*y^3+81)^(1/2))^(1/3)/(-6*(-(108+12*(6144*y^3+81)^(1/2))^(2/3)+96*y)/(108+12*(6144*y^3+81)^(1/2))^(1/3))^(1/2))^(1/2)):

sol:=solve(eq,m)  assuming t>0;

Error, (in PolynomialSystemSolvers:-PseudoResultant) too many levels of recursion

try
    sol:=solve(eq,m)  assuming t>0;
catch:
    print("Cought error");
end try;

Error, (in PolynomialSystemSolvers:-PseudoResultant) too many levels of recursion

 

Download dec_16_2021.mw

First 17 18 19 20 21 22 23 Last Page 19 of 35