sursumCorda

1239 Reputation

15 Badges

2 years, 232 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@sand15 Cheers. I believe the "smooth" means "antialiased", but I'm unfamiliar with these technical terms, and don't know how to define them.

@lcz Thanks. Maybe Maple is more geared towards graph computations rather than graph representations. I'm not familiar with Gephi, but it looks superb. At present, if I really wanna plot a graph emphasizing layered structure in Maple, I have to specify the co-ordinates of the vertices manually only after obtaining vertex placement in Mathematica (using GraphEmbedding). This vexed matter is very irritating.

@sand15 I think that the third line is with(ComputationalGeometry):. Also, the boundary is less smooth, but this is a constructive approach indeed. Thanks!

@acer This time the boundary is very rough (in contrast to Mathematica's default output). However, these approaches are not so easy-to-use. (What about other possible ways?) It is often alleged that there exists an inverse relationship between the power of the tool and how easy it is to use. Still, I wish there to be a more intelligent Maple functionality in this respect.

@mmcdara Thanks as well. It seems that if we hope to transform a complicated plot, this approach may fail. Am I correct in saying this?

@acer Thanks very much. I never knew these before. But I wonder why plottools[transform] works in the first example instead. Any distinctions?

Are your codes correct? An error is issued at last:  By the way, running these on my computer takes about 32 minutes!

@C_R Thanks. It's very strange indeed—It appears that using the standard plot is always recommended.

@mmcdara Incidentally, an alternative method of the given problem is using certain CAD-based algorithms: 

try
    unwith(Logic):
catch:
    ;
finally
    RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(&E [x, y, a], ((x^3 + y^2 - x = a) &and (a^2 = 4/27) &and (a < 0)) &and ((x^2 + y^2 = R^2) &and (R >= 0)), 'output' = 'rootof');
end try;
               /    1  (1/2)\     /2  (1/2)     \
               |R = - 3     | &or |- 3      <= R|
               \    3       /     \3            /

Nonetheless, this is really beyond layman's ken (despite its correct result).

Unfortunately, extrema just returns (constrained) relative extrema of n algebraic expression; the "extreme values" must be checked later. In addition, in this problem, x, y, and z are all positive real numbers, so you need at least

extrema(x^2*y^2*z^2, x^2 + y^2 + z^2 = 6, {x, y, z}, 'S');

or 

Student[MultivariateCalculus][LagrangeMultipliers](x*y*z, [x + y + z - 6, -sx^2 + x, -sy^2 + y, -sz^2 + z], [x, y, z, sx, sy, sz], output = detailed);

for exact solutions.

@Carl Love But just take about 0.4s in MMA: So, what happened in Maple?

@mmcdara Thanks for your detailed tests. The last point in your reply may be simply a feature in some later releases. As for those tests, the performance on my computer is worse. 
 

restart;

interface(version);
interface(displayprecision=4):

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

(1)

T:= NULL:
for i from 1 to 1000 do
T := T, CodeTools:-Usage([seq](seq(cat(i,j),j in [$("a".."z"),$("A".."Z"),$("A".."Z"),$("a".."z"),$("A".."Z")]),i in [$("A".."Z"),$("a".."z"),$("a".."z"),$("A".."Z"),$("a".."z")]), iterations=1, output=cputime, quiet):
end do:

Statistics:-Histogram([T], discrete=true, thickness=10)

 

T:= NULL:
for i from 1 to 1000 do
T := T, CodeTools:-Usage([seq](seq(cat(i,j),j in [$("a".."z"),$("A".."Z"),$("A".."Z"),$("a".."z"),$("A".."Z")]),i in [$("A".."Z"),$("a".."z"),$("a".."z"),$("A".."Z"),$("a".."z")]), iterations=10, output=cputime, quiet):
end do:


Statistics:-Histogram([T], discrete=true, thickness=8)

 

T:= NULL:
for i from 1 to 1000 do
T := T, CodeTools:-Usage([seq](seq(i||j,j in [$("a".."z"),$("A".."Z"),$("A".."Z"),$("a".."z"),$("A".."Z")]),i in [$("A".."Z"),$("a".."z"),$("a".."z"),$("A".."Z"),$("a".."z")]), iterations=10, output=cputime, quiet):
end do:

Statistics:-Histogram([T], discrete=true, thickness=8)

 

L1 := [$("a".."z"),$("A".."Z"),$("A".."Z"),$("a".."z"),$("A".."Z")]:
L2 := [$("A".."Z"),$("a".."z"),$("a".."z"),$("A".."Z"),$("a".."z")]:

T:= NULL:
for i from 1 to 1000 do
T := T, CodeTools:-Usage([seq](seq(i||j, j in L1),i in L2), iterations=10, output=cputime, quiet):
end do:

Statistics:-Histogram([T], discrete=true, thickness=8)

 

N1 := numelems(L1):
N2 := numelems(L2):
A1 := Matrix(N1, N2, (i, j) -> L1[i]):
A2 := Matrix(N1, N2, (i, j) -> L2[j]):


T:= NULL:
for i from 1 to 1000 do
T := T, CodeTools:-Usage(cat~(A1, A2), iterations=10, output=cputime, quiet):
end do:

Statistics:-Histogram([T], discrete=true, thickness=8)

 

 


 

Download compareTime_sursumCorda(1).mw

But I believe that these may be irrelevant to the version of Maple.

@dharr Thanks.
Interestingly again, the more readable one is not faster as it is: 

restart;

s1 := CodeTools:-Usage([cat("A" .. "Z"), cat("a" .. "z"), cat("a" .. "z"), cat("A" .. "Z"), cat("a" .. "z") || '`$`("a" .. "z"), `$`("A" .. "Z"), `$`("A" .. "Z"), `$`("a" .. "z"), `$`("A" .. "Z")'])

memory used=1.26MiB, alloc change=0 bytes, cpu time=16.00ms, real time=16.00ms, gc time=0ns

 

s2 := CodeTools:-Usage([seq](seq(cat(i,j),j in [$("a".."z"),$("A".."Z"),$("A".."Z"),$("a".."z"),$("A".."Z")]),i in [$("A".."Z"),$("a".."z"),$("a".."z"),$("A".."Z"),$("a".."z")])):

memory used=1.52MiB, alloc change=0 bytes, cpu time=47.00ms, real time=58.00ms, gc time=0ns

 

EqualEntries(s1, s2)

true

(1)

comparray(s1, s2, dontprint);

true

(2)

NULL


 

Download compareTime.mws

@mmcdara Thanks for your valuable comments.
An essential issue is that R (as well as Julia, Python, SageMath, etc.) is free and even open-source while Maple, Mathematica and Matlab (and their add-on toolboxes and applications) are all not. For the sake of the institution budget, people may only purchase one of these commercial products and services and cannot access any other licenses for the required functionalities. So hoping to meet expectations of such common capabilities in their own softwares can be reasonable in general. 

@mmcdara Thanks. Can R plot such flow charts using the layered layout method as well?

First 19 20 21 22 23 Page 21 of 23