MaplePrimes Questions

The nice addition added to Maple 2022 in this  post made it clear that c__1 and _C1 are the same under the cover.

But then why in Maple 2025.1 it does not give this?

I found this when I was trying to find constants of integrations in solution of an ode, and used 

                 indets(sol,And(symbol, suffixed(_C, nonnegint))); 

Which did not find the constants of integration, since I happened to have typed the solution using c__1 and not _C1, but I thought they are the same.

Did something change or I still dont understand well the difference between c__1 and _C1 ?

Worksheet below.

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

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

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1881 and is the same as the version installed in this computer, created 2025, October 7, 16:4 hours Pacific Time.`

restart;

sol:= y(x)=-cos(x)/2+sin(x)/2+c__1*exp(-x);
indets(sol,And(symbol, suffixed(_C, nonnegint)));

y(x) = -(1/2)*cos(x)+(1/2)*sin(x)+c__1*exp(-x)

{}

sol:= y(x)=-cos(x)/2+sin(x)/2+c__1*exp(-x);
indets(sol,And(symbol, suffixed(c__, nonnegint)));

y(x) = -(1/2)*cos(x)+(1/2)*sin(x)+c__1*exp(-x)

{c__1}

sol:= y(x)=-cos(x)/2+sin(x)/2+_C1*exp(-x);
indets(sol,And(symbol, suffixed(c__, nonnegint)));

y(x) = -(1/2)*cos(x)+(1/2)*sin(x)+_C1*exp(-x)

{}

sol:= y(x)=-cos(x)/2+sin(x)/2+_C1*exp(-x);
indets(sol,And(symbol, suffixed(_C, nonnegint)));

y(x) = -(1/2)*cos(x)+(1/2)*sin(x)+_C1*exp(-x)

{_C1}

c__1 - _C1

c__1-_C1

addressof(c__1);

36893628553737883996

addressof(_C1);

36893628553623934140

 


 

Download why_c1_and_C1_not_same_oct_19_2025.mw

 

 

 

With the new ribbon interface (and startup-page disabled) I need to open a new worksheet to make opening files by the recent document menu work.

Can someone reproduce this?

I write text in Trebuchet MS. When inserting footers I have noticed that the print preview displays page numbers not with the same font (most likely in Times New Roman).

How to change the font of page numbers and other items in headers and footers?

in here the author get a good outcome i did it but i don't know where is mistake and why the result is not same

pp.mw

pp1.mw

I am attempting to solve an optimization problem using the Karush–Kuhn–Tucker (KKT) conditions, where the objective function is to be maximized subject to a constraint that may or may not be binding. However, when solving the system, the KKT multiplier (μ1​) consistently evaluates to zero, even when the constraint appears to be active. I am unable to determine the optimal value of μ1​ and seek guidance on how to obtain the optimal values of Pn, Pr, and w, as well as the correct condition for μ1​.

``

restart

with(Optimization); with(plots); with(LinearAlgebra)

_local(Pi)

Pi

(1)

``

`π_m` := proc (Pn, Pr, w) options operator, arrow; (Pn-Cn)*(1-(Pn-Pr)/(1-delta))+(Pr-w-Crm)*alpha*(1/2+(1/2)*((Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2+2*w*tau*delta-Cr*i2+Cr*tau-2*i2*tau+2*tau^2-2*w*tau)/(Cr*Pn-Cr*Pr+Cr*delta+4*tau*delta-Cr-4*tau)-i2)/tau)*(1-(Pn-Pr)/(1-delta))-Ce*rho0*(1-(Pn-Pr)/(1-delta)) end proc

proc (Pn, Pr, w) options operator, arrow; (Pn-Cn)*(1-(Pn-Pr)/(1-delta))+(Pr-w-Crm)*alpha*(1/2+(1/2)*((Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2+2*w*tau*delta-Cr*i2+Cr*tau-2*i2*tau+2*tau^2-2*w*tau)/(Cr*Pn-Cr*Pr+Cr*delta+4*tau*delta-Cr-4*tau)-i2)/tau)*(1-(Pn-Pr)/(1-delta))-Ce*rho0*(1-(Pn-Pr)/(1-delta)) end proc

(2)

``

``

NULL

C1 := (((Cr+4*tau)*delta-4*tau+(Pn-Pr-1)*Cr)*rho0+(delta-1)*(i2-tau))/(delta-1) <= w

(((Cr+4*tau)*delta-4*tau+(Pn-Pr-1)*Cr)*rho0+(delta-1)*(i2-tau))/(delta-1) <= w

(3)

NULL

# No equality constraints
 
      f[1] := (Pn,Pr,w) -> (((Cr + 4*tau)*delta - 4*tau + (Pn - Pr - 1)*Cr)*rho0 + (delta - 1)*(i2 - tau))/(delta - 1)-w:

 

# Lagrangian (we want to maximize `&pi;_m` so to minimize -`&pi;_m`

L := -`&pi;_m`(Pn,Pr,w) + add(f[i](Pn,Pr,w)*mu[i], i=1):

dLdPn := collect(diff(L, Pn), [Pn]):
dLdPr := collect(diff(L, w), [Pr]):
dLdw := collect(diff(L, w), [w]):

KKT_conditions := [
                    seq(mu[i] >= 0, i=1),         # Dual feasibility conditions
                    dLdPn = 0,  
dLdPr = 0,
dLdw = 0,                     # Stationarity condition
                    seq(``(f[i](Pn,Pr,w)) <= 0, i=1),  # Primal feasibility conditions
                    add(mu[i]*f[i](Pn,Pr,w) = 0, i=1)  # Complementary slackness
                  ]:

 print~(KKT_conditions):

0 <= mu[1]

 

-1+(Pn-Pr)/(1-delta)+(Pn-Cn)/(1-delta)-(1/2)*(Pr-w-Crm)*alpha*((Cr*i2-Cr*tau)/(Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)-(Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2+2*delta*tau*w-Cr*i2+Cr*tau-2*i2*tau+2*tau^2-2*tau*w)*Cr/(Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)^2)*(1-(Pn-Pr)/(1-delta))/tau+(Pr-w-Crm)*alpha*(1/2+(1/2)*((Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2+2*delta*tau*w-Cr*i2+Cr*tau-2*i2*tau+2*tau^2-2*tau*w)/(Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)-i2)/tau)/(1-delta)-Ce*rho0/(1-delta)+Cr*rho0*mu[1]/(delta-1) = 0

 

alpha*(1/2+(1/2)*((Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2+2*delta*tau*w-Cr*i2+Cr*tau-2*i2*tau+2*tau^2-2*tau*w)/(Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)-i2)/tau)*(1-(Pn-Pr)/(1-delta))-(1/2)*(Pr-w-Crm)*alpha*(2*delta*tau-2*tau)*(1-(Pn-Pr)/(1-delta))/((Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)*tau)-mu[1] = 0

 

alpha*(2*delta*tau-2*tau)*(1-(Pn-Pr)/(1-delta))*w/((Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)*tau)+alpha*(1/2+(1/2)*((Cr*Pn*i2-Cr*Pn*tau-Cr*Pr*i2+Cr*Pr*tau+Cr*delta*i2-Cr*delta*tau+2*delta*i2*tau-2*delta*tau^2-Cr*i2+Cr*tau-2*i2*tau+2*tau^2)/(Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)-i2)/tau)*(1-(Pn-Pr)/(1-delta))-(1/2)*(Pr-Crm)*alpha*(2*delta*tau-2*tau)*(1-(Pn-Pr)/(1-delta))/((Cr*Pn-Cr*Pr+Cr*delta+4*delta*tau-Cr-4*tau)*tau)-mu[1] = 0

 

``((((Cr+4*tau)*delta-4*tau+(Pn-Pr-1)*Cr)*rho0+(delta-1)*(i2-tau))/(delta-1)-w) <= 0

 

((((Cr+4*tau)*delta-4*tau+(Pn-Pr-1)*Cr)*rho0+(delta-1)*(i2-tau))/(delta-1)-w)*mu[1] = 0

(4)

 

NULL


Download Solve_mu1.mw

Maple help does not have an example I could find showing the right way to call method, which is meant to be called only from the constructor the object, before the object is fully build.

Help page does not have such example.

This worksheet shows 3 possible ways to do this. All seem to work fine. I am sure one can come up with more variations.

The question is, which one of these calls is the "right" way?

The method called from the constructor in this example is called process_age().

If someone knows an official Maple documentation showing one example of calling  a proc from constructor that will also help.

Version 1

 

restart;

module person()
   option object;

   local _name::string;
   local _age::posint;

   export ModuleCopy::static := proc( _self, proto::person,
        name::string,age::posint,$)
        _name:=name;
        _age:=process_age(age);
   end proc;

   local process_age:=proc(age::posint,$)::posint;
         age+1;
   end proc;

   export get_age::static:=proc(_self,$)::posint;
          _age;
   end proc;
end module;

module person () local _name::string, _age::posint, process_age; option object; end module

o:=Object(person,"me",99);
o:-get_age()

module person () local _name::string, _age::posint, process_age; option object; end module

100

 

 

Version 2

 

restart;

module person()
   option object;

   local _name::string;
   local _age::posint;

   export ModuleCopy::static := proc( _self, proto::person,
        name::string,age::posint,$)
        _name:=name;
        _age:=process_age(age);
   end proc;

   local process_age::static:=proc(age::posint,$)::posint;
         age+1;
   end proc;

   export get_age::static:=proc(_self,$)::posint;
          _age;
   end proc;
end module;

module person () local _name::string, _age::posint; option object; end module

 

o:=Object(person,"me",99);
o:-get_age()

module person () local _name::string, _age::posint; option object; end module

100

 

 

Version 3

 

restart;

module person()
   option object;

   local _name::string;
   local _age::posint;

   export ModuleCopy::static := proc( _self, proto::person,
        name::string,age::posint,$)
        _name:=name;
        _age:=_self:-process_age(age);
   end proc;

   local process_age::static:=proc(_self,age::posint,$)::posint;
         age+1;
   end proc;

   export get_age::static:=proc(_self,$)::posint;
          _age;
   end proc;
end module;

module person () local _name::string, _age::posint; option object; end module

 

 

o:=Object(person,"me",99);
o:-get_age()

module person () local _name::string, _age::posint; option object; end module

100

 

 

Download correct_way_to_call_method_from_constructor_oct_17_2025.mw

I have a Pascal program. I want to use a Maple program inside the Pascal program when calling it each time. I dont know how to interact Maple with Pascal. For this, could you give me over a small program? Yours Sincerely

The pair of symbols that stand for "isomorphic" and "not isomorphic" - basically equality sign with a tilda on top - seem to be conspicuously absent from all the palettes that I've seen. Is it hidden somewhere I failed to find it or actually absent - and if latter, is there any reason for that ? It seems to be a rather basic symbol, especially compared to much more niche stuff in "Relational" palette. 

Another conspicuously absent symbol is "not a subset". We have good old subset, and a "notSquareSubset" but I couldn't locate the "not a subset" in any palette. 

Less critical but still noticeable is absence of various arrows indicating surjectivity, injectivity and bijectivity. 

Is there perhaps a workaround to typesetting all of the above ? Copying from another document works usually but it's not a very convenient way. And if they are actually absent, perhaps we could ask the good folks at Maple to add them for the next update if it's not too much trouble ?

Isomorphism symbol : ≅
"Not a [proper] subset" symbols :  ⊈ ⊄
Arrows : in LaTex, \rightarrowtail \twoheadrightarrow \twoheadrightarrowtail 
Arrows

在 Maple 2025 中,我可以通过“编辑”菜单更改所选文本或数学表达式的字体,但我不知道如何将我喜欢的字体(例如 Microsoft YaHei)设置为所有新文档的默认字体。创建字符样式时“恢复为默认值”按钮显示为灰色.

How Maple 2023 displays new results with old results together

Help page for structured types shows examples where they add delayed quotes around things. For example

So I started writing  'specfunc(anything,y)' instead of just  specfunc(anything,y). Only to find this breaks things when used inside a proc.

Here is an example.

restart;

#here it worksheetdir
IC:=y(x)=0;
indets(IC,'specfunc(anything,y)');      

y(x) = 0

{y(x)}

#inside proc, same code fail
foo:=proc(func::function(name),IC::`=`)
    local y::symbol:=op(0,func);
    indets(IC,'specfunc(anything,y)');
end proc:
 

foo(y(x),y(x)=0)

{}

 

 

Removing the quotes, it now works

restart;

#here it worksheetdir
IC:=y(x)=0;
indets(IC,'specfunc(anything,y)');      

y(x) = 0

{y(x)}

#inside proc, same code fail
foo:=proc(func::function(name),IC::`=`)
    local y::symbol:=op(0,func);
    indets(IC,specfunc(anything,y));
end proc:
 

foo(y(x),y(x)=0)

{y(x)}

 

 

Download delayed_vs_not_v2.mw

Download delayed_vs_not.mw

It took me 2 hrs debugging to find this, as when I copied code which was working in my worksheet to my function, it stopped working and did not know why.

So for now, I will not use quotes around specfunc or any others like the help page shows in its examples.

Is there a rule of thumb to follow here? The help page is very inconsistent. It shows some examples with quotes around and some without. Makes it hard to know why and when to add the delayed quotes. It seems arbitrary.

When doing variable change for a differential equation, dchange works well for transformations like {s=r sin(theta),z=r cos(theta)}, but it does not seem to work if you include constant values like {s=(k-1)*r sin(theta)}, how can I let maple know that k is to be treated as a constant?

Good day.

Using the iterative map routine, the location of the bifurcation points of the logistic function can be determined using the plot (see attached).

I was wondering .. is it possible to estimate and output the locations of these points and the range of the function? I would like to explore the bifurcation behavior for the modified function so, this would be a great help. 

In this case, the location of the points are: (1.00,0.00), (3.00, 0.66), (3.45, 0.44), (3.45, 0.85) and the range is [0,4]. 

Thanks for reading!

MaplePrimes_Oct_16.mw

I gave up on this. I know how to find all normal derivatives such as diff(y(x),x) and diff(y(x),x$2) so on in expression. 

But now I want to find all those used for initial conditions, which do not have x in them. This makes it harder.

These have the form   D(y)(0) or (D@@2)(y)(1) and so on.

I tried indets and select and many other things, but can't figure how to tell Maple to find these in expression. Here is an example.

Given

expr:=y(3)+y(8)+5*(D@@2)(y)(4)+Pi+3*exp(2)+77*D(y)(0)+1/(D@@4)(y)(7);

I'd like to get list that has in it only the derivatives and nothing else, anywhere they show, which will be

{(D@@2)(y)(4) , D(y)(0) , (D@@4)(y)(7) }

some of the things I tried are

indets(expr,'satisfies'(s->op(0,s)=(D@@n)(y) and n::integer) );
indets(expr,'specfunc(anything, D)');
indets(expr,'specfunc(anything, (D@@anything)(y))');

And many more. I still struggle with structured types in Maple.

In the above, we can assume the dependent variable is always same which is the 'y' symbol.

I can do the above using patmatch. But I am trying to move away from that in Maple and use types.

For reference, this is what I do using another software. I am trying to do the same in Maple, but using structured types and not patmatch.

Iam sure there is a way to do this in Maple using structured types, but so far not able to figure the syntax needed.

Maple 2025.1

I use the tab key to control the formatting of lists. 

On my computer the tab key spacing under Maple 2025 is a little more than one inch which is too much. I have been through the Maple Help and cannot find how to change the tab key spacing.

Any help will be greatly appreciated.

My current account email is dead so I can only view answers here.

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