MaplePrimes Questions

in this substitution really is hard to substitute which i don't have idea how find u[1]  u[2] so on becuase  in that term some function like u[i,x] appear and i don't have idea how define them to remove it in my iteration ? and how remove the conjugate of function u[0] i did try evalc(u[0]) and make it worst than this 

which i did some special substitution which i don't know true or not but result is true i didn't have other idea for that
which  instead of any conjugate i use v and istead of any diff(u,x) i use z[i,x] and if conjugate have derivative v[i,x]

k4.mw

Hello,

I need to sort a list of monomials in a custom order based on two criteria:

  1. Increasing total degree (e.g., x<x^2)

  2. Lexicographic order within the same degree, using a specified variable order such as x<y<z.

For example, given the list:

L := [z^2, y*z, x*z, z, y^2, x*y, y, x^2, x, 1] 

and the variable order (which can be changed by the user):

vars := [x, y, z]; 

I would like the output to be:

[1, x, y, z, x^2, x*x, x*y, x*z, y^2, y*z, z^2]

Is there a built-in function or a recommended way to achieve this in Maple?

Thank you!

is easy to determine the linear and non linear part but how we can do it by command specially when contain conjugate part of function even i try to use another function instead of conjugate but stil i didn't got  the result?

restart

with(inttrans)

with(PDEtools)

with(DEtools)

with(DifferentialAlgebra)

"with(Student[ODEs][Solve]): "

with(IntegrationTools)

with(inttrans)

with(PDEtools)

with(Physics)

with(PolynomialTools)

with(RootFinding)

with(SolveTools)

with(LinearAlgebra)

with(sumtools)

declare(u(x, t))*conjugate(u(x, t))*declare(v(x, t))

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

 

v(x, t)*`will now be displayed as`*v

 

conjugate(u(x, t))

(1)

pde := u(x, t)+I*(diff(u(x, t), `$`(x, 2)))+2*(diff(u(x, t)*conjugate(u(x, t)), x))*u(x, t)+u(x, t)^2*conjugate(u(x, t))^2*u(x, t) = 0

u(x, t)+I*(diff(diff(u(x, t), x), x))+2*((diff(u(x, t), x))*conjugate(u(x, t))+u(x, t)*(diff(conjugate(u(x, t)), x)))*u(x, t)+u(x, t)^3*conjugate(u(x, t))^2 = 0

(2)

pde_linear, pde_nonlinear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, t) = T*u(x, t)))/T, T) end proc, expand(pde))

() = 0, u(x, t)+I*(diff(diff(u(x, t), x), x))+2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))+u(x, t)^3*conjugate(u(x, t))^2 = ()

(3)

u_occurrences := map(proc (i) options operator, arrow; numelems(select(has, [op([op(i)])], u)) end proc, oppde); linear_op_indices := ListTools:-SearchAll(1, u_occurrences); pde_linear := add(oppde[[linear_op_indices]]); pde_nonlinear := expand(simplify(expand(pde)-pde_linear))

Error, invalid input: ListTools:-SearchAll expects its 2nd argument, L, to be of type {list, rtable}, but received 0

 

[linear_op_indices]

 

Error, (in simpl/relopsum) invalid terms in sum: u(x,t)+I*diff(diff(u(x,t),x),x)+2*u(x,t)*diff(u(x,t),x)*conjugate(u(x,t))+2*u(x,t)^2*diff(conjugate(u(x,t)),x)+u(x,t)^3*conjugate(u(x,t))^2 = 0

 
 

NULL

Download solving.mw

Wondering what the experts here think of this. Should not simplify have worked on this automatically? By trial and error, found that combine command is what simplified it the best.

But I think simplify should also have done the same.  

Interested to hear what others think, and why simplify (even using trig option) did not do it.   

The issue is that this is done in code, without lookin at the screen and deciding what to do based on what the expression "looks like".

interface(version);

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

A:=(((sin(sqrt(3)/2)*sqrt(3) - 3*cos(sqrt(3)/2))*cos(sqrt(3)*x/2) - sin(sqrt(3)*x/2)*(sqrt(3)*cos(sqrt(3)/2) + 3*sin(sqrt(3)/2)))*exp(-1/2 + x/2))/3 ;

(1/3)*((sin((1/2)*3^(1/2))*3^(1/2)-3*cos((1/2)*3^(1/2)))*cos((1/2)*3^(1/2)*x)-sin((1/2)*3^(1/2)*x)*(3^(1/2)*cos((1/2)*3^(1/2))+3*sin((1/2)*3^(1/2))))*exp(-1/2+(1/2)*x)

B:=- exp(-1/2 + x/2)*(sqrt(3)*sin(sqrt(3)*(x - 1)/2) + 3*cos(sqrt(3)*(x - 1)/2))/3;

-(1/3)*exp(-1/2+(1/2)*x)*(3^(1/2)*sin((1/2)*3^(1/2)*(x-1))+3*cos((1/2)*3^(1/2)*(x-1)))

simplify(A-B); #show these are same

0

simplify(A,trig)

-(1/3)*((-sin((1/2)*3^(1/2))*3^(1/2)+3*cos((1/2)*3^(1/2)))*cos((1/2)*3^(1/2)*x)+sin((1/2)*3^(1/2)*x)*(3^(1/2)*cos((1/2)*3^(1/2))+3*sin((1/2)*3^(1/2))))*exp(-1/2+(1/2)*x)

simplify(A)

-(1/3)*((-sin((1/2)*3^(1/2))*3^(1/2)+3*cos((1/2)*3^(1/2)))*cos((1/2)*3^(1/2)*x)+sin((1/2)*3^(1/2)*x)*(3^(1/2)*cos((1/2)*3^(1/2))+3*sin((1/2)*3^(1/2))))*exp(-1/2+(1/2)*x)

simplify(A,size)

-(1/3)*((-sin((1/2)*3^(1/2))*3^(1/2)+3*cos((1/2)*3^(1/2)))*cos((1/2)*3^(1/2)*x)+sin((1/2)*3^(1/2)*x)*(3^(1/2)*cos((1/2)*3^(1/2))+3*sin((1/2)*3^(1/2))))*exp(-1/2+(1/2)*x)

simplify(normal(A))

-(1/3)*((-sin((1/2)*3^(1/2))*3^(1/2)+3*cos((1/2)*3^(1/2)))*cos((1/2)*3^(1/2)*x)+sin((1/2)*3^(1/2)*x)*(3^(1/2)*cos((1/2)*3^(1/2))+3*sin((1/2)*3^(1/2))))*exp(-1/2+(1/2)*x)

combine(A); #finally

(-(1/3)*3^(1/2)*sin((1/2)*3^(1/2)*(x-1))-cos((1/2)*3^(1/2)*(x-1)))*exp(-1/2+(1/2)*x)

 

 

Download simplify_vs_combine_june_4_2025.mw

How can I rearrange the inequality to isolate p1​ on one side?
I'm currently using the 'isolate' function, but it's returning expressions with the signum function.

Q_isolate.mw

This could be unrelated to V 26 of support tools and it could be a bug that existed in Maple before.

But no time for me to check now. Thought to ask about it before I forget.

When adding Physics:-Setup('assumingusesAssume'=true):  Maple generated internal error that can not be cought.

This is using latest V 26 of support tools

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 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 26 and is the same as the version installed in this computer, created June 3, 2025, 23:49 hours Eastern Time.`

restart;

ode:=diff(y(x),x) = (ln(y(x))^2+2*_C1)^(1/2)*y(x);
sol:=y(x) = exp((-2*_C1)^(1/2));
try
   timelimit(30,(odetest(sol,ode) assuming positive));
catch:
   print("cought error ok");
end try;

diff(y(x), x) = (ln(y(x))^2+2*_C1)^(1/2)*y(x)

y(x) = exp((-2*_C1)^(1/2))

-(ln(exp(I*2^(1/2)*_C1^(1/2)))^2+2*_C1)^(1/2)*exp(I*2^(1/2)*_C1^(1/2))

restart;

ode:=diff(y(x),x) = (ln(y(x))^2+2*_C1)^(1/2)*y(x);
sol:=y(x) = exp((-2*_C1)^(1/2));
Physics:-Setup('assumingusesAssume'=true):
try
   timelimit(30,(odetest(sol,ode) assuming positive));
catch:
   print("cought error ok");
end try;

diff(y(x), x) = (ln(y(x))^2+2*_C1)^(1/2)*y(x)

y(x) = exp((-2*_C1)^(1/2))

Error, (in type/complex) too many levels of recursion

 

 

Download type_complex_recursion_june_4_2025_V26_support.mw

Doing multibody analysis on a ridig body results in

Turning quaternions on

Since I do not understand quaternions very well I was wondering why q0 is listed two times (why does the system uses 8 generalized coordinates for 7 degrees of freedom).

Ridig body help says about quaternions:Indicates whether the 3-D rotations will be represented as a four parameter quaternion or as three Euler angles.  Regardless of the setting, the initial conditions are specified with Euler angles.

Is that representation only internal? Can quaternions be probed?

To familarize myself with quaternions in MapleSim I would be greatfull for any examples using them. Are there any?

In which situations shall I use quaternions in MapelSim?

And what by way the stands q0slack in the above screen shot for?

I was debugging another Maple problem and found this.

According to help, it says

Computations performed using assuming do not affect computations performed before or after calling assuming.

But this example below shows this is not the case at all.

I used hasassumptions(y(x)); before calling a command that uses assuming, and it gave false as expected since there are no assumption put on y(x).

After the command is complete, now I find that  hasassumptions(y(x)); returns true  which is wrong. 

This only happens when adding Physics:-Setup('assumingusesAssume'=true); and also when the command that uses assuming timesout.

But from help, this should not cause this. Here is the help on this

assumingusesAssume
  true or false.

The default for this option is true, so that, when Physics is loaded, the Maple assuming command uses Physics:-Assume to place temporary assumptions. This makes the assuming command fully compatible with the Physics, DifferentialGeometry, DifferentialAlgebra and VectorCalculus packages. It is recommended to not change this setting. If assumingusesAssume is set to false, temporary assumptions placed by assuming are placed using the assume command, which redefines the variables receiving assumptions, so that, depending on the computation, the commands of these packages mentioned will fail in recognizing them within expressions (for example: when placing assumptions on the coordinates and computing with the spacetime metric).

Could someone please explain in very simple terms (as I find all this very confusing), why that after calling a command which uses assuming, I find my variables have assumption still attached to them? 

Because of this, commands that uses these variables after this will and could fail depending on what command is used.

This explains many of the problems I am seeing when using assuming command.  

My question is simple: Should any variable which did not have assumptions on it, still not have assumptions on it after using assuming regadless if the command that uses assuming timedout or not?

Notice that I am not even using the Physics package explicitly anywhere in the following. I am just called odetest with timeout.

Here is worksheet to illustrate this.

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 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 23 and is the same as the version installed in this computer, created June 2, 2025, 12:08 hours Eastern Time.`

restart

 

#this shows no assumptions on y(x);
ode:=y(x)*sqrt(1 + diff(y(x), x)^2) - a*y(x)*diff(y(x), x) - a*x = 0:
sol:=-_C4^2 + (-y(x)*sqrt(_C4^2/y(x)^2) + a*x)^2/a^2 + y(x)^2 = 0;
hasassumptions(y(x));
getassumptions(y(x));

-_C4^2+(-y(x)*(_C4^2/y(x)^2)^(1/2)+a*x)^2/a^2+y(x)^2 = 0

false

{}

#now use a command that uses assuming
Physics:-Setup('assumingusesAssume'=true):
timelimit(10,(odetest(sol,ode,y(x)) assuming integer)):

Error, (in simplify/sqrt/local) time expired

 

#this shows that y(x) has assumptions still stuck on it.

hasassumptions(y(x));
getassumptions(y(x));

true

{a::integer, x::integer, (-(-csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0, ((csgn(1/y(x))*a*x-(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)-x)::0, ((csgn(1/y(x))*a*x+(y(x)^2*a^4+csgn(1/y(x))^2*a^2*x^2+a^4*x^2-y(x)^2*a^2-a^2*x^2)^(1/2))/(a^2-1)+x)::0}

 

 

Download why_variable_have_assumption_june_3_2025.mw

My quess is this: Because the command that uses assuming timedout, Maple failed to remove/clear any temporary assumptions it added to the variables involved.   But this only happens when using Physics:-Setup('assumingusesAssume'=true):

If the command did not timeout, this does not happen. At least on some examples I tried this on.

Dear All,

I am facing some problems. This kind of error has been shown: "Error, attempting to assign to `D` which is protected.  Try declaring `local D`; see ? protect for details."

RSM_model.mw

restart;
with(geometry);

triangle(ABC, [point(A, a, b), point(B, c, d), point(C, e, f)]);
AreCollinear: hint: could not determine if a*d-a*f-b*c+b*e+c*f-d*e is zero
Error, (in geometry:-triangle) not enough information: the three points might be AreCollinear

assume(a*d - a*f - b*c + b*e + c*f - d*e <> 0);

triangle(ABC, [point(A, a, b), point(B, c, d), point(C, e, f)]);
                              ABC

area(ABC);
                   

What does the ~ after the point variables supposed to mean?

Hello, 

I'm working on a Maple package that manages external processes via TCP connections. I'm using ModuleUnload for cleanup, but I need to better understand how it behaves during Maple termination.

The issue:
- I have a module that manages external processes (via TCP connections)
- I implemented ModuleUnload to kill these processes when the module is unloaded
- ModuleUnload works perfectly when using 'restart' 
- However, when closing the Maple window, the external processes remain active

Investigation:
Using 'lsof', I observed that:
   - When Maple closes, it properly closes its TCP connection (goes to CLOSE_WAIT state)
   - But the external processes remain active

Questions:
1. Is this the expected behavior of ModuleUnload during session termination?
2. Are there alternative approaches to ensure cleanup when Maple is closed?

Any insights or suggestions would be greatly appreciated!
Thanks!

After updating to V 22 of supportTools, I found a new error.

This works sheet using V 22 gives this

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 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 22 and is the same as the version installed in this computer, created May 28, 2025, 23:36 hours Eastern Time.`

restart;

IC:=y(2) = 2;
ode:=diff(y(x),x) = (x-y(x))^(1/2);
sol:=y(x) = -(LambertW(-exp(-1/2*x))+1)^2+x;

y(2) = 2

diff(y(x), x) = (x-y(x))^(1/2)

y(x) = -(LambertW(-exp(-(1/2)*x))+1)^2+x

odetest(sol,ode) assuming positive;

Error, (in property/AndProp/+) too many levels of recursion

odetest(sol,[ode,IC]) assuming positive;

Error, (in AndProp:-UseCache) too many levels of recursion

 

 

Download bug_in_odetest_with_lambertW_june_2_2025.mw

But same code works OK in V 21

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 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 22. The version installed in this computer is 21 created May 28, 2025, 23:36 hours Eastern Time, found in the directory /home/me/maple/toolbox/2025/Maple Customer Support Updates/lib/Maple`

IC:=y(2) = 2;
ode:=diff(y(x),x) = (x-y(x))^(1/2);
sol:=y(x) = -(LambertW(-exp(-1/2*x))+1)^2+x;

y(2) = 2

diff(y(x), x) = (x-y(x))^(1/2)

y(x) = -(LambertW(-exp(-(1/2)*x))+1)^2+x

odetest(sol,ode) assuming positive;

-csgn(LambertW(-exp(-(1/2)*x))+1)*LambertW(-exp(-(1/2)*x))-csgn(LambertW(-exp(-(1/2)*x))+1)+LambertW(-exp(-(1/2)*x))+1

odetest(sol,[ode,IC]) assuming positive;

[-csgn(LambertW(-exp(-(1/2)*x))+1)*LambertW(-exp(-(1/2)*x))-csgn(LambertW(-exp(-(1/2)*x))+1)+LambertW(-exp(-(1/2)*x))+1, 0]

 

 

Download no_bug_in_odetest_with_lambertW_june_2_2025.mw

Given two optimality conditions defined as inequalities — a lower bound condition and an upper bound condition — under the assumptions that all parameters are positive and satisfy the relationships w>Pu>Ce>U[0]>0, and w>Pu>Ce,   and upsilon,varphi, tau0, eta are between (0,1), where 1>=varphi>=tau0>=0. and upsilon>eta

Under what conditions on the parameters does the lower bound condition become violated while the upper bound condition is also violated?

Detailed question in sheet attached: Q_Condition.mw

[ see also Q_Const.mw ]

This is not a big deal, but I was wondering why it changed. Before, after doing SupportTools:-Version(latest); to get latest version, the message used to say to just do restart; to use the new version of SupportTools (i,e. no need to close all of Maple). (I remember this, but I have no screen shot now to show this old message). I always used to just do restart; and it always worked.

Now, with version 22, the message changed, it now says to close and restart all of Maple

Why this change happened?  

Maple 2025 on Linux

I have a symbolic block matrix equation that I am trying to solve. Maple doesn't respect non-commutativity when solving.

I've tried to use 'Matrix' assumptions. I've also tried using the Physics package's Setup(noncommutativeprefix).

Both of these do not respect the order of multiplications (even using the dot operator for multiplication).

I've posted a minimal example below.

with(Physics)

Setup(noncommutativeprefix = {v, y})

[noncommutativeprefix = {v, y}]

(1)

NULL``

expr := y__xx.v__x = y__xu.y__uu.v__u

y__xx*v__x = y__xu*y__uu*v__u

(2)

soln := solve(expr, [v__u])

[[v__u = y__xx*v__x/(y__uu*y__xu)]]

(3)

op(rhs(soln[][]))

y__xx, v__x, 1/y__uu, 1/y__xu

(4)

NULL

Download noncommutative_example.mw

Does anyone know of a way to make this come out in a sensible fashion?
Thanks for the help!

2 3 4 5 6 7 8 Last Page 4 of 2421