MaplePrimes Questions

Hi,

i use an OpenMaple environment for my academic activity. Especially for plotting of results outside of Maple GUI. Until version 2023 everything was nice and working. But in 2023 calling of Maplets kills Maple 2023 and of course my jobs. Example to try:

#include <stdio.h>
#include <stdlib.h>

#include "maplec.h"

 /* callback used for directing result output */
static void M_DECL textCallBack(void *data, int tag, const char *output)
{
   printf("%s\n", output);
}

int main(int argc, char *argv[])
{
   char err[2048];  /* command input and error string buffers */
   MKernelVector kv;  /* Maple kernel handle */
   MCallBackVectorDesc cb ={textCallBack,
      0,   /* errorCallBack not used */
      0,   /* statusCallBack not used */
      0,   /* readLineCallBack not used */
      0,   /* redirectCallBack not used */
      0,   /* streamCallBack not used */
      0,   /* queryInterrupt not used */
      0    /* callBackCallBack not used */
   };
   ALGEB r, l;  /* Maple data-structures */

   /* initialize Maple */
   if((kv=StartMaple(argc, argv, &cb, NULL, NULL, err))==NULL) {
      printf("Fatal error, %s\n", err);
      return(1);
   }
   r=EvalMapleStatement(kv, "with(Maplets[Elements]): SimpleMaplet:=Maplet([Button('Close', Shutdown())]): Maplets[Display](SimpleMaplet):");
   StopMaple(kv);

   return(0);
}

Working in Maple 2020-2022, crashes in 2023

After a long investigation i found that the problem focuses in maple.dll.

It is only for me, or it is a general bug?

Update:

The newest Maple Update 2023.1 still have this problem ...

The newest Maple Update 2023.2 still have this problem ...

Will be this error sometime fixed?

The QuantifierElimination package has been added in Maple 2023.
However, in the following example, the old (yet not obsolete) RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination command can solve the problem, but strangely, the new QuantifierElimination:-QuantifierEliminate command simply returns an error. 
 

restart;

RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(:-`&A`([x, y, t]), :-`&implies`(:-`&and`(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho), output = rootof)

rho <= 1/3

(1)

QuantifierElimination:-QuantifierEliminate(:-forall([x, y, t], :-Implies(:-And(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho)))

Error, (in CADCell:-CCHILD) intervals the same at this precision

 

Digits += 5:

RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(:-`&A`([x, y, t]), :-`&implies`(:-`&and`(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho), output = rootof)

rho <= 1/3

(2)

QuantifierElimination:-QuantifierEliminate(:-forall([x, y, t], :-Implies(:-And(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho)))

Error, (in convert/RootOf) there is no root of 3*_Z^2-1 in -348986823692397556565591/604462909807314587353088 .. -174493411846198778282755/302231454903657293676544

 

NULL


 

Download QEbug.mw

Code: 

QuantifierElimination[QuantifierEliminate](forall([x, y, t], Implies(And(x^3 + y^2 - x = t, And(t^2 = 4/27, t < 0)), x^2 + y^2 >= rho)));

So, is there any bug in Maple's QuantifierElimination package?

int((4*h1*lambda*k*BesselK(0, k*Zeta)/Zeta^3)*Zeta*BesselK(1, alpha*Zeta), Zeta = 1 .. infinity)

Can any one help me to find the values of this integral?

Hi, 
I met a an unexpected behaviour of a procedure when the parameter sequence contains the type ':-RandomVariable':  

restart:
with(Statistics):
f1 := proc(A::':-RandomVariable')
  Mean(A)
end proc:

Z := RandomVariable(Normal(mu, sigma)):
hastype(Z, ':-RandomVariable');
f1(Z)
                              true
Error, invalid input: f1 expects its 1st argument, A, to be of type 'RandomVariable', but received _R
# Another attempt
f2 := proc(A)
  if hastype(A, ':-RandomVariable') then Mean(A) end if;
end proc:

f2(Z)
                               mu

Why does f1 generate this error?

Type_RandomVariable.mw

As you can see, if I want to simplify the following expression, I shall have to run the simplify command three times, and if I add some assumptions, the global simplify command will no longer work! 

:-simplify(2*(x^2+1)^(1/2)*(x+y+(x+y)/(x*y-1))^2/(((1/2)*(x+y+(x+y)/(x*y-1))*(2*x+(x+y)/(x*y-1)+y)/(x^2+1)^(1/2)-(1/2)*(2*x+(x+y)/(x*y-1)+y)*(y+(x+y)/(x*y-1))/(x^2+1)^(1/2)+(x+y+(x+y)/(x*y-1))/x)^2*x));


Download collect_and_recurse)_invalid_arguments_to_coeffs_.mws

But here either Physics[Simplify] or evala@Simplify works (with a slightly different result, though). Does anyone know why?

In Flow the display command only works with one plot. with two I get an error message.

  "( in Flow:-EvaluateMath) too many levels of recursion"

Vertex disjoint paths are paths that only share their first and last vertices.  In Maple, we can compute the maximum number of pairwise vertex disjoint paths from x to y by the function MaxFlow.  

For example:

with(GraphTheory):
with(SpecialGraphs):
g:=IcosahedronGraph():
HighlightVertex(g, {1,7},"DodgerBlue"):
DrawGraph(g);
g1:=MakeWeighted(g);
mxf:=MaxFlow(g1,1,7)

5

Matrix(12, 12, [[0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0]])

So  we know that the maximum number  of vertex-disjoint paths between vertices "1" and "7" is 5. 

But can we obtain more information from MaxFlow, such as finding  five (i.e., the maximum number) vertex-disjoint paths between vertices "1" and "7" ? (These five paths may not be unique.)

Here is a set of five vertex-disjoint paths connecting vertices "1" and "7" that I observed manually, each marked with a different color.

Hi every one

Let F= [x^2-z^2, x*y+y*z, x*z-y*z, y^2+y*z,w^2] be a special list of monomials and binomials. How to convert F into the following list:

FF=[x^2=z^2, x*y=-y*z, x*z=y*z, y^2=-y*z,w^2=0]. Please note that the left side of each equation of FF is greater than the right side w.r.t. lex ordering plex(x,y,z,w). 

Thank you in advance.

I would like to simplify the following (very simple) expression:

e1:= -(b*(b^2 - 4*a*c)^(1/2) - 4*a*c + b^2)/(2*a*(b^2 - 4*a*c)^(1/2))

whis is exactly equal to

e2: = -(b + (b^2 - 4*a*c)^(1/2))/(2*a)
simplify(e1-e2)
0


But the "simplify" command is not able to produce expression "e2". Is there any general way how to enforce simplifying to get expected result?

Take the following expression:

Why does Maple simplify it to:

instead of the following, like the other math software does it:

While Maple uses , the other software does , which I find easier to read.

It's not a big difference, but I find positive expressions easier to read. Is there a way to change this behaviour or to work around it?

My world of trigonometric functions has a very simple structure: sin, cos and tan are what I need.

That's why I very much welcomed the simplification of sin/cos to tan recently introduced with Maple 2023.

What I neither need nor want is the simplification of 1/sin and 1/cos to sec and csc. I'm not used to that (and probably won't get used to it).

Can this simplification to sec and ccs be turned off (and preferably the simplification to tan be kept)?

Another very strange behavior.

res:= x^2 + x + 1 + 1/3*x^3 + 1/12*x^4 + 1/60*x^5 + 1/360*x^6 + 1/2520*x^7;
sort(res);

#and now
res

Without trying it, what do you expect the output of the last line above to be?  The same as the first one, right?  But that is not what Maple gives. Maple now changes res to always be sorted, even though I have not reassigned it.

Does this mean if one calls sort(), then all the variables that contains polynomials will also be sorted automatically?

Unable to upload worksheet. So here is screen shot

 


Download sort_problem.mw

These give errors

limit(y(0),y(0)=1)

limit(y(x),y(x)=1)

Error, (in limit) limit variable previously assigned, 2nd argument evaluates to y(0) = 1
 

One has to write 

limit(y,y=1)

But why? Is this because y(x) is not considered "algebraic" ? 

Mathematica has no problem with either one of these

I found this when I was trying to find the limit at initial conditions, when x=0 and y(0)=1 and wanted to take the limit on both x->0 and y(0)->1 

I can easily code around this, by renaming y(0) to say Y0 and then the limit will work.

It just seems to be unnecessary restriction of the limit() command parsing ability. 

What is the logic behind not allowing one to write limit(y(x),y(x)=1) ? 

My problem is as follows:

With the Statistics package (or whichever other package) I will do a PolynomialFit on some data. This will result in a function, e.g. x^2. How do I assign this output (which appears to be the function only, no other bells attached) to an actual function which I can later refer to (I want to do as follows):

with(Statistics)

f(x):=PolynomialFit(n, DATA, variable)

f(3) = 3^2

See the attached screenshot for what actually happens:

It appears as if it tries to run PolynomialFit but with a different argument when I do this.

Help would be appreciated as to how I can define the output of PolyFit as a function.

Many times, I can create the drawing for physics problems. But sometimes, it is just too lengthy to do. And the tools are limited. For example, you cannot draw an arc circle to represent the angle between two vectors. You can look at a simple drawing that I made (see included document). You will see that to draw the rotation vector that shows in what direction the axis rotate. I had to draw it with the pen and this is never beautiful. So if someone knows of a pretty good software (free is even better but at least not too expensive), I would really appreciate.

3-D_rotating_axes.mw

First 85 86 87 88 89 90 91 Last Page 87 of 2297