becca

375 Reputation

6 Badges

12 years, 364 days

MaplePrimes Activity


These are replies submitted by becca

thanks pagan copy works great to "fix" the values of the array. but i dont understand the different behaviour in the first case when I change the whole array.In both cases isnt there a single array that both A & x point to?

 

thanks pagan copy works great to "fix" the values of the array. but i dont understand the different behaviour in the first case when I change the whole array.In both cases isnt there a single array that both A & x point to?

 

amazing! that is so much neater than the solution I dreamt up!

thanks Robert

amazing! that is so much neater than the solution I dreamt up!

thanks Robert

I was just reviewing a comment (also from you Acer!) that might be exactly the answer to my question

http://www.mapleprimes.com/forum/verypoorperformanceglobaloptimizationtoolbox0

I was just starting to use GlobalOptimisation at the time you posted this so didn't fully understand the implications of what you said. I'll work thru your comment carefully & see if it solves the problem of having no symbolic solution.

thanks

Hi Acer

so what would you advise if there is no analytical solution (so that evaluating once and then substituting in parameters & evaluating objective under evahf isnt possible)?

In this case I wouldn't be able to make the change to the code that you suggested and I would still have the memory blow up.

Is there any alternative way of fixing the code that i posted above that doesnt rely on having an analytical solution?

View 8402_memory.mw on MapleNet or Download 8402_memory.mw
View file details

thanks for all your help, its invaluable!

Hi Acer

I've got a few more questions about this, hope you dont mind helping:

1) You say a memory leak is a bug, is it my bug or a maple bug (in this case something about the way that eval handles integration)?

2) you say I should ensure that functions evaluate ok under evalhf (or evalf in this case I think because the operator form of Global optimisation uses evalf rather than evalhf). Is there a way to check for this directly? 

3) In an earlier post you talk about "fixing" the objective function so it doesnt rely on lexical scoping of 'data', what do you mean by this?

Ps I tried a single symbolic integration followed by repeated substitutions in & that definitely prevents the memory blow up. So I guess this is the root of the problem.

 

thanks! 

 

thanks very much for your reply acer. Very interested that you think this is a memory leak. I don't know much (anything to be precise) about memory leaks.

Why would inefficient code -i.e. repeated numerical integration- be more susceptible to memory leaks then efficient code (calculate the integral once symbolically then substitute the parameters in each time).

Surely there is a difference between memory usage and a memory leak?

OK my code is deliberately memory-intensive but why isnt that memory freed up again?

thanks for your comments Acer

but I guess my question is a bit more general -I deliberately chose this form of res because I wanted a toy model that would be memory intensive.

My point is  that anything however well optimised will take a finite amount of memory. If this is run enough times then maple crashes. I don't "need" the 100s of integrations that are performed -just the final answer (which actually in this toy code isnt even stored). Do you know why these intermediate steps are being stored and how I can "unstore" them (the obvious solution is restart but I cant do this at runtime)

and also will a new PC at least increase the memory limit before maple crashes?

 

thanks!

 

John -can I just clarify are you saying that the memory in use saved to the 2nd column of earlystats and latestats (which I think is the same as the Memory that appears in the bottom right hand corner of the maple screen) doesnt increase? Mine increases dramatically. By the end of 50x20 runs memory has increased to 153M.

Below are earlystats and latestats for this run

View 8402_stats.mw on MapleNet or Download 8402_stats.mw
View file details

I admit I haven't run this toy code until it falls over but in past experience if the memory in use keeps on increasing every loop then when it exceeds a certain value it falls over.

I am very surprised that memory in use plateaus when you run it.

thanks for your thoughts

 

The job isn't intrinsically large (e.g. matrix inversion) its just long -large number of loops.

I've attached some toy code to explain what I mean. This code just runs the same job 100 times, memory in use increases constantly. Eventually (for larger number of loops then in the example) the computer crashes.

 

Thschiavo -what did you mean by "used memory swap"? Is this something I can do in maple (maple help has no mention of it) or do you simply mean add more RAM to my PC?

Thanks for your help

View 8402_memory.mw on MapleNet or Download 8402_memory.mw
View file details

got similar problem on pc. maple 12 regularly crashes when i search the help menu. never had this problem under maple 11. currently have both maple 12 & 11 installed (maple 12 just a demo whilst I decide whether to buy) but the guys at maple assured me this wouldnt cause a problem

writedata requires me to know whether the thing I will be writing is string, integer or floating.

I want to write a matrix where the type of entries can vary.

Is there any way to do this with writedata?

Page 1 of 1