sursumCorda

1324 Reputation

15 Badges

3 years, 322 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@vv In my opinion, Maple can "evalf" S, but cannot "evalf" s or v (at least in acceptable time); isn't this a bug?

@Thomas Richard Thanks. But since dilog is just a special case of the polylog, why can't Maple handle the expression directly? (And as @vv says, it appears that there are some unexpected limitations in Maple.)

@Christian Wolinski Thanks. But in my opinion, numerical computations may suffer from floating-point errors (theoretically or mathematically). Can Maple carry out those evaluations exactly and symbolically?

@vs140580 If you don't want to write loops, You can use: 

Statistics:-Scale(datainMatrix, center = convert(Statistics:-DataSummary(datainMatrix, output = minimum), list), scale = convert(Statistics:-Range(datainMatrix, list))

I think that what you need is just the Statistics:-Scale command: 

An application for the Scale command is to compute standard scores (z-scores) for a list of values. 
If V is a matrix, the Scale command will scale each column of the matrix.

@nm Thanks. But I think that for comparison, using rtable is more suitable. (In other word, table versus rtable, or array versus Array.)

@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!

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