36 Reputation

2 Badges

15 years, 319 days

MaplePrimes Activity

These are answers submitted by jet


Thanks for your help but the question was less about optimising this particular piece of code and was really a more general question about clearing memory. I find that when running large loops the "memory" counter in the bottom right hand of the screen increases and increases and the runs seem to get slower and slower and eventually it crashes.

If I export the results I need at the end of each loop is there no way to "reset" the memory used or at least reduce it a bit during runtime?



sorry! I did try to tidy this code up before posting it but I realise it is still a bit opaque. The model I am fitting is:

s0+1/2*\int (rT-a-akE)/(1+kE) + (r|T|-a-ak|E|)/(1+k|E|) dv

where E and T are piecewise functions in v (obtained by fitting the spline), || denotes absolute value and the definite integral runs from v=0 to v=t.



Hi Acer

Thanks for your reply. I'm a bit confused could I just clarify what exactly you mean? do you mean I shouldn't have the objective procedure Diffproc as a seperate procedure outside of GlobalFit or that within Diffproc I shouldn't be creating a local functional operator f(t).


Hi Dave

Thanks very much for your help. I've attached some example code. Basically it is looping over 13 datasets fitting a model to each dataset. At the end of each loop the only thing I need to save is the answer ResE20, everything else can be deleted. Data is imported from an excel worksheet (also attached). If anything is unclear then please let me know.


thanks very much!


maple code:


View 9229_example on MapleNet or Download 9229_example
View file details


Download 9229_input for maple example.xls
View file details

Page 1 of 1