## What is substituted here...

I cannot figure out which operand(?) is substituded here

subs(1 = 2, a*b);
2  2
a  b

Same for

subs(1 = 3, a + b);
3 a + 3 b

but

subs(1 = 2, a/b);
2
a
--
b

subs(1 = 3, a - b);
3 a - b

Is this by design?

## how to obtain conditions coulditbe used to obtain ...

Maple's coulditbe  is useful. But unfortunately it does not return back to the user the conditions under which the proposition was found true. This could make it much more useful. It seems in way similar to Mathematica' Reduce but Reduce returns the conditions.

Is there a way to find the conditions which makes it true?

I use coulditbe alot. I use it to verify that the result of odetest (I call it the residue) is zero or not. Maytimes, odetest does not return zero. And using simplify, or evalb or is to check if the residue is zero, all fail. But many times, coulditbe returns true, meaning the residue is zero. But I do not know under what conditions. In Mathematica's Reduce, it tells me the conditions.

Here is one of hundreds of examples I have

restart;
ode:=(t^3+y(t)^2*sqrt(t^2+y(t)^2))-(t*y(t)*sqrt(t^2+y(t)^2))*diff(y(t),t)=0;
ic:=y(1)=1;
sol:=dsolve([ode,ic]);
the_residue:=odetest(sol,[ode,ic]);

You see, odetest says it could not verify the solution (the first entry above) but it did verify the solution against the initial conditions.

Using simplify, evalb and is all also could not verify it

simplify(the_residue[1]);
evalb(the_residue[1]=0);
is(the_residue[1]=0);

Now coulditbe does:

_EnvTry:='hard':
coulditbe(the_residue[1]=0);

So the solution is correct, but I do not know under what conditions. Using Mathematica's Reduce I can find this:

So now back in Maple, I can do this

simplify(the_residue[1]) assuming t>exp(-2*sqrt(2)/3);

0

Actually in this example, just using assume t>0 also gives zero. But I am using Mathematica's result for illustration.

You might ask, why do I need to know for what values of the independent variable is the residue zero?

Because in some cases, the residue is zero only at single point! So it does not make sense to say the solution is verified to be correct only at one single point of the domain, right?

it needs to be some finite range at least. Here is an example of an ode whose solution is correct only at x=0

ode:=diff(y(x),x)=3*x*(y(x)-1)^(1/3);
ic:=y(3)=-7;
sol:=dsolve([ode,ic]);
the_residue:=odetest(sol,[ode,ic]);

And simplify, evalb, is all fail to verifiy this, but coulditbe says true

simplify(the_residue[1]);
evalb(the_residue[1]=0);
is(the_residue[1]=0);
_EnvTry:='hard':
coulditbe(the_residue[1]=0);

So now, we ask, is this solution then correct or not? It turns out to be zero but only at origin x=0

plot(abs(the_residue[1]),x=-1..1)

If I knew that residue is zero only at single point, then I would say this solution is not correct, right?

And that is why I need to know under what conditions coulditbe retruned true.

I tried infolevel[coulditbe]:=5 but nothing more was displayed on the screen.

Mathematica's Reduce confirms that when x=0 the residue is zero.

So my question is simply this: Can one obtain the conditions used by coulditbe to determine when result is true?

It will be useful if Maple could in future version return the value/range which makes it true.

## A numerical algorithm for SFC and its pseudo-inver...

Hi!

I am trying to implement the algorithms given in this paper (free for download) in Maple 2015

https://www.researchgate.net/publication/374636058_A_simple_algorithm_for_computing_a_multi-dimensional_the_Sierpinski_space-filling_curve_generalization

Such algorithms, apparently very easy, provides an approximation of  a sapce-filling curve and its pseudo-inverse. I am interesting in this space--filling curve for its properties. Please, find attached the Maple file, I am not sure if the code of the paper is not fine or I am doing something wrong.

Sierp_v1.mw

## How do I solve ODE system in RK method?...

How to solve and plot a ODE system in RK method.
eq1 := diff(f(x), x, x, x)-(1/2)*Sc*sin(alpha)*g(x)*(diff(g(x), x, x))+(1/2)*x*cos(alpha)*(diff(f(x), x, x))+(1/2)*sin(alpha)*f(x)*(diff(f(x), x, x)) = 0; eq2 := (diff(g(x), x, x, x))/Pm+(1/2)*x*cos(alpha)*(diff(g(x), x, x))+sin(alpha)*f(x)*(diff(g(x), x, x))-sin(alpha)*(diff(f(x), x, x))*g(x) = 0; eq3 := (diff(theta(x), x, x))/Pr+(1/2)*x*cos(alpha)*(diff(theta(x), x))+(1/2)*x*(diff(f(x), x))*(diff(theta(x), x))+sin(alpha)*(x*(diff(f(x), x))-f(x))*(diff(theta(x), x))-Nb*(diff(s(x), x))*(diff(theta(x), x))-Nt*(diff(theta(x), x))^2+(1/4)*Sc*Br*sin(alpha)^2*(diff(f(x), x))^2*(x*(diff(g(x), x))-g(x))+(diff(g(x), x))^2*(x*(diff(f(x), x))-f(x)) = 0; eq4 := diff(s(x), x, x)+S*((1/2)*cos(alpha)*x*(diff(s(x), x))+(1/2)*sin(alpha)*f(x)*(diff(s(x), x)))+Nt*(diff(theta(x), x, x))/Nb = 0

ics := f(0) = 0, (D(f))(0) = 1, g(0) = 0, (D(g))(0) = 1, theta(0) = 1, s(0) = 1; bcs := (D(f))(100) = 0, (D(g))(100) = 0, theta(100) = 0, s(100) = 0

alpha = - 30 degree, Sc = 1.0, Pm = .1, Pr = 6.2, Nb = .1, Nt = .1, Br = .5, S = 1

## LagrangeMultipliers...

Hi, I have an homework where I need to find the highest point and the lowest point on an ellipse form by the intersection of two equations wich are 4x-3y+8z=5 and z^2=x^2+y^2 and I have to use the LagrangeMultiplier command. I get how it works but I can't get the correct form. How should I do it ?

## To overlay one column graph on top of another...

Is it possible overlay one column graph on top of another ? And if, how do I do it?

Regards

I have here a function
"sin(x)/x"

and suppose sin(x)/x = 0
Can I now use MapleAI to retrieve the correct command for this in Maple..could I?

The intersection points with the x-axis are positive and negative multiples of Pi
I have put these in an ordered list, but Maple gives this:
For x domain = -20...20
X := {x = Pi}, {x = 2*Pi}, {x = 3*Pi}, {x = 4*Pi}, {x = 5*Pi}, {x = 6*Pi}, {x = -6*Pi}, {x = -5*Pi}, {x = -4*Pi}, {x = -3*Pi}, {x = -2*Pi}, {x = -Pi};

X := sort(eval~(x, [X]));
X := [, -6 Pi, -5 Pi, -4 Pi, -3 Pi, -2 Pi, -Pi, 2 Pi, 3 Pi, 4 Pi, 5 Pi, 6 Pi]

A strange ranking that Maple comes up with ?

with(NaturalLanguage);
[Explain, GetCommand, GetMath, Query, RawQuery]

GetCommand("give for Maple solve command all options?");
"solve(equations, variables, options);"

Explain("give for Maple solve command all options?");

"Maple is a symbolic and numeric computing environment. Its

"solve" command is used to find solutions (roots) of a given

equation or a system of equations.

There are a number of options (or "parameters") which can be

specified in this command to alter its behavior:

1. `Allsolutions`: This option makes Maple to generate all

possible solutions of an equation.

2. `Real`: This option only provides the real solutions. If

equations do not have real solutions, it will return an

empty set.

3. `Positive`: It only includes positive solutions in the

output.

4. `explicit`: If specified, Maple attempts to isolate roots

and provide an explicit solution for each variable.

5. `assume = real`: This option restrict the solutions to

only real numbers.

6. `parametric`: This option allows Maple to write the

solutions in a parametric form.

7. `avoid ={x = a}`: This option makes solve exclude the

possibility `x = a` as a solution.

8. `MaxDegree = d`: This option allows you to limit the

degree of the polynomial equations to be considered.

9. `maxdepth = d`: This sets a limit on recursive depth to

which the computation should go to seek a solution.

10. `multiplicities`: This option reports multiplicity of the

roots.

11. `solutions = vars`: This option tells Maple to look for

solutions for specific variables.

12. `numeric`: This option makes solve find a numeric

solution to the equation.

13. `symbolic`: This option makes solve find a symbolic

solution to the equation.

14. `simplify`: This option simplifies the solutions returned

by solve.

15. `sqrt`: This option allows square roots in the output.

It is important to note that not all options are suited for

use with all types of equations. Also, the "solve" command

in Maple can be occasionally limited by the complexity of

the equation, and may sometimes fail to find solutions that

more specialized software or methods can find."

## solve sets of equations...

I am trying to solve the following set of equations, I am able to find solutions for a simplified case (b=0) using the command solve but cannot seem to solve it for general b.

Is there a better way to attempt to find a solution?
solve.mw

 >
 >
 >
 >
 >

## how to improve my home made full_simplify() in Map...

Maple does not have full_simplify() command like with Mathematica.

So I figured why not make one?

Here is a basic implementation. All what it does is blindly tries different simplifications methods I know about and learned from this forum then at the end sorts the result by leaf count and returns to the user the one with smallest leaf count.

I tried it on few inputs.

Advantage of full_simplify() is that user does not have to keep trying themselves. One disadvantage is that this can take longer time. timelimit can be added to this to make it not hang.

Can you see and make more improvement to this function?

May be we all together can make a better full_simplify() in Maple to use. Feel free to edit and change.

#version 1.0
#increment version number each time when making changes.

full_simplify:=proc(e::anything)
local result::list;
local f:=proc(a,b)
RETURN(MmaTranslator:-Mma:-LeafCount(a)<MmaTranslator:-Mma:-LeafCount(b))
end proc;

result:=[simplify(e),
simplify(e,size),
simplify(combine(e)),
simplify(combine(e),size),
simplify(evala( combine(e) )),
evala(factor(e)),
simplify(e,ln),
simplify(e,power),
simplify(e,RootOf),
simplify(e,sqrt),
simplify(e,trig),
simplify(convert(e,trig)),
simplify(convert(e,exp)),
combine(e)
];
RETURN( sort(result,f)[1]);

end proc:

worksheet below

 > #version 1.0   #increment version number each time when making changes. full_simplify:=proc(e::anything)    local result::list;    local f:=proc(a,b)       RETURN(MmaTranslator:-Mma:-LeafCount(a)
 > #test cases T:=[(-192*cos(t)^6 + 288*cos(t)^4 - 912*cos(t)^3 - 108*cos(t)^2 + 684*cos(t) - 54)/(4608*cos(t)^9 - 10368*cos(t)^7 + 6208*cos(t)^6 + 7776*cos(t)^5 - 9312*cos(t)^4 - 2440*cos(t)^3 + 3492*cos(t)^2 + 372*cos(t) - 1169), (10*(5+sqrt(41)))/(sqrt(70+10*sqrt(41))*sqrt(130+10*sqrt(41))), ((6-4*sqrt(2))*ln(3-2*sqrt(2))+(3-2*sqrt(2))*ln(17-12*sqrt(2))+32-24*sqrt(2))/(48*sqrt(2)-72)*(ln(sqrt(2)+1)+sqrt(2))/3, (1/2)*exp((1/2)*x)*(cosh((1/2)*x)-cosh((3/2)*x)+sinh((1/2)*x)+sinh((3/2)*x)) ];

 > full_simplify~(T)

 >

## Saving Style Sets & Using Them With "Format>Managi...

I just installed Maple 2024.0 and I discovered a problem in that the "Manage Style Sets" under the "Format" menu DOESN'T WORK!!! Type the following to understand how this feature works and see if you have the same problem:

>?workshhet,documenting,styles

Follow the instructions.  They are pretty simple.  Find a worksheet that has the styles you like and open it up and then save this Style Set in Maple 2024.0.  Then close it.  Open a new worksheet.  Go to "Format" and then click on "Managing Style Sets" and then click on the Style Set file name you saved previously and you will find that it does not set the style set you saved previously.

Another problem you will find is that it doesn't save your Style Set file where it is supposed to save it.  It needs to be saved in a Maple 2024.0 created folder known as "data" and then in a folder under "data" called "stylesets".  I had to manually go find my Style Set file and copy and paste it there.

Please check this out and see if I am wrong.  I use the "Format" "Manage Style Sets" option a lot when I download files from this blog and ".mw"  have fonts size 12 and they default to the nearly impossible to read font!  After I have applied the "Manage Style Sets" I can see what I have! But for some reason in Maple 2024.0 this feature was not tested or something has changed in Maple 2024.0 to break this feature!

## Something about the new function AllGraphs ...

AllGraphs is a new function in Maple 2024. Good things！

However, it seems that most of its functionalities are already provided by NonIsomorphicGraphs, and its speed even lags behind that of NonIsomorphicGraphs

I'm curious about what truly sets this function apart from existing ones. It generates isomorphic graphs if nonisomorphic=falseBut I donot know what its application is. Supporting directed graphs is a new thing, but its speed is not well.

iterator := GraphTheory[AllGraphs](vertices = 6, edges =6..7, connected, nonisomorphic)
s:=[seq(p, p = iterator)]:
nops(s)

Note that this function is suitable for generating non-isomorphic connected graphs with 6 vertices and either 6 or 7 edges. It doesn't hold an advantage in terms of speed， andNonIsomorphicGraphs also provides an iteration option.

## How to draw a streamlines ...

Hello,

I have plotted psi [1] and psi [2] by using contourplot, but I want to show streamline or Flow nets on curves psi[1] and psi[2].

Thanks

streamline.mw

## How to (fully) simplify logical combinations of eq...

Here is a "toy" instance.
As the title suggests, I would like to simplify the following boolean combinations: (Note that the  should be taken into account.)

formula__0 :=
convert(And(
Non(`xor`(Or(0 >- 0, y ** 3=x),
And(((y*x - 0^0)^2 + (y*y - x*x)^2)*(y^2 + x^2) >
0, 0 <- (y**3 - x)*(y - x**3)**3,
`implies`(y + x*2 >= y ** 3*2 + x**3,
Or(y + x < y*y*y + x*x*x)), Not((y**3 - x)*(y - x**3) = 0),
0 >= 0), y <> x*x*x))), 'boolean_function'):

Regretfully, the built-in command simplify is unable to simplify :

simplify(formula__0, assume = real); # only rudimentary simplifications
=

The library function SMTLIB:-Simplify seems to simplify it, but the result is incorrect

(SMTLIB:-Simplify(formula__0) assuming real); # check {y = 1, x = 0}
=
/   /   / 3           3\\\
And\Not\And\y  = x, y = x ///

The only procedure I can find that is capable of rewriting it appears to be RealDomain:-solve

RealDomain:-solve(formula__0, 'allsolutions'); # see below
=
Warning, solutions may have been lost
/            3\    /     3       \    /     3        \
{ x = x, y = x  }, { x = y , y = y }, { y = x , x < -1 },
\             /    \             /    \              /

/     3              \    /     3        \
{ y = x , 0 < x, x < 1 }, { x = y , y < -1 },
\                    /    \              /

/     3              \
{ x = y , 0 < y, y < 1 }
\                    /

Nevertheless, this is more or less overkill, since a complete solution set is somewhat unnecessary, and in practice, an simplified and compact but presumably unsolved form is more applicable to further manipulations. (For example, the simplest form of  (over ℝ²) should at least be x2y2＞1, yet  simply returns , which is definitely unsuitable here.) (A more real example can be found in the Ex３ of this compressed file.)

I believe that this is a common problem; curiously, I cannot find any related questions in this forum. So, are such simplifications (similar to SLFQ) available in Maple?

## Optional parameter naming...

I have a repetative set of parameter names used in procedures in a package. I settled on making all optional inputs in the format {name::type:=something}. Originally I wanted to use non capitalised names for the optional inputs. But the names clash with Maple commands. I have all sorts of quicky abbreviations like prnt etc. These are both messy and tacky. For many of my choices I would seem to have to use capitalised naming to give a meaningful name. The problem here is these names are used in other Maple packages. So sooner or later there is going to be a clash.

Is there a way a of handling this? Like can I defiine package parameter names? Or should I just stick with my abbreviations?

I read somewhere about this problem in the help years ago. I think Basis was the example used in different packages GroebinerBasis and Polynomial package and using PackageName:-Basis to avoid the clash with both loaded. But that is more a command level handling.

 > restart
 >
 > illegal:=proc(x,y,{Point:=[symbol=solidcircle,colour=purple]},{Line:=[colour=green,thickness=2]},{Colour:="Blue"},{Scale:=5},{Print:="y"}) print("1 Point= ",Point);  #I currently use points print("2 Line= ",Line);   #                 linetype print("3 Colour=  ",Colour); #              clr     this has nothing to do with plotting colour print("4 Scale= ",Scale);   #               scl    print("5 Print= ",Print);   #               prnt Scale*x/y end proc
 >
 (1)
 > illegal(3,7)
 (2)
 > illegal(3,7,line=[linestyle=dash,colour=black,thickness=4])
 (3)