sursumCorda

1279 Reputation

15 Badges

2 years, 341 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@acer Thanks for your detailed reply.

Sometimes it's convenient to perform a given operation in a loop (say, because the operation is in stages and a handy procedure isn't yet written to do each one individually).

I'm not sure if understand this point. Of course, one may pre-allocate storage for the output and write one or more for loops, but people can, in effect, write more compact (and clearer?) codes (with neither pre-allocation nor loops) like: 

(() -> args[-1])(( … ), ( … ), ( … ), ..., ( … )); # do several operations (but put several steps on the same line), and give the result of the last one
MakeFunction(%)( … ... … ); # another way to implement sequences of commands (i.e., a compound expression) rather then fit each step on a separate line

And then simply put the inline object into (nested) seq in a user-friendly way (with less error prone?). It seems that they enable the user to focus (entirely?) on the algorithm instead of the mechanics of either creating a new structure or iterating through loops. (I don't mean that the programming infrastructure is not important. But it appears that if somebody only want to do a small task, writing large amount of code will more or less stifle the initiative and dampen the enthusiasm.)

@Carl Love Thanks.
Besides, the documentation of GraphTheory:-TransitiveReduction states that

the transitive reduction of an graph G is a undirected graph ..., 

which does not seem correct …. 

@lcz Actually, the given digraph has been reduced in advance (so the output should remain unchanged), but as you may have seen, Maple still cannot find correct results. 
By the way, the original G__0 is also a minimum equivalent graph of itself (as it does not contain any cycles). (In cyclic case, see and .) 

@mmcdara Thanks. But in newer Maple's version, it doesn't look very aesthetic:  .

@tomleslie I don't know why the first one just returns an error: 

Optimization:-Minimize(((y + z - 2*x)^2 + (z + x - 2*y)^2 + (x + y - 2*z)^2)/((x - y)*(x - z) + (y - z)*(y - x) + (z - x)*(z - y)), variables = {x, y, z}, initialpoint = {(x, y, z) =~ seq(rand(), 3)});
Error, (in Optimization:-NLPSolve) the objective gradients at the initial point are too small
Optimization:-Minimize(((y + z - 2*x)^2 + (z + x - 2*y)^2 + (x + y - 2*z)^2)/((x - y)*(x - z) + (y - z)*(y - x) + (z - x)*(z - y)), (x, y, z) =~ -infinity .. infinity, initialpoint = {(x, y, z) =~ seq(rand(), 3)});
 = 
Warning, no iterations performed as initial point satisfies first-order conditions
     [    [                    11                      11  
     [6., [x = 9.86211147565 10  , y = 1.95011776142 10  , 

                          10]]
       z = 8.6099052027 10  ]]


The objective function is certainly "flat", but only the second one can find the infimum.

@mmcdara Thanks. But unfortunately, these examples don't work in Maple 2015.2.

@toran I'm not sure if I understand right, but I think that you may check the RootFinding Package (particularly the RootFinding[Isolate] command).

@mmcdara Thanks. May you post its URL? I try to search for this, but I get nothing ….

@mmcdara Thanks. However, I think that these don't explain why Maple's internal verifier fails to check the results returned by the solve command.

Why do you use a deprecated function?
Note that using solve instead doesn't change things, but at least you avoid unnecessary problems. 
# showstat~(solvefor, [24, 83]):

solvefor := proc()
local f, i, j, n, basis, vars, V, Vset, sol, t, result, ResultStack, NewResultStack;
       ...
  24           result := traperror(solve(f,{V}));
       ...
  83       return result
       ...
end proc

As you can see, at least on line 24, solvefor can get the same solutions, so one may hope that this function can immediately process them on the next lines. But unfortunately, its output remains incorrect … What a pity!

@acer Thanks. I find the identical error when Maple calls certain external routines: 

(* omitted *)
trace(SMTLIB:-Satisfiable, statements = false):
coulditbe(m, 0);
{--> enter SMTLIB:-Satisfiable, args = {Or(1 <= n_2, n_2 < 0), m_1 = 0, 0 < m_1-(1/2)*n_2^2+(1/2)*n_2}, timelimit = .25
<-- ERROR in SMTLIB:-Satisfiable (now in \`is/internal/SMTLIB\`) = external linking: error loading external library %1: %2, mplsmtlib.dll, �Ҳ���ָ����ģ�顣\r\n}
{--> enter SMTLIB:-Satisfiable, args = {Or(1 <= n_2, n_2 < 0), m_1 = 0, 0 < m_1-(1/2)*n_2^2+(1/2)*n_2}, timelimit = .25
<-- ERROR in SMTLIB:-Satisfiable (now in \`is/internal/SMTLIB\`) = external linking: error loading external library %1: %2, mplsmtlib.dll, �Ҳ���ָ����ģ�顣\r\n}
                              FAIL

I also believe that the problem lies in the compatibility between SMTLIB:-smtlib_execute and vcredist_x64.exe.

@Thomas Richard Thanks. That is strange indeed. https://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple2020/AdvancedMath#section155 says: 

The is command (as well as coulditbe) now makes use of SMTLIB:-Satisfy to help compute some answers involving real variables.

So I guess that the problem is due to some compatibility issue of the SMTLIB package. 
Besides, I find a related compatibility issue of SMTLIB:-Satisfy before. Can you reproduce the same bug in that example? Actually, if I install the Microsoft Visual C++ 2013 x64 Additional Runtime (not "2015-2022"), those errors will disappear immediately, while if I uninstall the Microsoft Visual C++ 2013 Redistributable (x64) (not "2015-2022"), I'll get those errors again.

@Thomas Richard Thanks for your reply. The documentation of coulditbe says that:

The environment variable _EnvTry can be used to specify the intensity of the testing by the is and coulditbe routines. Currently _EnvTry can be set to normal (the default) or hard. If _EnvTry is set to hardis and coulditbe calls can take exponential time.


Besides, have you installed the Microsoft Visual C++ 2013 x64 Additional Runtime? I find that if I install or reinstall it, such computations will no longer fail immediately, while if I uninstall it, I'll get FAIL again. The problem is: Maple 2023.0, by default, don't install Microsoft Visual C++ 2013 Redistributable (x64), as the directory "<Maple>\redist\" (where <Maple> is the Maple installation directory, i.e., kernelopts(mapledir);) only contains two (rather than six) redistributable files.
But why is there a (hidden) compatibility issue? I cannot find it here.

@vv That's a pity; I don't know why Maple® cannot handle real algebraic functions directly and then give a more readable (but still correct) solution.
Let us see what Symbolic Math Toolbox™ returns: 

MuPAD's_solve

@vv Thanks.

This could be very difficult (or even impossible) to obtain in general.

But how about the poster's question (instead of generalized cases)? 

@vv Thanks. But how do I force Maple to eliminate the dummy variable t3 from the output automatically (instead of by hand later)? Actually, the desired result should resemble piecewise(t1 <= 0, t2 < 0, t1 > 0, t2 <= (1/4)*t1^2).

First 15 16 17 18 19 20 21 Page 17 of 23