Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

i have out come with different coieficent  i can do by hand one by one seperate them and make them equal to zero but how i can make  list of equation  with leading term is apear  too not just the equation i have to know which related the equation and leading term too, then find unkown coiefficient?

system.mw

When solution was obtained using earlier call to solve with _EnvAllSolutions := true: set, then odetest givens internal error.

When _EnvAllSolutions := false: then no error.

Why? And is there a workaround so I can use _EnvAllSolutions := true: but have odetest still work?

interface(version);

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

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.`

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.`

 

Example fail when using _EnvAllSolutions := true:

 

restart;

kernelopts('assertlevel'=2):

ode:=diff(y(x),x) = ln(1+y(x)^2);
IC:=y(0)=0;
x0:=0;
sol:=y(x) = -sqrt(-1 + exp(RootOf(-Intat(-1/(2*tau*sqrt(-1 + exp(tau))*exp(-tau)), tau = _Z) + x + _C2)));

eq:=0=eval(rhs(sol),x=x0);
_EnvAllSolutions := true:
_EnvExplicit := true:
sol_C:=_C2=solve(eq,_C2);
sol:=eval(sol,sol_C);
odetest(%,[ode,IC])

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

y(0) = 0

0

y(x) = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+x+_C2)))^(1/2)

0 = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+_C2)))^(1/2)

_C2 = Intat(-(1/2)*exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = (2*I)*Pi*_Z1)

y(x) = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+x+Intat(-(1/2)*exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = (2*I)*Pi*_Z1))))^(1/2)

Error, (in series/csgn) assertion failed

 

Example Works  when using _EnvAllSolutions := false:

 

restart;

kernelopts('assertlevel'=2):

ode:=diff(y(x),x) = ln(1+y(x)^2);
IC:=y(0)=0;
x0:=0;
sol:=y(x) = -sqrt(-1 + exp(RootOf(-Intat(-1/(2*tau*sqrt(-1 + exp(tau))*exp(-tau)), tau = _Z) + x + _C2)));

eq:=0=eval(rhs(sol),x=x0);
_EnvAllSolutions := false:
_EnvExplicit := true:
sol_C:=_C2=solve(eq,_C2);
sol:=eval(sol,sol_C);
odetest(%,[ode,IC])

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

y(0) = 0

0

y(x) = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+x+_C2)))^(1/2)

0 = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+_C2)))^(1/2)

_C2 = Intat(-(1/2)*exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = 0)

y(x) = -(-1+exp(RootOf(-Intat(-(1/2)/(tau*(-1+exp(tau))^(1/2)*exp(-tau)), tau = _Z)+x+Intat(-(1/2)*exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = 0))))^(1/2)

[RootOf(Intat(exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = _Z)+2*x-Intat(exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = 0))-ln(exp(RootOf(Intat(exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = _Z)+2*x-Intat(exp(tau)/(tau*(-1+exp(tau))^(1/2)), tau = 0)))), 0]

 

 

 

 

Download odetest_fail_when_using_envAllsol_maple_2025_1_oct_21_2025.mw

At the beginning was this problem asked to 11th-12th Grade students:
 

Let C a vertical cylinder of radius RC = 10, and S a steel sphere of radius R = 4.
We place S into C and fill it with water up to the moment the water reaches the top of S.
Let V the volume of the water we used.
We then remove S and replaces it by another steel sphere S' with radius R' <> 4. Could it be that the free surface of the water reaches exactly the top of S'?
If it is so what is then the value of R'?

Mathematically does the equation (𝝅RC2) ⨯ (2R) - (4 𝝅RS3/3) = (𝝅RC2) ⨯ (2R') - (4/3 𝝅R'3), where RC = 10 and R = 4, have other strictly positive solutions than the trivial one R' = R?


The answer here is yes: R' = 5521/2 -2 ≅ 9.7473.. .

When I read this problem, I immediately asked myself the following question "Does a second sphere S' always exists whatever the values RC > 0 and R (0, RC]?".

In the attached worksheet I used two different Maple tools to answer this question:

  • firstly solve+assumptions plus plots:-inequal to visualize the (RC, R) domain where S' exists,
  • next solve/parametric to present another way to get the characterization of this same domain.

The problem is that solve+assumptions and plots:-inequal both give the same correct result but solve/parametric does not.
PlotsInequal_vs_SolveParametric.mw

For this specific problem solve/parametric fails finding the correct result.
Is that a bug or did I misuse it?

Thanks in advance

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

Update

Found out why. This only works if one calls dsolve() first.  Here is an example

sol:=dsolve(diff(y(x),x)=x)

y(x) = (1/2)*x^2+c__1

c__1 - _C1;

0

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

{c__1}

restart;

my_sol:=y(x)=(x^2)/2+c__1;

y(x) = (1/2)*x^2+c__1

c__1 - _C1;

c__1-_C1

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

{}

 

 

Download why_c1_and_C1_not_same_oct_19_2025_V1.mw

But this is really confusing. c__1 before calling dsolve is not the same as c__1 after calling dsolve.

It will be better if Maple is changed such that these work the same all the time without having to call dsolve() first.

Hi again everybody,

Made some easy Maple code to find some special prime numbers.

Namely, positive prmie numbers p 
such that p, p+2, and p+6 are all prime numbers

see prime_triples_p_p_and_2__p_and_6.mw

prime_triples_p_p_and_2__p_and_6.pdf

for your viewing pleasure

Have a good day.

Matthew

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?

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

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

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