155 Reputation

6 Badges

5 years, 363 days

MaplePrimes Activity

These are replies submitted by Annonymouse

based on @tomleslie s answer to a related question, I've found a work around:

allvalues(eval(problem expression)); gives the roots that RootOf represents, and then the problem can be compared for each case

@tomleslie Well spotted, I've updated the worksheet. Thanks for taking a look


After playing around, i can now see how my actions affect the discrepansy in timings. If I call the curry function that graphs the dimension of the solutions, it makes it take dramatically longer for the function that shows the timing of the previous one - I think I'll try and make a worksheet demonstrating this, and make a new question, as whilst it's related to this - its a seperate issue.  


This time I've been able to run the same program in under 80s (with no changes to the worksheet) each time I had run the program I had restarted the computer beforehand. This highlights the fact that maple runtimes are generally not what i expect!

Using the timer program as the template, I'll try and make a RAM measurement program.


Previously I've hav memory issues when using curry (GTS2 is a memory heavy program, although I would expect running it even with (Na,Nd)=(5,4) to take less than a quarter of an hour and less than 0.5 of a GB of ram).

Suprisingly when i added a timer to it, it seems to have got dramatically slower, and more memory hungry:

GTS2timer := proc (H, F, Na, Nd)
local st;
st := time();
GTS2(H, F, Na, Nd);
time()-st end proc

Sols3 := proc (H::algebraic, F::(list(algebraic)), i::posint, j::posint) options operator, arrow;
GTS2timer(H, F, i, j) end proc;
n, m := 5, 4;
timeMatrix := Matrix(n, m, curry(Sols3, H, F))

I ran it whilst out last night for four hours to come home to find maple giving a "memory allocation error", i left it running last night, and woke up to find a "kernel connection error"

Any thoughts?

@mmcdara After reading around I can't see how to use these functions together with curry. That is I can see how to use them to time/record ram usage of curry- or to time the GTS2 function that curry calls multiple times, but I can't see how to record this information.

My overall goal is to be able to graph RAM usage/timing for calculating each element of the matrix.

@Carl Love I'm sorry to bother you, but you seem to be the most knowledgable on curry. Is there a way of modifying, this code so that it outputs the matix it already does, as well as the timings and RAM usage of GTS2?



@vv  I used the other answer because I understood their solution, but I am always interested in learining more; if you have a moment could you explain how your solution works?

I've tried to reverse engineer some of @Carl Love s code from a similar question, but its a little beyond me, here is my attempt:

TypeTools:-AddType('StateVariable', proc (v) options operator, arrow; v::'indexed' and (op(0, v))::{('identical')('x'), 'Variable'} end proc); select(proc (s) options operator, arrow; andmap(hastype, remove(evalb, s), StateVariable) end proc, S)

So far i get the error "Error, selecting function must return true or false".

@Carl Love I was suprised that the code you wrote didn't affect spacecurve! looking through the documentation i can't see a way of affecting spacecurve!

Is there a way to do this so the options are applied to spacecurve- I was suprised that the code you gave for plot3d didn't help!

Thanks for trying it, I'll continue to play around with it

@Carl Love I wish i could upvote what your just wrote. Thats all very helpful; both curry and :: are things I've continued to be confused by even after reading the maple documentation

@Carl Love 

I looked at this again, and I think I simply coded it wrong (I am much more of a matlab guy so ideas like curry and :: are pretty new to me). My goal was to create a matrix that stored sollutions so that more complex code could be appplied to them (like the solution space dimension finder). Here is the code:

Sols3 := proc (H::algebraic, F::(list(algebraic)), i::posint, j::posint) options operator, arrow; GTS2(H, F, i, j) end proc; n, m := 7, 7; M := Matrix(n, m, curry(Sols3, H, F)); `~`[nops](M)*plots:-matrixplot(`~`[nops](M), heights = histogram)

and here is a worksheet showing it in context - and its output for (4,4) (scroll down to the graph)- i think it doesn't do what i thought it would and that probably caused the memory leak.

@vv My mistake- I cut and paste the wrong command into the question its corrected now

I had to look around to find the help page for %. This looks helpful because it gives us the number of objects, but it doesn't give us their dimensionality.

1 2 3 4 Page 2 of 4