acer

32480 Reputation

29 Badges

20 years, 6 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Christopher2222 No, it's not ridiculous or terrible -- it was just two short examples. I did not intend to be harshly critical.

I think that the overall idea is a good one. Indeed I suggested the same thing in 2008 but, while that devolved into a lengthy discussion about performance of float[8] Matrix Rank (for no reason other than that Nasser Abbasi once gave it, with results did not hold for long...), there was not a flood of examples.

It's a difficult thing to do very well. More importantly, it's pretty natural for a benchmark suite to get revised and reshaped.

Perhaps it would be helpful to start a list of areas for benchmarking, eg:
 - linear algebra
 - statistics
 - integration
 - differential equations
 - polynomial manipulation
 - special function evaluation
etc. Each of those might be sensibly split into numeric and symbolic computation. There's also group theory, graph theory, etc. Interface responsiveness is also interesting (eg. is 2-D input slow to parse, how fast is 2-D output, etc).

And comparison of benchmark numbers between operating systems, product releases, and hardware, might all be interesting.

[edit] There have been a few performance comparisons between competing products, (eg. Mma, Maple, Matlab, etc). One of those (now defunct, I think) was mentioned by me in this old Post. Maybe I still have some code from it; I'd have to find time to look.

Another speed performance product comparison was done by Wolfram, comparing Mma and Maple at both hardware and higher working precision, for a variety of numeric computations. Somewhere I have a Linux script which can run the float[8] LinearAlgebra portion of the Maple computations in an early snapshot of that -- only about a dozen or so commands tested. I used to use that to compare Maple + generic-CLAPACK/ATLAS/MKL, across releases. I had a swanky worksheet embedded-components interface, and it throws up a bunch of plots to overlay and compare Maple releases. I could probably find it and dust it off. The automation was useful. [edit] sursumCorda has since mentioned this suite, below, and provided the Maple code of a much later revision. I find the examples interesting, but I don't like the bookkeeping or methodology.

I think that individual benchmark examples should be run in fully separate kernel sessions, preferably from separate plaintext files.

@Christopher2222 IMO there are several weaknesses in your methodology. (I order these by decreasing severity, from mistake to quibble.)

1) You're measuring the sum of CPU time across multiple cores, which is a serious flaw. If you want to measure the wall-clock time duration for which the user has to wait, here, either use time[real]() or an appropriate call to CodeTools:-Usage. Your approach gives a confused idea about how a machine with more cores might finish the job more quickly, and about how long the computation actually takes.

2) As you have it, you're also measuring the time it takes for the interface to print the output. While that may be relatively negligible here, a clear picture in general would be to have separate operations to measure computations and (possible) something else dedicated to measure interface (eg, GUI, CLI) output timing. Also, there are some computations whose result take much longer to print than to compute. You could end the computation with a full colon.

3) This example tests the performance of the externally linked Intel MKL's dgesvd routine. That might interest some people [see also discussion in a 2008 Post of mine in which I too suggested a Maple benchmark, and also here], but it's not a great indicator of Maple's speed on general numerics (whether in evalhf or arbitrary precision modes).

4) Why set UseHardwareFloats:=true ? Shouldn't you have a specific and clear reason for changing away from default settings -- for this or any benchmark example?

@FDS The first form works ok for me, on columns of DS.

Test_date_ac2.mw

Perhaps you tried it with the wrong kind of single-quotes?

If you know for sure which columns will have the numeric entries then it's more efficient to only examine those. See attachment.

@FDS Do you mean this kind of result?

add(`if`(u::numeric, 1, 0), u = DS);

        418

nops(select(type, convert(DS, list), numeric));

        418

@Carl Love I think you intended eval(phi1, S2[2]) instead of eval(S2[2], phi1) 

I did some extra fiddling there, because I suspect that neither dataplot or plot (for Matrices/Vectors) understand units yet.

But this seems to work, in your Maple 2022.2.

  plots:-pointplot(res, lact, useunits = [Unit(h), 1], style = line)

If you upload and attach your .cvs file then we can reproduce, fix, and demonstrate the whole thing.

You could upload/attach a .zip file, if the Mapleprimes uploader baulks at the .cvs filename extension.

Are you entering it as capitalized Pi, or pi?

Maple interprets Pi as the well-known constant, but pi is just a name with no special meaning to Maple.

If you have some other problem, please explain it more clearly, or upload and attach your worksheet with the green up-arrow in the Mapleprimes editor.

@minhthien2016 Your last example can be handled by,

mylist := [(x - 7)*(x^2 + (-2*m - 30)*x + m), (x - 8)*(x^2 + (-m + 8)*x + 2*m)]

[(x-7)*(x^2+(-2*m-30)*x+m), (x-8)*(x^2+(-m+8)*x+2*m)]

subsindets(mylist,
           And(polynom(anything,x),`+`),
           u->sort(map(normal,u),x));

[(x-7)*(x^2-2*(m+15)*x+m), (x-8)*(x^2-(m-8)*x+2*m)]

Download sgn_ex6.mw

It could save time if you provided your more complicated examples now, rather than staggering them.

@gabbbooooo Please put your followups here, instead of spawning wholly separate new Question threads for them.

@lemelinm There are two different light-gray shades of grid line possible, with one being even lighter than the other. So, when you write, "What I need is to have the light-gray gridline on the x-axis to be only on the values of 3, 6 and 9." I don't know which shade you want.

You could compare these (including zooming, if you want),

plot(0, x = 0 .. 10, y = 0 .. 4, gridlines = true,
     axis[1] = [ tickmarks=spacing(3,0),
                 gridlines=[spacing(30,0),subticks=9] ],
     labels = [x*InertForm:-Display(10)^8*``(Unit(m)), `t `(Unit(s))]);

plot(0, x = 0 .. 10, y = 0 .. 4, gridlines = true,
     axis[1] = [ tickmarks=spacing(3,0) ],
     labels = [x*InertForm:-Display(10)^8*``(Unit(m)), `t `(Unit(s))]);

It's also not clear to me what grid lines you want on the vertical axis.

@FDS Previously you did not mention how you wanted to use the results, so I showed only the simplest way to access the parsed results (as Records whose fields can be access individually).

For comparing them, you could turn each into a Date object.

If you only want to use the Dates for other tasks, then you could sort the new Vector of Dates directly. If you'd also like to sort the earlier parsed results then you could construct the permutation key, which may then be used to reorder either Vector.

restartNULL

dates := Vector(3, {(1) = "9/7/2023", (2) = "12/8/2020", (3) = "10/10/2021"})

times := Vector(3, {(1) = "14:08", (2) = "09:12", (3) = "22:45"})

str := `~`[cat](dates, times)

Vector[column](%id = 36893628358824725308)

G := `~`[StringTools:-ParseTime]("%m/%d/%Y%H:%M", str)

Dts := map(proc (g) options operator, arrow; Date(g:-year, g:-month, g:-monthDay, g:-hour, g:-minute) end proc, G)

Vector[column](%id = 36893628358824709644)


The Date objects can be compared using `<`, so they can be sorted directly.

evalb(Dts[2] < Dts[1])

true


If we no longer need G, we could simply sort Dts
and use these dates from here on.

sort(Dts)

Vector[column](%id = 36893628358824698932)


The following permutation can be used to sort G or Dts.

K := sort(Dts, 'output' = ':-permutation')

[2, 3, 1]

Dts[K]

Vector[column](%id = 36893628358824696756)

G[K]

Vector[column](%id = 36893628358824690380)

NULL

Download StringToDateTime_ac2.mw


ps. The is also a Time command, though I did not need it above. There are Help pages for the Date and Time commands, as well as the Calendar package which has some additional commands for handling Date objects.

@lemelinm Thank you for your kind words.

Sorry, I don't understand your objection to the code from my previous reponse. Aren't the "principal" (major) tickmarks on the x-axis at 0,3,6, and 9?

You might have to upload your worksheet that uses it, and then write more clearly what aspect is wrong.

Isn't the result the same as the image shown in your original Question? Or, was that original actually somehow wrong too?

note. You appear to also want gridlines, and possibly also to zoom in/out? It's not always possible to control how the gridlines appear in the GUI, under zoom, etc. But maybe this is not on-topic. I don't yet understand your objections, and whether it's with the axis-ticks or the gridlines.

ps. If t represents time then wouldn't you also want the s to be Unit(s), so as to be rendered in upright Roman for consistency?

@lemelinm It's not clear what you want done with the x and 10^8, if the Unit(m) is inside brackets.

You can force any specific tickmarks you'd like. Eg,

plot(0, x = 0 .. 10, y = 0 .. 4, gridlines = true,
     axis[1] = [tickmarks=[0,3,6,9], gridlines=[subticks=1]],
     labels = [x*InertForm:-Display(10)^8*``(Unit(m)), `t `(s)])

Or you could specify a spacing between them (with anchoring at, say, zero), so that you get additional multiples shown if you zoom out.

plot(0, x = 0 .. 10, y = 0 .. 4, gridlines = true,
     axis[1] = [tickmarks=spacing(3,0), gridlines=[subticks=1]],
     labels = [x*InertForm:-Display(10)^8*``(Unit(m)), `t `(s)])

See the Help page ?plot,tickmarks

@FDS You now seem to be using the 24-hour convention, so the hour format is %H rather than %l. (See the Help-page for the ParseTime command.) I could not tell which you wanted from your original example.

You can apply the ParseTime command across the Vector using either elementwise syntax or the map command.

StringToDateTime_ac.mw

First 65 66 67 68 69 70 71 Last Page 67 of 594