Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023

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?

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?

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.

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) ? 

Just wonder if there are any known issues when using dots in Maple code attachment names?

Only issue so far that I can see is that error messages are split a bit strange.

How can i plot stream lines by using velocity components (tx+1, -ty-t^2)? or by stream function?

How can I animate the revolution surface around the red line?

RevolSurfaceQ.mw

While working a test workbook in Maple 2023 - added a file went away for a while and came back and started adding code to the workbook when I suppose it did an autosave and this error came up 4x in a row. 

Hi, 

I am stuck on how to graphically represent my two G and S shapes. Any suggestions to help me illustrate this concept of a ruled surface?

Thank you

SurfaceMP.mw

 

The recent Maple 2023 release comes with a multitude of new features, including a new Canvas Scripting Gallery full of templates for creating interactive Maple Learn documents.

The Maple Learn Scripting Gallery can be accessed through Maple, by searching “BuildInteractiveContent Maple2023” in the search bar at the top of the application and clicking on the only result that appears. This will bring you to the help page titled “Build and Share Interactive Content”, which can also be found by searching “scripting gallery” in the search bar of a Maple help page window. The link to the Maple Learn Scripting Gallery is found under the “Canvas Scripting” section on this help page and clicking on it will open a Maple workbook full of examples and templates for you to explore.

The interactive content in the Scripting Gallery is organized into five main categories – Graphing, Visualization, Quiz, Add-ons and Options, and Applications Optimized for Maple Learn – each with its own sub-categories, templates, and examples.

One of the example scripts that I find particularly interesting is the “Normal Distribution” script, under the Visualizations category.

 

 

All of the code for each of the examples and templates in the gallery is provided, so we can see exactly how the Normal Distribution script creates a Maple Learn canvas. It displays a list of grades, a plot for the grade distribution to later appear on, math groups for the data’s mean and variance, and finally a “Calculate” button that runs a function called UpdateStats.

The initial grades loaded into the document result in the below plot, created using Maple’s DensityPlot and Histogram functions, from the Statistics package. 




 

The UpdateStats function takes the data provided in the list of grades and uses a helper function, getDist, to generate the new plot to display the data, the distribution, the mean, and the variance. Then, the function uses a Script object to update the Maple Learn canvas with the new plot and information.

The rest of the code is contained in the getDist function, which uses a variety of functions from Maple’s Statistics package. The Normal Distribution script takes advantage of Maple’s ability to easily calculate mean and variance for data sets, and to use that information to create different types of random variable distributions.

Using the “Interactive Visualization” template, provided in the gallery, many more interactive documents can be created, like this Polyhedra Visualization and this Damped Harmonic Oscillator – both from the Scripted Gallery or like my own Linear Regression: Method of Least Squares document.


 

Another new feature of Maple 2023 is the Quiz Builder, also featured in the Scripting Gallery. Quizzes created using Quiz Builder can be displayed in Maple or launched as Maple Learn quizzes, and the process for creating such a quiz is short.

The QuizBuilder template also provides access to many structured examples, available from a dropdown list:


As an example, check out this Maple Learn quiz on Expected Value: Continuous Practice. Here is what the quiz looks like when generated in Maple:


 

This quiz, in particular, is “Fill-in the blank” style, but Maple users can also choose “Multiple Choice”, “True/False”, “Multiple Select”, or “Multi-Line Feedback”. It also makes use of all of the featured code regions from the template, providing functionality for checking inputted answers, generating more questions, showing comprehensive solutions, and providing a hint at the press of a button.

Check out the Maple Learn Scripting Gallery for yourself and see what kinds of interactive content you can make for Maple and Maple Learn!

 

Maple 2023: The colorbar option for contour plots does not work when used with the Explore command. See the example below.

No_colorbar_when_exploring_contour_plots.mw
 

First 22 23 24 25 26 Page 24 of 26