Maple 2023 Questions and Posts

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

How do I insert an Input Prompt (">")?

On Maple 2023, each new input is marked on the right-hand side as (1), (2), (3), etc.  This is equivalent on WXMaxima as %i1, %i2, %i3, etc.  On WXMaxima, I can left-click between any two previous inputs to insert a new input, for example %i4 might be between %i1 and %i2 if I added %i4 after %i3.  However, I can't seem to do this on Maple.  Is there a way to go back and add a new input between two previous inputs on Maple 2023?

Likewise, I can't seem to add a new input prompt after the last input prompt if the last input prompt has not executed.

Is there a way to express any number in any number base using Maple?

Start with converting any positive real number (rational or irrational) into any positive real number base (rational or irrational), such as: what is "1/65536" in base "999" or what is "sqrt(2)" in base "exp(1)"?

But also for negative, imaginary, and complex numbers: for example, what is "(1/3)-sqrt(3)*I" in base "-Pi*I"?

Specifically, I would like to know what are the first 1024 digits of "exp(1)" in base 16777216, but a general function to convert any number into any base would be preferred.  Base 16777216 is a fun example since each digit can be expressed as a hexadecimal color (from #000000 to #ffffff) on a computer monitor.  Not sure how to get Maple to color the digits automatically though.

It's unfortunate that the "convert/base" feature on Maple only works for integers and bases that are positive integers.

https://en.wikipedia.org/wiki/golden_ratio_base

https://en.wikipedia.org/wiki/negative_base

https://en.wikipedia.org/wiki/quater-imaginary_base

Certainly, ½ cannot be a root of the following equations: 
 

interface(version)

restart;

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

solvefor[x]((x-RealDomain:-`^`(2, -1))*RealDomain:-`^`(x-2*RealDomain:-`^`(3, -1), -1)*(1-sqrt(1-x*(x-2*RealDomain:-`^`(3, -1))*RealDomain:-`^`(RealDomain:-`^`(x-RealDomain:-`^`(2, -1), 2), -1))) = 0)

Warning, solvefor is deprecated. Please use solve command.

 

[x = 0, x = 1/2]

(2)

`~`[limit]((x-1/2)*(1-sqrt(1-x*(x-2/3)/(x-1/2)^2))/(x-2/3), [x = 0, x = 1/2])

[0, undefined]

(3)

solvefor[x]((x-RealDomain:-`^`(2, -1))*RealDomain:-`^`(x-2*RealDomain:-`^`(3, -1), -1)*(1-sqrt(1+3*x*(x-2*RealDomain:-`^`(3, -1))*RealDomain:-`^`(5*RealDomain:-`^`(x-RealDomain:-`^`(2, -1), 2), -1))) = 0)

Warning, solvefor is deprecated. Please use solve command.

 

[x = 0, x = 1/2]

(4)

`~`[limit]((x-1/2)*(1-sqrt(1+3*x*(x-2/3)/(5*(x-1/2)^2)))/(x-2/3), [x = 0, x = 1/2])

[0, undefined]

(5)

``


 

Download solvefor_BUG.mw

But why can't Maple's solvefor rigorously verify (or at least try to check) the solution by itself?
Please note that this issue is irrelevant to the alleged deprecated command. You may reproduce these via :-solve, Degrees:-solveRealDomain:-solvePDEtools:-Solve, etc.

How do I display Unicode characters in Maple 2023?  From the user manual, it seems like this should be supported, but all I see are tofu characters (empty white boxes) and/or question marks.  I have the correct Windows fonts installed for Unicode support and the characters display correctly in Microsoft Notepad.

For example, in sexagesimal (base-60) cuneiform, 1 = 𒐕 (𒐕), 2 = 𒐖 (𒐖), 3 = 𒐗 (𒐗), etc.  If the cuneiform characters display on your web browser, then you should have the correct fonts installed, but they don't display on Maple.  Using the special characters as numerical constants, then you should be able to say in Maple:

𒐕 := 1;
𒐖 := 2;
𒐗 := 3;
𒐕+𒐖;

I tried adding "with(XMLTools):" and "with(StringTools):" but that didn't help, nor did "DecodeEntities("𒐕");".

Even more problematic than simply not displaying the characters, but Maple does not seem to be able to save these characters as constants.  All three characters save as the value "3" instead of 1, 2, and 3, so that the sum of 𒐕 (1) and 𒐖 (2) equals 6 instead of 3.  Something else wrong is that I see two tofu boxes and/or two question marks for a single cuneiform character.  Not sure if this is a bug with Maple 2023.

I seem to have the same problem with က (က) and 𐀀 (𐀀) but not with Ā (Ā) so it looks like maybe there is not full Unicode support for Maple 2023?  𐀀 displays as two missing characters which somehow is already saved as the decimal value 3 whereas က displays as a single missing character with no defined value.

https://en.wikipedia.org/wiki/Babylonian_cuneiform_numerals

https://en.wikipedia.org/wiki/Cuneiform_Numbers_and_Punctuation#Block

I have been using WXMaxima for years and just upgraded to Maple 2023, but I am having a very difficult time adjusting from Maxima to Maple.  Is there a way to make Maple more Maxima-like?

The first problem that I encounter is that "Shift + Enter" and "Enter" should be reversed for people who are used to inputting with Maxima.  I would like to reconfigure Maple so that "Shift + Enter" will be for "Evaluate Expression" and "Enter" will be for "Soft New Line".  This makes inputting multi-line commands (using ":") much easier, so that you "Enter" to add the next line, and then "Shift + Enter" to evaluate.  I thought there was a way to switch these, but I can't find it in the manual.

The next problem is the syntax itself.  "MmaToMaple" will translate Mathematica syntax into Maple syntax, but why is there no equivalent for Maxima?  Maxima/Macsyma is the original computer algebra system (CAS) that inspired both Maple and Mathematica, and being free and open-source, has the widest possible user base (since anyone can use it for free).  Maple needs a way to translate to and from Maxima syntax.  For personal use, I already have a large body of Maxima worksheets saved as plaintext MAC files that I would like to use in Maple.  It will save me a lot of time and trouble if I can import Maxima worksheets directly into Maple.

Is there an easy way to save commonly used Maxima expressions that are not already reserved by Maple, such as "float" (for "evalf") and "%e" (for "exp(1)") so that some Maxima syntax can run directly in Maple?  The only major changes then would be replacing "$" with ":" and ":" with ":=" since ";" is the same in both Maxima and Maple.  Not sure what a "$" means in Maple....

Maple syntax is more similar to Maxima syntax than to Mathematica syntax.  Below is a sample problem that is un-solvable in Maxima (application will crash or run out of memory) but solvable in Maple, to show the differences in syntax.  Unfortunately, it seems that in many cases the Maple syntax is more verbose than the Maxima syntax, requiring more characters to type (such as when defining functions).

/* Maxima syntax */ $
c : 299792458 $
h : 6.62607015E-34 $
k : 1.380649E-23 $
n : exp(1) $
T : 25200 $
P (lmin,lmax) := integrate(2*(c^2)*h/(l^5*(n^(c*h/(k*l*T))-1)),l,lmin,lmax)/integrate(2*(c^2)*h/(l^5*(n^(c*h/(k*l*T))-1)),l,0,inf) $
float(P(380E-9,750E-9));

 

(* Maple syntax *) :
c := 299792458 :
h := 6.62607015E-34 :
k := 1.380649E-23 :
n := exp(1) :
T := 25200 :
P := (lmin,lmax) -> integrate(2*(c^2)*h/(l^5*(n^(c*h/(k*l*T))-1)),l=lmin..lmax)/integrate(2*(c^2)*h/(l^5*(n^(c*h/(k*l*T))-1)),l=0..infinity) :
evalf(P(380E-9,750E-9));

It seems like Maplesoft has gone to a lot of effort to create intercompatibility between Maple and Mathematica, but their real competition is getting customers to upgrade from Maxima (which is completely free and open-source) to Maple (which is non-free and closed-source like Mathematica is).  Making Maple more Maxima-friendly should increase the number of Maple customers by making it easier to upgrade from Maxima to Maple.

The following results should be true or false, but unfortunately, both of them become FAIL (in Maple 2023): 

interface(version)

_EnvTry := hard:

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

assume(`or`(n < 0, n >= 1), m > (1/2)*n*(n-1))

is(m < 0);

is(m > 0)

false

 

FAIL

(2)

coulditbe(m, 0)

FAIL

(3)

NULL


Download Unable_to_prove.mw

Does anyone know why?

I've been trying for so long to fix my code I could've done the math by hand by now. All equations and variables seem to be recognized correctly. Can anyone point out where I made an error? Thanks

Chem.mw

restart; K1 := 10^(-2.12); K2 := 10^(-7.21); K3 := 10^(-12.32); Kw := 10^(-14); NaCl := .5004/(58.44); NaH2PO4 := .1092/(119.98); Na2HPO4 := 1.214/(141.96); Why := Kw = H*OH; Do := K1 = H*H2PO4/H3PO4; It := K2 = H*HPO4/H2PO4; Today := K3 = H*PO4/HPO4; When := Cl = NaCl; Its := Na = NaH2PO4+2*Na2HPO4+NaCl; Due := Na+H = Cl+3*PO4+2*HPO4+H2PO4+OH; Tomorrow := Na2HPO4+NaH2PO4 = H3PO4+H2PO4+HPO4+PO4; z := solve([Why, Do, It, Today, When, Its, Due, Tomorrow], [H, OH, Na, CL, PO4, HPO4, H2PO4, H3PO4]); assign(z)

[]

(1)

Download Chem.mw

This happened on Windows 10 clicking on *.mws documents while Maple 2023 was not running.

My observations with one document (I do not have others at hand at the moment):

No freeze when Maple is already running.

No freeze when the startup page (Start.mw) is disabled.

Older versions opened in Windows file explorer with “right click and open with” did not show this behavior.

Since there are ways to open such old documents, my intention is to document my observations and to find out if others can reproduce it. If not, my setup might differ from default or the file has an issue.

Here is a demonstration involving two decision problems (where evalf is applied to the output for better readability): 
 

interface(version);

restart;

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

RealDomain:-solve({x*y = 3*z^5+4, x^2*y^2-3*x^2*z^2 = 1., x^3+y^3+z^3 = 12})

{x = 2.948903259, y = -2.257458014, z = -1.288554964}, {x = -.7294615910, y = 2.402430460, z = -1.139060479}, {x = .6177631401, y = 2.331476708, z = -.9687540923}, {x = 2.113678892, y = 1.450731881, z = -.7917893433}

(2)

SMTLIB:-Satisfy({x*y = 3*z^5+4, x^2*y^2-3*x^2*z^2 = 1, x^3+y^3+z^3 = 12}, showsmtlib)

(declare-fun x () Real)
(declare-fun y () Real)
(declare-fun z () Real)
(assert (and (= (* x y) (+ (* (* z z z z z) 3) 4)) (= (+ (* (* x x) (* y y)) (* (* (* x x) (* z z)) (- 3))) 1) (= (+ (* x x x) (* y y y) (* z z z)) 12)))
(check-sat)
(exit)

 

Error, (in SMTLIB:-smtlib_execute) external linking: error loading external library mplsmtlib.dll: Ҳ���ָ����ģ�顣

 

RealDomain:-solve({(x^2-2*y*z)*(x^3-y+z) = 0, x^4-y*z^3 = 2., z^4+x^3-2*x*y+3*y*z = 0})

{x = -1.130532018, y = -.1818551573, z = 1.263080805}, {x = 1.123233144, y = .4467032548, z = -.9704268675}, {x = 1.250562423, y = 2.517328867, z = .5615663246}, {x = 2.489770959, y = 16.73009962, z = 1.296110460}, {x = -1.336432744, y = -.7736167557, z = -1.154352246}, {x = 1.209937072, y = 1.655230257, z = .4422187526}

(3)

SMTLIB:-Satisfy({(x^2-2*y*z)*(x^3-y+z) = 0, x^4-y*z^3 = 2, z^4+x^3-2*x*y+3*y*z = 0}, showsmtlib)

(declare-fun x () Real)
(declare-fun y () Real)
(declare-fun z () Real)
(assert (and (= (* (+ (* x x) (* (* y z) (- 2))) (+ (* x x x) (* y (- 1)) z)) 0) (= (- (* x x x x) (* y (* z z z))) 2) (= (+ (* z z z z) (* x x x) (* (* x y) (- 2)) (* (* y z) 3)) 0)))
(check-sat)
(exit)

 

Error, (in SMTLIB:-smtlib_execute) external linking: error loading external library mplsmtlib.dll: Ҳ���ָ����ģ�顣

 

?SMTLIB:-Satisfy


 

Download SMTLIB[Satisfy].mw

As you can see, the SMTLIB:-Satisfy command fails to work in Maple 2023, and I have to install the Visual Studio 2013 (VC++ 12.0) manually. But unfortunately, even if I have installed the vcredist_x64.exe beforehand, the computation still cannot be done in 1000 seconds! (Please note that I just require one real instance rather than all solutions.) Does anyone know why? 
By the way, since the default SMT solver (in Maple 2023) is Z3, will another SMT solver (like cvc5) be supported in future Maple releases?

Hello

In a previous question I asked "How to save all user varibles except for the procedures", now I wonder how to extend that to a procedure that saves all user variables except the user procedures and a list of unwanted variables.     The following procedure

SaveAllVariablesExcept := proc(notsave::set, fileName :: string )
   subs(_NAMES = (remove(type, {anames}(user) minus {anames}(procedure), suffixed(notsave)))[],
        proc() save _NAMES, fileName end proc)()
end proc:

does what I need in a small scale.   For instance 

SaveAllVariablesExcept({'exceptvars','jerkmodel','jerksmon','modelaux','modelname','aaa','allsys','aux','j','s','sys'},s):

does not save the variables listed in the first argument. All other variables, except procedures, are saved.  

Suppose that instead of { 'exceptvars',...} I saved a list of variables using the command exceptvars:={anames}(user) minus {anames}(procedure) in a certain part of the worksheet and issued SaveAllVariablesExcept(exceptvars,s).  SaveAllVariablesExcept no longer works (a suffixed problem) meaning that I don't know how to build a set from {anames}(user) that has the right syntax to be accepted in SaveAllVariablesExcept.  

Of course, alternative solutions are welcome but I wonder if someone out there could explain me how to build the proper exceptvars including exceptvars as well. 

Many thanks.

Converting index expressions to atomic worked.
I then tried to uncheck atomic in the context menu which did not work.

I opened a new worksheet to try it again but now conversion to atomic disappeared from the menu

no_conv_to_atomic.mw

 

A restart of Maple did not bring convert to atomic back. Any idea why this happened and how to restore Maple?

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?

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?

First 26 27 28 29 30 31 Page 28 of 31