MaplePrimes Questions

In the below I would like to format the odes as they appear in the second and third ode (in green brackets).

I.e. making the first operand with the minus sign inside the parentheses the second one. I was hoping for simplify,size but that does not do the trick.

How to do this?

Format_odes.mw

Dear Maple Support Team and Community,

    I would like to report what seems to be a bug in Maple's MatrixExponential function in the LinearAlgebra package.

    Consider the following 8×8 skew-Hermitian matrix B:
 

B := Matrix(8, 8, [[0, I, 0, -I, 0, I, 0, -I], 
                   [-I, 0, I, 0, -I, 0, I, 0], 
                   [0, -I, 0, I, 0, -I, 0, I], 
                   [I, 0, -I, 0, I, 0, -I, 0], 
                   [0, I, 0, -I, 0, I, 0, -I], 
                   [-I, 0, I, 0, -I, 0, I, 0], 
                   [0, -I, 0, I, 0, -I, 0, I], 
                   [I, 0, -I, 0, I, 0, -I, 0]]);

    Now compute the matrix exponential exp(I*t*B) using MatrixExponential

H := LinearAlgebra:-MatrixExponential(I * t * B);

However, this result is inconsistent with the matrix exponential computed using MATLAB and SageMath, both of which give the same result, different from Maple's.

I would appreciate it if someone from the development team could look into this.

For the attached file I ask for help with the plot of sol_1 for x>0.1 .

chini dgl.mw

i want to find critical point but becuase the equation is ong the result not shown up i try to put variable and then result show up but the number are to ugly and so long i want make them be 1 number without any decimal can we do that?

short-Dc.mw

Encountered this error using patmatch with condition. I have changed my code since then  to avoid such cases.

But do you think this is valid error? It only happens when adding conditional. 

interface(version);

restart;

RHS:=1/2/lambda(y)*f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a+1/2/lambda(y)*f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*b-1/lambda(y)*f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*y-1/2/lambda(y)^2*D(f)(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a*b+1/2/lambda(y)^2*D(f)(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a*y+1/2/lambda(y)^2*D(f)(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*b*y-1/2/lambda(y)^2*D(f)(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*y^2;

(1/2)*f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a/lambda(y)+(1/2)*f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*b/lambda(y)-f(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*y/lambda(y)-(1/2)*(D(f))(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a*b/lambda(y)^2+(1/2)*(D(f))(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*a*y/lambda(y)^2+(1/2)*(D(f))(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*b*y/lambda(y)^2-(1/2)*(D(f))(RootOf(f(_Z)*a*b-f(_Z)*a*y-f(_Z)*b*y+f(_Z)*y^2+lambda(y)^2))*y^2/lambda(y)^2

patmatch(RHS,F::anything*lambda(y)^(n::anything)+H::anything,'la')

true

patmatch(RHS,conditional(F::anything*lambda(y)^(n::anything)+H::anything, not (_has(H,lambda(y)) or _has(n,y))),'la')

Error, (in PatternMatching:-AlgStruct:-Match) string or symbol expected for substring

 

 

Download error_patmatch_april_18_2025.mw

I encountered this issue while writing some code. Here is my code:

numArray := [17, 18, 19];
symArray := [x, y, z];
kronArray := map(i -> local j; symArray[i] = symArray[1]^mul(numArray[j], j = 1 .. i - 1), [$ (1 .. 3)]);

When I run it, I get the following warning:

Warning, (in anonymous procedure created in Typesetting:-FI) `j` is implicitly declared local;

After clicking the LINK  to Maple's help, I saw a similar issue in Example 3. However, Example 3 didn't resolve the problem. How can I declare a variable as local within an anonymous function?

I have a problem calculating integral analytically.

Can anyone help me in this regard?

Thanks

problem_2_integral_&_moshtagh.mw

I wonder what is the general view on this.

Maple tries hard to find analytical solutions by trying different algorithms. Which is very good. But the question is, should it also hang doing this? Should not there be a circuit breaker to prevent the hang?

I mean there must be a limited number of algorithms it tries. So at one point one would expect it will finish and return either no solution or the solution it found.

For this Abel ode   y'=x+y^3, which is known not to be solvable, Maple hangs on 

           > Step 2: calculating resultants to eliminate F and get candidates for 

I waited for almost one hour. Clearly this indicates a problem internally. Right?

There should be some internal checks to prevent this hang I would think.  I do not know where it actually hangs, since trace only shows the last step above.

It will good to find out the cause of the hang and add code to prevent this in a future version of Maple dsolve to make it more robust.

btw, using that another software, it returns instantly on this ode with no solution. May be the other software did not try as hard, but at least it did not hang :)

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1861 and is the same as the version installed in this computer, created 2025, April 10, 15:58 hours Pacific Time.`

restart;

infolevel[dsolve]:=5;
ode:=diff(y(x),x)=x+y(x)^3;
sol:=dsolve(ode,y(x))

5

diff(y(x), x) = x+y(x)^3

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

Chini's absolute invariant is: (1/27)/x^5

differential order: 1; looking for linear symmetries

trying exact

trying Abel

The relative invariant s3 is: x

The first absolute invariant s5^3/s3^5 is: 1/x^5

The second absolute invariant s3*s7/s5^2 is: 0

...checking Abel class AIL (45)

...checking Abel class AIL (310)

...checking Abel class AIR (36)

...checking Abel class AIL (301)

...checking Abel class AIL (1000)

...checking Abel class AIL (42)

...checking Abel class AIL (185)

...checking Abel class AIA (by Halphen)

...checking Abel class AIL (205)

...checking Abel class AIA (147)

...checking Abel class AIL (581)

...checking Abel class AIL (200)

...checking Abel class AIL (257)

...checking Abel class AIL (400)

...checking Abel class AIA (515)

...checking Abel class AIR (1001)

...checking Abel class AIA (201)

...checking Abel class AIA (815)

Looking for potential symmetries

... changing x -> 1/x, trying again

Looking for potential symmetries

The third absolute invariant s5*s7/s3^4 is: 0

 ->         ======================================

 ->             ...checking Abel class D (by Appell)

 -> Step 1: checking for a disqualifying factor on F after evaluating x at a number

Trying x = 1

*** No disqualifying factor on F was found ***

 -> Step 2: calculating resultants to eliminate F and get candidates for C

 

 

Download why_hangs_dsolve_april_18_2025.mw

Occasionally I want to convert 2D-Math input to 1D-Math input. This is either not fully working with comments or changes the format. Example:

Try converting the input below to Maple 1D-Math (select -> right click -> 2D-Math -> convert to -> 1D-Math)

statement

statement

(1)

The*comment*dissapears:

statement;

 

statement

(2)

The Maple Input at the top can be converted by selecting the style C Maple Input from the edit tab but the font changes not to the default font for 1D Math-Input;

statement

statement

(3)

The above is in italic and not in bold. However the default for 1D-Math Input is the following

statement

statement

(4)

 

NULL

Also pasting code with comments in MaplePrimes (function insert code snippet) removes comments.

Any other ways? Ideally, I would also like to convert a whole document in one go, That is probably asked too much.

Download convert_comment_to_1D.mw

Hello
I would like to write a Maple program that gives me all possible sums >=  a given maximum maxsum and with and odd number q >= 3 of distinct summands from a given list. q can be 3, 5, 7, .. t, where t is odd and depends on L and max.

Example:
maxsum:=97, L := [9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87].

Here t= 3 and only q=3 is possible. In the final version of the program the list L and the maxsum will be much larger, so that the sums for every odd q =3, 5, 7, ..., t.

I tried to write a code for this basic case:

q := 3:
p := 91:
L := [9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87]:
M := []:

NestedLoops := proc(startIndex, remainingDepth, currentSum)
    local i;
    if remainingDepth = 0 then
        if currentSum <= p then
            M := [op(M), currentSum]:
        end if;
        return:
    end if;

    for i from startIndex to nops(L) - remainingDepth + 1 do
        NestedLoops(i + 1, remainingDepth - 1, currentSum + L[i]):
    od;
end proc:

NestedLoops(1, q, 0);
M;

The result ist "[]". What is wrong? How would be a correct and efficient version?

Thanks for helping me.

Do you think could be a bug in dsolve? 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1861 and is the same as the version installed in this computer, created 2025, April 10, 15:58 hours Pacific Time.`

restart;

ode:=x^2+3*x*diff(y(x),x)=y(x)^3+2*y(x);
DEtools:-odeadvisor(ode);
dsolve([ode,y(1)=1],[Abel])

x^2+3*x*(diff(y(x), x)) = y(x)^3+2*y(x)

[_rational, _Abel]

Error, (in dsolve) numeric exception: division by zero

 

 

Download dsolve_division_by_zero_abel_april_16_2025.mw

If I do not tell it to use Abel, then dsolve does not give divison by zero.

Maple 2025 on Linux

As shown in the paper, and in many similar ones, the authors use a particular method that I believe is related to the long wave limit. I’m familiar with other approaches, but the traditional methods haven’t been successful in this case. This author, along with a few others, has tried applying this long wave limit approach, though many papers don’t explicitly mention the substitutions they use to arrive at the lump solution.

I’ve been able to separately find the lump series, but for some of the other solutions, we first need to figure out how to derive this key result. Once that part is clear, the rest should be easier to handle. I've been working through everything step by step and have managed to reproduce many of the solutions from the paper.

Also i don't know how finding (eq17) in paper, which they found by apply long wave limit to (eq7) in paper

additionaly How finding line which i think they found by finding velocity?

Please, if you have any information or insight into how we can obtain this more difficult result, I would really appreciate your help.

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

_local(gamma)

NULL

declare(u(x, y, z, t))

u(x, y, z, t)*`will now be displayed as`*u

(1)

declare(f(x, y, z, t))

f(x, y, z, t)*`will now be displayed as`*f

(2)

alpha := 1; beta := 1; delta := 1; lambda := 1

1

 

1

 

1

 

1

(3)

pde := diff(diff(u(x, y, z, t), t)+6*u(x, y, z, t)*(diff(u(x, y, z, t), x))+diff(u(x, y, z, t), `$`(x, 3)), x)-lambda*(diff(u(x, y, z, t), `$`(y, 2)))+diff(alpha*(diff(u(x, y, z, t), x))+beta*(diff(u(x, y, z, t), y))+delta*(diff(u(x, y, z, t), z)), x)

diff(diff(u(x, y, z, t), t), x)+6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-(diff(diff(u(x, y, z, t), y), y))+diff(diff(u(x, y, z, t), x), x)+diff(diff(u(x, y, z, t), x), y)+diff(diff(u(x, y, z, t), x), z)

(4)

thetai := t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i]

eq15 := w[i] = -(k[i]^4+k[i]^2+k[i]*l[i]+k[i]*r[i]-l[i]^2)/k[i]

eq17 := u(x, y, z, t) = 2*(diff(diff(f(x, y, z, t), x), x))/f(x, y, z, t)-2*(diff(f(x, y, z, t), x))^2/f(x, y, z, t)^2

A[sj] := (3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)

F2 := 1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])

(5)

F22 := 1+exp(eta[1])+(3*k[1]^4*k[2]^2-6*k[1]^3*k[2]^3+(3*k[2]^4+l[2]^2)*k[1]^2-2*k[1]*k[2]*l[1]*l[2]+k[2]^2*l[1]^2)*exp(eta[1]+eta[2])/(3*k[1]^4*k[2]^2+6*k[1]^3*k[2]^3+(3*k[2]^4+l[2]^2)*k[1]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]^2*l[1]^2)*exp(-(t*k[1]^4+t*k[1]^2+t*k[1]*l[1]+t*k[1]*r[1]-t*l[1]^2-x*k[1]^2-y*k[1]*l[1]-eta[1]*k[1])/k[1]-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]-eta[2]*k[2])/k[2])/(3*k[1]^4*k[2]^2+6*k[1]^3*k[2]^3+(3*k[2]^4+l[2]^2)*k[1]^2-2*k[1]*k[2]*l[1]*l[2]+k[2]^2*l[1]^2)+exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]-eta[2]*k[2])/k[2])

(7)

indets(F222)

{t, x, y, eta[1], eta[2], k[1], k[2], l[1], l[2], r[1], r[2], exp(-(t*k[1]^4+t*k[1]^2+t*k[1]*l[1]+t*k[1]*r[1]-t*l[1]^2-x*k[1]^2-y*k[1]*l[1]-eta[1]*k[1])/k[1]), exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]-eta[2]*k[2])/k[2]), exp(-(t*k[1]^4+t*k[1]^2+t*k[1]*l[1]+t*k[1]*r[1]-t*l[1]^2-x*k[1]^2-y*k[1]*l[1]-eta[1]*k[1])/k[1]-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]-eta[2]*k[2])/k[2])}

(8)

eq1 := eval(F222, {eta[1] = -1, eta[2] = -1, k[1] = K[1]*epsilon, l[1] = L[1]*epsilon, r[1] = R[1]*epsilon})

exp(-(epsilon^4*t*K[1]^4+epsilon^2*t*K[1]^2+epsilon^2*t*K[1]*L[1]+epsilon^2*t*K[1]*R[1]-epsilon^2*t*L[1]^2-epsilon^2*x*K[1]^2-epsilon^2*y*K[1]*L[1]+epsilon*K[1])/(K[1]*epsilon))+(3*K[1]^4*epsilon^4*k[2]^2-6*K[1]^3*epsilon^3*k[2]^3+(3*k[2]^4+l[2]^2)*K[1]^2*epsilon^2-2*K[1]*epsilon^2*k[2]*L[1]*l[2]+k[2]^2*L[1]^2*epsilon^2)*exp(-(epsilon^4*t*K[1]^4+epsilon^2*t*K[1]^2+epsilon^2*t*K[1]*L[1]+epsilon^2*t*K[1]*R[1]-epsilon^2*t*L[1]^2-epsilon^2*x*K[1]^2-epsilon^2*y*K[1]*L[1]+epsilon*K[1])/(K[1]*epsilon)-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])/(3*K[1]^4*epsilon^4*k[2]^2+6*K[1]^3*epsilon^3*k[2]^3+(3*k[2]^4+l[2]^2)*K[1]^2*epsilon^2-2*K[1]*epsilon^2*k[2]*L[1]*l[2]+k[2]^2*L[1]^2*epsilon^2)+exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])

(9)

G := limit(eq1, epsilon = 0)

exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+2*k[2])/k[2])+exp(-1)+exp(-(t*k[2]^4+t*k[2]^2+t*k[2]*l[2]+t*k[2]*r[2]-t*l[2]^2-x*k[2]^2-y*k[2]*l[2]+k[2])/k[2])

(10)

Download LWL.mw

Where is my question ?  
No reason to delete this...nothing copy righted code 

Hello! How can I plot a tiling of regular 6-gons in Maple, and paint it using three colors?

Maybe someone would be so kind as to share the code for such a tiling.

in try to figure out why in some function i can find this critical point for ploting i need that point , untill now i just find in one function and other i can't and my program not runing for other and really this is make problem for my invistigation i want to fixed that and i upload that file i did and that file i can't find it for , thanks for any help?

line-undone.mw

Line-1-Done.mw

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