MaplePrimes Questions

I need to use a procedure where one of the parameters is a function. Conceptually, this seems straightforward, but I’m encountering unexpected behavior. Here’s a minimal example of my approach:

f1:=proc(t::numeric, fn::function)::numeric;
return fn(t+1)+1
end proc;

However, none of the following calls return the correct result:

f1(2, sin);
f1(2, sin());
f1(2, sin(x));
f1(2, u-> u^2);

Any guidance would be greatly appreciated!

we have a lot term which we add thus term we can get something near to our solution but i don't know how it is work , did any one did pade approximate of series solution?

restart

with(inttrans)

with(PDEtools)

with(DEtools)

with(Physics)

declare(u(x, t), quiet); declare(v(x, t), quiet); declare(U(x, t), quiet)

undeclare(prime)

approx_sol := -8*x + 3 - 208/3*x^3 + 24*x^2 + 2279/15*x^5 + 200*x^4 + 443/63*x^7 + 676/15*x^6 + 62/2835*x^9 + 62/105*x^8

-8*x+3-(208/3)*x^3+24*x^2+(2279/15)*x^5+200*x^4+(443/63)*x^7+(676/15)*x^6+(62/2835)*x^9+(62/105)*x^8

(1)
 

NULL

Download pade-approximate.mw


Hi
I want to plot M versus R=kappa for the mentioned parameters. (I know M must be a real and positive number)
But I couldn't. May someone please review and fix my uploaded file?

m1.mw

It is very strange, but I cannot find in v. 2025 shortcut or a button for stoping current evaluation.

I had no problem with this in previous version, but now the absence of immediate stoping make troubles for me,

Find the circle of maximum radius that is tangent to both curves. 
There are no other conditions or restrictions.
Equations of curves

 (x1-1/2)^4+x1*x2+2*x2^2-1=0; 
 (x1-sin(x1))^2+(x2-sin(x2))^2-1=0;

I seem to recall that a[k] and a(k) are treated interchangeably within a proc.  But I did not expect that to happen at the top level.  See the worksheet below.  Is there a way to keep indexed quantities as indexed?

restart;

kernelopts(version);

`Maple 2025.0, X86 64 LINUX, Mar 24 2025, Build ID 1909157`

A := piecewise(x<0, a[1], a[2]);

A := piecewise(x < 0, a[1], a[2])

int(1/A, x=-1..1);

1/a(1)+1/a(2)

Download mw.mw

I have created an animation of a flexible octahedron (following Bricard) with Maple.   It shows the six vertices and twelve edges.  How do I add the faces (triangles)?  Can the animation show their lines of intersection?

It is not difficult to manually check the validity of the identity  sqrt(x+2*sqrt(x-1)) = sqrt(x-1)+1 , which is true at least for all  x>=1 . I don't know of any Maple command that directly makes this simplification:

expr:=sqrt(x+2*sqrt(x-1));
simplify(expr);
simplify(expr) assuming x>=1;

                          


It was possible to simplify it only by making a variable substitution  x=y+1 (and then a reverse substitution  y=x-1 ) :

expr1:=subs(x=y+1,expr);
simplify(expr1);
subs(y=x-1, %);

                               


By the way,  the CAS Mathematica also cannot cope with simplifying the expression  expr .

I'm working on an optimization problem involving a single decision variable p1, subject to four inequality constraints:

  • Two upper bound constraints:

    p1 < b1,p1 < b2
  • Two lower bound constraints:

    c1 ≤ p1,c2 ≤ p1

Effectively, the feasible region for p1 is:

max⁡(c1,c2)  ≤  p1  ≤  min⁡(b1,b2)

I have already formulated the Karush-Kuhn-Tucker (KKT) conditions for this setup, and now I'm trying to determine:

  1. The optimal value p1∗​

  2. The corresponding feasibility conditions

  3. A case-wise breakdown depending on which constraints are active or inactive


Sheet:  Q_P1_Optimum_condition.mw

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

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