Maple 2022 Questions and Posts

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

Is there an assumption or some other way I can tell Maple to avoid such errors when using odetest, as I get many of them.

I think the solution Maple gives is correct. But odetest generates these strange innternal error that it does not know the sign of a complex number.

restart;
ode:=x^2*diff(y(x), x$2) + (cos(x)-1)*diff(y(x), x) + exp(x)*y(x) = 0;
sol:=dsolve(ode,y(x),series):
odetest(sol,ode,series,point=0);

Error, (in odetest/series) need to determine the sign of I*3^(1/2)

I've seen such error many times before and it is still not fixed in release after release.

I am using Maple 2022.1 on windows 10.

simplify is a procedure in Maple that have as parameter an assumption ¿Have the assumption a default value? For example, if we consider the following code:

restart;
f:= (x^3 - 27) / (x^2 - 3 * x):
print(f = simplify(f));

The output of that code assume that denominator is not zero, so I think the procedure have a default value for assume parameter.

When displaying two tubeplots together, we may specify their colors at will, as long as they are different colors!  For instance, specifying red and green works correctly, but specifying red and red results in red and black!

See the attached worksheet.  Interestingly, when displaying the contents of the worksheet on this website, the colors are rendered correctly!  So don't go with what you see on this web page; look inside the worksheet instead.

restart;

kernelopts(version);

`Maple 2022.1, X86 64 LINUX, May 26 2022, Build ID 1619613`

with(plots):

Two intersecting tori colored red and green -- works as expected:

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2),
style=surface, color=[red,green]);

When we set both colors to red, one of the surfaces is painted black!  Why?

Please note: This website displays the colors corectly as red and red.  But

within the worksheet the colors are read and black.

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2),
style=surface, color=[red,red]);

Specifying colors as red/red within the tubeplots still produces red/black!

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2, color=red),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2, color=red),
style=surface);

Download mw.mw

PS: As a workaround, we may replace the red & red specification with
COLOR(RGB, 1, 0, 0) and
COLOR(RGB, 1, 0, 0.01)
which are different enough to make Maple happy, but produce essentially the same red color.

Hi,

I use Maple version 2022.1 on macOS 10.14.6.

I have big problems with the parabolic groups in the "LieAlgebra" package.

First of all in the help for "Query > Parabolic", the link refers to the help page for the commands "CylinderU, CylinderV, CylinderD" which have nothing to do with it. Also, the command "Query(Alg, "Parabolic")" does not work.

Below is a list of commands that give an error for "Query".

restart:with(LinearAlgebra):with(DifferentialGeometry):with(LieAlgebras):

L:=[
Matrix(5, 5, [[0, 0, 1, 1, 1], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 0, 1, 1], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 1, 0, 1], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 1, 1, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, 0, 0, 0], [0, -1, 0, 0, 0], [0, -1, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1, 0, 1], [0, -1, 0, 0, 0], [0, 0, 0, 0, 0], [0, -1, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1, 1, 0], [0, -1, 0, 0, 0], [0, -1, 0, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, 0, 0], [0, 0, -1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1, 0, 0], [0, 1, 0, 1, 0], [0, 0, -1, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 0, -1, 0], [0, 1, 1, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, -1, 0, 0], [0, 0, -1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 1, 0, 1], [0, 0, 0, -1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, -1], [0, 0, 1, 1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 0, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, -1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 1, 0, 1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, -1], [0, 0, 0, 0, 0], [0, 1, 1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1/2*sqrt(2), -1/2*sqrt(2), -1/2*sqrt(2)], [0, 1/2*sqrt(2), 0, 0, 0], [0, 1/2*sqrt(2), 0, 0, 0], [0, 1/2*sqrt(2), 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1/2*sqrt(6), 1/6*sqrt(6), 1/6*sqrt(6)], [0, -1/2*sqrt(6), 0, -1/3*sqrt(6), -1/3*sqrt(6)], [0, -1/6*sqrt(6), 1/3*sqrt(6), 0, 0], [0, -1/6*sqrt(6), 1/3*sqrt(6), 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 2/3*sqrt(3), 1/6*sqrt(3)], [0, 0, 0, 2/3*sqrt(3), 1/6*sqrt(3)], [0, -2/3*sqrt(3), -2/3*sqrt(3), 0, -1/2*sqrt(3)], [0, -1/6*sqrt(3), -1/6*sqrt(3), 1/2*sqrt(3), 0]]), Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 1/2*sqrt(5)], [0, 0, 0, 0, 1/2*sqrt(5)], [0, 0, 0, 0, 1/2*sqrt(5)], [0, -1/2*sqrt(5), -1/2*sqrt(5), -1/2*sqrt(5), 0]])];

LieP:=LieAlgebraData(L,Alg):
DGsetup(LieP);
Query(Alg,"Parabolic");

 

I need to make my base class local variable static, so that when extending the class, the subclass will share these variable and use their current values as set by the base class. If I do not make them static, then the base class when extended, will get fresh instance of these variable, losing their original values, which is not what I want.

To do this, one must make the base class variables static

This works, but now I do not know the syntax where to put the type on the variable. 

I can't write   local m::integer::static; nor local m::static::integer;

I could only write local m::static; but this means I lost the ability to have a type on the variable and lost some of the type checking which is nice to have in Maple. From Maple help:

 

Here is example

restart;

base_class:=module()
  option object;
  local n::static;  #I want this type to ::integer also. But do not know how

  export set_n::static:=proc(_self,n::integer,$)
     _self:-n := n;
  end proc;
  
  export process::static:=proc(_self,$)
    local o;
    o:=Object(sub_class);
    o:-process();
  end proc;
end module;    

sub_class:=module()
   option object(base_class);
   process:=proc(_self,$)
      print("in sub class. _self:-n = ",_self:-n);
   end proc;
end module;

o:=Object(base_class);
o:-set_n(10);
o:-process()


            "in sub class. _self:-n = ", 10

The above is all working OK. I just would like to make n in the base class of type ::integer as well as ::static

Is there a syntax for doing this?

 

I have a set of formulas I saved in a matrix and the exported the matrix to Excel. However when I open the file in Excel the equations are in prefix notation (I think).  That's not exactly human readable friendly.  If I copy and paste straight into excel they are readable.

It there a way to make the Maple export similar?

EDIT:-  I exported as a.csv file because if export as .xlsx    all the equation change into "#NUM!" in the spreadsheed.

restart

NULL

Digits := 5

5

(1)

interface(displayprecision = 5); interface(rtablesize = 30)

5

(2)

cosrule := proc (a, b, c, A) options operator, arrow; a^2 = b^2+c^2-2*b*c*cos(A) end proc

proc (a, b, c, A) options operator, arrow; a^2 = b^2+c^2-2*b*c*cos(A) end proc

(3)

Ang := solve(cosrule(a, b, c, A), A)

Pi-arccos((1/2)*(a^2-b^2-c^2)/(b*c))

(4)

Formulas := Matrix(20, 4)

 

 

 

 

data := [L[1] = 619.35, L[2] = 891.12, pos = 180, tos = 90, x1 = 600, y1 = -800, z1 = 500, x2 = 900, y2 = -200, z2 = 850, `Θt` = 29.34*Pi*(1/180), `Θp` = 53.98*Pi*(1/180)]
 

 

 

 

i := 3

res0 := `ΔZ` = z2-z1; Formulas[i, 1] := lhs(res0); Formulas[i, 2] := rhs(res0)

`ΔZ` = z2-z1

(5)

res0 := eval(res0, data); Formulas[i, 3] := rhs(res0); Formulas; i := i+1

`ΔZ` = 350

(6)

res1 := dt[1] = sqrt(tos^2+L[1]^2); Formulas[i, 1] := lhs(res1); Formulas[i, 2] := rhs(res1); res1 := eval(res1, data); Formulas[i, 3] := rhs(res1); Formulas; i := i+1

dt[1] = 625.85

(7)

NULL

res2 := d[1] = sqrt(pos^2+tos^2+L[1]^2); Formulas[i, 1] := lhs(res2); Formulas[i, 2] := rhs(res2); res2 := eval(res2, data); Formulas[i, 3] := rhs(res2); Formulas; i := i+1

d[1] = 651.22

(8)

res3 := dt[2] = sqrt(tos^2+L[2]^2); Formulas[i, 1] := lhs(res3); Formulas[i, 2] := rhs(res3); res3 := eval(res3, data); Formulas[i, 3] := rhs(res3); Formulas; i := i+1

dt[2] = 895.65

(9)

NULL

res4 := d[2] = sqrt(pos^2+tos^2+L[2]^2); Formulas[i, 1] := lhs(res4); Formulas[i, 2] := rhs(res4); res4 := eval(res4, data); Formulas[i, 3] := rhs(res4); Formulas; i := i+1

d[2] = 913.56

(10)

NULL

res7 := tau = arctan(tos/L[1]); Formulas[i, 1] := lhs(res7); Formulas[i, 2] := rhs(res7); res7 := eval(res7, data); Formulas[i, 3] := rhs(res7); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1

8.2678

(11)

NULL

res8 := rho = arctan(tos/L[2]); Formulas[i, 1] := lhs(res8); Formulas[i, 2] := rhs(res8); res8 := eval(res8, data); Formulas[i, 3] := rhs(res8); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res0, res1, res2, res3, res4, res7, res8]

5.7674

(12)

NULL

res9 := alpha = `Θt`+tau-rho; Formulas[i, 1] := lhs(res9); Formulas[i, 2] := rhs(res9); res9 := eval(res9, data); Formulas[i, 3] := rhs(res9); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res9]

31.840

(13)

NULL

NULL

NULL

res10 := dt[3] = solve(cosrule(dt[3], dt[2], dt[1], alpha), dt[3])[1]; Formulas[i, 1] := lhs(res10); Formulas[i, 2] := rhs(res10); res10 := eval(res10, data); Formulas[i, 3] := rhs(res10); Formulas; i := i+1; data := [op(data), res10]

dt[3] = 491.45

(14)

NULL

NULL

res11 := beta = solve(cosrule(dt[1], dt[2], dt[3], beta), beta); Formulas[i, 1] := lhs(res11); Formulas[i, 2] := rhs(res11); res11 := eval(res11, data); Formulas[i, 3] := rhs(res11); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res11]

42.215

(15)

NULL

NULL

NULL

NULL

res12 := Zeta = arccos(`ΔZ`/dt[3]); Formulas[i, 1] := lhs(res12); Formulas[i, 2] := rhs(res12); res12 := eval(res12, data); Formulas[i, 3] := rhs(res12); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res12]

44.588

(16)

NULL

NULL

res13 := dt[4] = dt[3]*sin(Zeta); Formulas[i, 1] := lhs(res13); Formulas[i, 2] := rhs(res13); res13 := eval(res13, data); Formulas[i, 3] := rhs(res13); Formulas; i := i+1; data := [op(data), res13]

Matrix(%id = 36893490716944981036)

(17)

 

``

NULL

``

NULL

currentdir()

"C:\Users\Ronan\Documents\MAPLE\A & Q Maple primes"

(18)

NULL

with(ExcelTools)

[Export, Import, WorkbookData]

(19)

NULLExport(Formulas, "Frmls.csv")NULL

Download test_eqn_export.mw

Hi.

What wrong could be there with the color line?

restart:

with(plots):

equ1 := BesselJ(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4) + BesselY(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4):

equ2 := BesselJ(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4) + 5*BesselY(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4):

equ3 := BesselJ(sqrt(17)/2, 10*sqrt(t))/t^(1/4) + 5*BesselY(sqrt(17)/2, 10*sqrt(t))/t^(1/4):

tmax   := 30:
colors := ["Red", "Violet", "Blue"]:

p1 := plot([equ1, equ2, equ3], t = 0 .. tmax, labels = [t, T[2](t)], tickmarks = [0, 0], labelfont = [TIMES, ITALIC, 12], axes = boxed, color = colors):

ymin := min(op~(1, op~(2, op~(2, [plottools:-getdata(p1)])))):
ymax := max(op~(2, op~(2, op~(2, [plottools:-getdata(p1)])))):
dy   := 2*ymax:

legend1 := typeset(C[3] = 1, ` , `, C[4] = 1, ` , `, Omega^2 = 50):
legend2 := typeset(C[3] = 1, ` , `, C[4] = 5, ` , `, Omega^2 = 50):
legend3 := typeset(C[3] = 1, ` , `, C[4] = 5, ` , `, Omega^2 = 25):

p2 := seq(textplot([tmax-2, ymax-k*dy/20, legend||k], align=left), k=1..3):

p3 := seq(plot([[tmax-2, ymax-k*dy/20], [tmax-1, ymax-k*dy/20]], color=colors[k]), k=1..3):
display(p1, p2, p3, view=[default, -ymax..ymax], size=[800, 500])

Error, (in plot) invalid color specification: colors[1]

 

display(p1, p2, p3, view = [default, -ymax .. ymax], size = [800, 500])

(1)

 

Download Legend_Inside.mw

  1. I use both Maple and Matlab
  2. I also install (a stripped down version of) Maple as the "symbolic toolbox" for Matlab using the executable MapleToolbox2022.0WindowsX64Installer.exe, which lives in C:\Program Files\Maple 2022. This gives me acces to (some) symbolic computation capability from within Matlab.
  3. This installation process has been working for as long as I remember, certainly more than 10 years
  4. With Maple 2022 and Matlab R2022a, this installation process ran with no problems and I can perform symbolic computation within Matlab
  5. However, although the Matlab help lists the Maple toolbox as supplemental software (as in all previous releases), I can no longer acces help for Maple from within Matlab - I just get a "Page not found" message
  6. The relevant Maple "help" is at the same place within the Matlab folder structure which is C:\Program Files\MATLAB\R2022a\toolbox\maple\html
  7. I have just spoken to support at Matlab and they claim tha this must be a Maple (or Maple toolbox installer issue) - so nothing to do with them!
  8. Has anyone else had a similar problem andd found a workaround?

When using the built-in fsolve function to find the roots of a polynomial, how does exponentiation occur? For example, x3 is found​​​​​​first, and then to find x4, will he start again from the beginning, that is, x*x*x*x, or will he take the value of x3​​​​​​ and multiply by x? The teacher is interested in finding out this, but I don't know how to find out myself. 

To Maple support:

I was investigating this pde from a different forum.

I noticed that when using an expanded version of the pde, Maple hangs. Without expanding the PDE, Maple gives an answer in 2 seconds. 

Why does expanding the PDE makes a difference? I do not have an earlier version of Maple on my new PC to check if this is a new issue or not.
 

interface(version);

`Standard Worksheet Interface, Maple 2022.0, Windows 10, March 8 2022 Build ID 1599809`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1230 and is the same as the version installed in this computer, created 2022, April 21, 9:8 hours Pacific Time.`

restart;
pde1:=VectorCalculus:-Laplacian(u(r,theta),'polar'[r,theta]);
pde1_expanded:=expand(pde1);
bc  := u(1,theta)=sin(theta)^4,u(3,theta)=1;
pdsolve([pde1=0,bc],u(r,theta))
 

(diff(u(r, theta), r)+r*(diff(diff(u(r, theta), r), r))+(diff(diff(u(r, theta), theta), theta))/r)/r

(diff(u(r, theta), r))/r+diff(diff(u(r, theta), r), r)+(diff(diff(u(r, theta), theta), theta))/r^2

u(1, theta) = sin(theta)^4, u(3, theta) = 1

u(r, theta) = (1/52480)*((328*r^6-26568*r^2)*ln(3)*cos(2*theta)+(-r^8+6561)*ln(3)*cos(4*theta)+19680*(ln(3)+(5/3)*ln(r))*r^4)/(ln(3)*r^4)

pdsolve([pde1_expanded=0,bc],u(r,theta)); #HANGS, Waited more than 40 minutes.

 


 

Download hangs_pde.mw

Hi everyone! I'd really appreciate if I could get pointed in the right direction as I am a brand new maple user.

So im trying to solve this constrainted optimization problem (See picture) using Maple symbollically. I believe I should have a closed form solution given I can substitute the one constraint into the objective function. Specifically closed form solutions for the three phi variables.

Can someone point me in the right direction as to how I should go about this? I've already taken first order conditions and tried to using the solve() function to no avail, realizing my sytem of equations weren't linear );. 

Hi there.

There is some floating bug in Thread-Seq.

Maple is crashing sometimes (not always, 50/50) after running the script below:

thread-seq_error.mw

What's going on?

Hi,all

I am new in Maple,when I execute the "InversePlot" command ,all functions were correct except for exp(x), error occurs as follows, can anyone tell me what mistake I took?

Tks in advance!

restart;
with(Student[Calculus1]);

InversePlot(exp(x), -1 .. 1);
Error, (in Student:-Calculus1:-InversePlot) module does not export `IsTrigProc`

 

Tks for all you guys. 

I have uninstall Maple and deleted the installed directory ,clear the register,reinstall Maple 2022, now all works well.

I think the problem is I installed Maple 2022 in the old directory of 2021for keeping my configuration,this caused much unexpected problem

> with(LinearAlgebra) :
> a:=<<.1,.2>|<.3,.4>>:
> ScalarMultiply(a,.1);

INTEL MKL ERROR: /home/jet08013/maple2022/bin.X86_64_LINUX/libmkl_gf_lp64.so: undefined symbol: mkl_blas_cdgmm_batch_strided.
Intel MKL FATAL ERROR: Cannot load libmkl_gf_lp64.so.
maple: fatal error, lost connection to kernel

This is EXTREMELY inconvenient.

Maple 2022:

It appears that one can use push_back() with an empty DEQueue(), but not push_front().

Since the queue is double-ended and empty, this doesn't make much sense to me. So should this be considered a "bug"?

See the attached

  restart:

#
# This works
#
  A:=DEQueue();
  empty(A);  
  push_back(A,2);
  

module DEQueue () local num, head, tail, storage, dsp; option object; end module

 

true

 

module DEQueue () local num, head, tail, storage, dsp; option object; end module

(1)

#
# But this results in an error!
#
  B:=DEQueue();
  empty(B);
  push_front(B,2);

module DEQueue () local num, head, tail, storage, dsp; option object; end module

 

true

 

Error, invalid return value from method moduledefinition: 'NULL'

 

 

Download DEQueue_Prob.mw

4 5 6 7 8 9 10 Last Page 6 of 39