Maple 2024 Questions and Posts

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

Is this a valid behvior by int?   

int(A,x,method=_RETURNVERBOSE) hangs.

But  int(simplify(A),x,method=_RETURNVERBOSE) returns in few seconds with "default" result same as int(A,x)

Should this have happen? I try to avoid calling simplify unless neccessary because it can add csgn's and signums and so on to the result. 

But the question is: Should one really need to simplify the integrand to get the result in this example? Does this mean one should call simplify on the integrand to avoid the hang that can show up? 

This only happens when using method=_RETURNVERBOSE 

Just trying to find out if this is normal behavior and can be expected sometimes.

25844

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

restart;

25844

A:=exp(-1/2*cos(2*x))*exp(-sin(x)^2);
int(A,x);

exp(-(1/2)*cos(2*x))*exp(-sin(x)^2)

exp(1/2)*exp(-1)*x

int(A,x,method=_RETURNVERBOSE);  #hangs

int(simplify(A),x,method=_RETURNVERBOSE)

["default" = x*exp(-1/2), "risch" = x*exp(-1/2), "orering" = x*exp(-sin(x)^2-(1/2)*cos(2*x)), FAILS = ("gosper", "lookup", "derivativedivides", "norman", "trager", "meijerg", "elliptic", "pseudoelliptic", "parallelrisch", "parts")]

 

 

Download why_int_hang_unless_simplify_june_15_2024.mw

Hi,

I am exploring the boxplot, and I see that I do not have the option to integrate 2 lists: One for observations and one for frequencies. The BoxPlot command only accepts one list (List A in my example). Is there a way to create the BoxPlot using the 'Obs' and 'Eff' lists? Thank you for your insight

QBoxPlot.mw

Can't figure out what code makes this simplification.
If this simplification works, it will be a part of a larger simplication procedure ( if it not conflicts hopefully) 
vereenvouding_hoe_-vraag_MPF.mw

I was trying to find out why my solution was not validating for this ode. It turned out because I was using solve instead of PDEtools:-Solve. It took me sometime to find this.

This made huge difference on odetest to verify the solution.

This is very simple ode. We just need to integrate once. But first we have to solve for y'(x). 

And here comes the difference. When I used solve to solve for y'(x), odetest did not verify the solution.

When using PDEtools:-Solve, it did.

The difference is how each returned the solution for y'(x). Both have RootOf but written differently and this made the difference.

1) Why solutions are written differently? 

2) Is this to be expected? I have thought Solve uses same engine as solve below the cover.

3) is it possible to make solve give the same form as Solve or change to that form?

I am now changing more of my code to use PDEtools:-Solve because of this.

27860

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1757. The version installed in this computer is 1756 created 2024, June 5, 19:39 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

Using solve

 

restart;

27860

ode:=x-ln(diff(y(x),x))-sin(diff(y(x),x))=0;
RHS:=solve(ode,diff(y(x),x));

x-ln(diff(y(x), x))-sin(diff(y(x), x)) = 0

RootOf(_Z-exp(-sin(_Z)+x))

mysol:= y(x) = Int(RHS,x)+c__1;

y(x) = Int(RootOf(_Z-exp(-sin(_Z)+x)), x)+c__1

odetest(mysol,ode);

-ln(RootOf(_Z-exp(-sin(_Z)+x)))+x-sin(RootOf(_Z-exp(-sin(_Z)+x)))

using PDEtools:-Solve (now it verifies) with no extra effort

 

restart;

27860

ode:=x-ln(diff(y(x),x))-sin(diff(y(x),x))=0;
RHS:=PDEtools:-Solve(ode,diff(y(x),x)):
RHS:=rhs(%);

x-ln(diff(y(x), x))-sin(diff(y(x), x)) = 0

RootOf(-x+ln(_Z)+sin(_Z))

mysol:= y(x) = Int(RHS,x)+c__1;

y(x) = Int(RootOf(-x+ln(_Z)+sin(_Z)), x)+c__1

odetest(mysol,ode);

0

 

 

Download PDEtools_Solve_vs_solve_june_8_2024.mw

 

Update

Here is a counter example. Where now it is the other way around.

Using solve makes odetest happy, but when using PDEtools:-Solve odetest does not verify the solution.  Same exact ODE.   


 

28652

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1757 and is the same as the version installed in this computer, created 2024, June 6, 14:53 hours Pacific Time.`

Example, using solve works

 

ode:=exp(diff(y(x), x) - y(x)) - diff(y(x), x)^2 + 1 = 0;
RHS:=solve(ode,diff(y(x),x));
RHS:=eval(RHS,y(x)=y);
mysol:=Intat(eval(1/RHS,y=_a),_a=y(x))=x+c__1;
odetest(mysol,ode);

exp(diff(y(x), x)-y(x))-(diff(y(x), x))^2+1 = 0

Warning, solutions may have been lost

RootOf(-exp(_Z-y(x))+_Z^2-1)

RootOf(-exp(_Z-y)+_Z^2-1)

Intat(1/RootOf(-exp(_Z-_a)+_Z^2-1), _a = y(x)) = x+c__1

0

Example, using PDEtools:-Solve fails

 

ode:=exp(diff(y(x), x) - y(x)) - diff(y(x), x)^2 + 1 = 0;
RHS:=rhs(PDEtools:-Solve(ode,diff(y(x),x)));
RHS:=eval(RHS,y(x)=y);
mysol:=Intat(eval(1/RHS,y=_a),_a=y(x))=x+c__1;
odetest(mysol,ode);

exp(diff(y(x), x)-y(x))-(diff(y(x), x))^2+1 = 0

RootOf(_Z^2*exp(y(x))-exp(_Z)-exp(y(x)))

RootOf(_Z^2*exp(y)-exp(_Z)-exp(y))

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

exp(RootOf(_Z^2*exp(y(x))-exp(_Z)-exp(y(x)))-y(x))-RootOf(_Z^2*exp(y(x))-exp(_Z)-exp(y(x)))^2+1

 


 

Download PDEtools_Solve_vs_solve_june_9_2024.mw

So now I have no idea which to use. Sometimes solve works and sometimes Solve works. I  guess I have to now solve the ode both ways each time and see which works.

 

Simple question. I hope it has simple answer. I have always thought that what int() returns should match exactly what "default" result shows when using int() with the option _RETURNVERBOSE 

I mean exact match. But this below shows that int() result underwent some simplification as it is not the same as default.

restart;

integrand:=sin(x)/(sin(x) + 1);
maple_result_1 :=int(integrand,x);
maple_result_2 := int(integrand,x,'method'=':-_RETURNVERBOSE')[1]

Ofcourse maple_result_2 can be made the same as maple_result_1

simplify(rhs(maple_result_2)) assuming 0<x and x<Pi;

But this is beside the point. Why is "default" is not excatly the same as int() result?  It seems that int() does something more after obtaining the :"default" result as shown.

Should default not match exactly result from int() ?

Maple 2024.

 

I put together the attached worksheet to help me determine the cheapest way to buy "refreshments" for a party by comparing price and volume of different bottle size options.  The spreadsheet works fine as is.  However, when I right click on the output of line (14) and format pct_difference as percent with 2 decimal places and execute the worksheet, Maple hangs on that line and progresses no further.  This doesn't happen in Maple 2018 but the problem does show up in Maple 2024.  Suggestions please?

cost_comparison_-_liquid_(v01MP).mw

I am stuck this command works seemlessly in Maple:

ThermophysicalData:-CoolProp:-Property(D, T = 20*Unit('degC'), P = 760*Unit('mmHg'), water)

but it does not work in Maple Flow. Does anyone knows why? Thank you so much for your help in the matter.

Hello :) 

I have a math problem, where I first need to use Linear regression to find the equation based on a set of data. I did that, no problem. 

However, in the next part of the problem I need to check if the residuals are under "normal distribution". Usually, I check if a dataset is normally distributed via "QQ-plot", and there will be no problems. But this time, because I need to check the residuals, I need to use the "residualQQplot(data,LinReg)" command to make it happen. But when I read the mean-value, mu, it says "-0," and nothing else? I know it should be "-3,2752*10^-15. 

The standard deviation is correct.

How do I fix this, so the residualQQplot shows me the right result? 

I have attached the worksheet here. worksheet_-_linear_reg_and_residuals_for_normal_distribution.mw

Thank you! 

I can't understand this behavior. Any idea why it happens?

Solve is able to solve equation   f(y)=x+A for y, but can't solve   f(y)=x for y.

This is unexpected for me. I do not see why it can solve it when RHS is x+A but not when RHS is just x.


 

21040

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1745. The version installed in this computer is 1744 created 2024, April 17, 19:33 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

restart;

21040

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x,y)

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

Warning, solutions may have been lost

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x+b,y):
{%}; #to eliminate duplicates

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

{arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, -(1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2)), arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, (1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2))}

 


I can trick it to solve  f(y)=x for y  by asking it to solve f(y)=x+A for y and then set A=0 in the solution. But one should not have to do this. Is this a bug or Am I missing something?

Download why_solve_when_adding_term_only_may_22_2024.mw

Hi,

I'm trying out the 2024 version of Maple and I'm getting the following warning message:

Warning, not a built-in function (`rtable_alias`)

which I didn´t get for the 2023 version. I have no clue where it is coming from since it happens even when I start a new worksheet:

 

 

I've also attached print outs of the same worksheets (from Maple help examples and from Maple Portal), one using Maple 2023 version and the other one using Maple 2024 version so youcould see the warning and some other problems.

I really appreciate if someone would have an idea of what is going on here. Thanks very much in advance.

interpolation_2023.pdf

interpolation_2024.pdf

optimization_2023.pdf

optimization_2024.pdf

Could someone help me understand why Maple hangs solving these two equations when the names of unknowns is c__1,c__2   or the old _C1, _C2?

This worksheets shows this. I had to put timelimit of 90 seconds, else it hangs may be forever.    

This example came from looking at why Maple seems to hang randomly when I run the same problem. I still do not know why, but is seems to have something to do with the use of  lower case c__1 or _C1. 

16020

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1744 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

restart;

dsolve(diff(y(x),x$9)=1,arbitraryconstants=subscripted);

y(x) = (1/362880)*x^9+(1/40320)*c__1*x^8+(1/5040)*c__2*x^7+(1/720)*c__3*x^6+(1/120)*c__4*x^5+(1/24)*c__5*x^4+(1/6)*c__6*x^3+(1/2)*c__7*x^2+c__8*x+c__9

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

.609

Error, (in evalf/hypergeom) time expired

106.125

restart; #try again but do not do the arbitraryconstants=subscripted now.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

106.234

[[]]

106.390

#see? it finisghed instantly now.


Download why_solve_hangs_with_subscripted_may_15_2024.mw

The same thing happens If I use the old _C1 and _C2 instead of c__1 and c__2. It also hangs. 

The following worksheet shows this.  If I change _C1 and _C2 to other symbols, say C1 and C2, then it does not hang. 

Why the names of the unknowns makes difference to solve?
 

18792

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:=[_C1,_C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*_C1)^(1/2)*2^(1/2)/_C1^(1/2))*2^(1/2)/_C1^(1/2) = _C2, 1 = (-exp(2*_C2*_C1^(1/2)*2^(1/2))+1)*_C1^(1/2)*2^(1/2)/(exp(2*_C2*_C1^(1/2)*2^(1/2))+1)]

[_C1, _C2]

.125

Error, (in evalf/cos) time expired

105.218

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*C1)*sqrt(2)/sqrt(C1))*sqrt(2)/sqrt(C1) = C2, 1 = (-exp(2*C2*sqrt(C1)*sqrt(2)) + 1)*sqrt(C1)*sqrt(2)/(exp(2*C2*sqrt(C1)*sqrt(2)) + 1)];
unknowns:=[C1,C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*C1)^(1/2)*2^(1/2)/C1^(1/2))*2^(1/2)/C1^(1/2) = C2, 1 = (-exp(2*C2*C1^(1/2)*2^(1/2))+1)*C1^(1/2)*2^(1/2)/(exp(2*C2*C1^(1/2)*2^(1/2))+1)]

[C1, C2]

105.312

[[]]

105.468

 

 

Download why_solve_hangs_with_OLD_C_also_may_15_2024.mw

Only thing I see in help related to name of symbols to solve for is this:

The solve command solves one or more equations or inequalities for the specified unknowns. The unknowns may be names, including indexed names (though for efficiency reasons, indexed names should be avoided when possible), 

ps. This looks like a bug to me. So I send bug report to Maplesoft support also.

 

pps. I tried this in Maple 2023 and Maple 2022 and same behavior. Could someone with earlier version of Maple try to see if this behavior was there also?   It can possibly be correct that the choice of letter used makes difference for solving equations. I have to use c__1 and c__2 etc.. since these equations come from differential equations and this is what I use for constants of integrations., Otherwise I have to make lots of changes now to use different letters.

Update

did trace on solve using _C1 and _C2 and then using A,B for variables to solve for. Code flow is different. This expalins why it hangs. The flow starts the same until it gets to 

TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order

Then when using _C1 and _C2 the code goes into different path than when using A,B. 

Here is flow when using _C1,_C2.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:={_C1,_C2};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(60,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in _X000001
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > _X000002 > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Transformer:   solving the uncoupled linear subsystem in {_S000003, _X000002}
Linear: solving 2 linear equations
Polynomial: # of equations is: 2
Polynomial: best equation / unknown _S000005*_z1 _X000002 2*_S000001
Polynomial: # of equations is: 1
Polynomial: best equation / unknown -_z1*_S000001+1 _S000003 _z1*_S000001+1
Polynomial: backsubstitution at: 2
Polynomial: backsubstitution at: 1
Main: polynomial system split into 1 parts under preprocessing
Main: subsystem is essentially univariate
UnivariateHandler: subsystem has only one equation
UnivariateHandler: solving as if univariate in _S000002
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Dispatch: dispatching to OnlyIn handler
Transformer:   solving for linear equation in _S000006
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in _S000006
Recurse: recursively solving 1 equations and 1 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in t
Error, (in evalf/hypergeom) time expired

 

This is trace when using A,B

 

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*A)*sqrt(2)/sqrt(A))*sqrt(2)/sqrt(A) =B, 1 = (-exp(2*B*sqrt(A)*sqrt(2)) + 1)*sqrt(A)*sqrt(2)/(exp(2*B*sqrt(A)*sqrt(2)) + 1)];
unknowns:={A,B};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(90,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in A
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > B > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Main: polynomial system split into 1 parts under preprocessing
Main: applying the solver for domain=absolute, engine=traditional
PseudoResultant: 225530 [1 200002087 _S000001] 3 3 151 2 45 0
PseudoResultant: 120059 [2 200004772 _S000003] 2 2 131 0 3 0
PseudoResultant: 134507 [1 700002396 _S000002] 1 1 53 0 3 0
PseudoResultant: -10 [] 0 0 3 0 3 0
PseudoResultant: 1 solutions found, now doing backsubstitution
PseudoResultant: backsubstitution of _S000002
PseudoResultant: backsubstitution of _S000003
PseudoResultant: backsubstitution of _S000001
SolutionsLost: setting solutions lost flag
Main: solving successful - now forming solutions
Main: Exiting solver returning 0 solutions

solve: Warning: no solutions found

 

This is new:

Maple 2024 frozen on opening recent files

Maple 2023 frozen on opening

Maple 2022 frozen on opening start page

Maple 2021 blinking

Maple 2020 opening start page