|
From: Michel T. <ta...@lp...> - 2018-06-05 20:21:09
|
Le 05/06/2018 à 06:32, Robert Dodier a écrit : > On 2018-06-04, Stavros Macrakis<mac...@al...> wrote: > >> Maxima 5.41.0a_dirtyhttp://maxima.sourceforge.net >> using Lisp SBCL 1.3.18 >> (%i1) load(drawdf); >> (%o1) >> E:/maxima-5.41.0a/bin/../share/maxima/5.41.0a_dirty/share/diffequations/\ >> drawdf.mac >> (%i2) drawdf([y,-9*sin(x)-y/5], [x,-10,10], [y,-10,10], tstep=0.05, >> soln_arrows=true, point_size=0.5, >> points_at([0,0], [2*%pi,0], [-2*%pi,0]), >> field_degree='solns, >> saddles_at([%pi,0], [-%pi,0])); >> >> ÿ% >> fatal error encountered in SBCL pid 2684(tid 0000000001356500): >> %PRIMITIVE HALT called; the party is over. > Some investigation shows the trouble is caused by calls to 'translate'. > In the example as shown above, there are 1336 calls to translate (as > determined by 'timer' and 'timer_info'). drawdf constructs a large > number of short functions (maybe one for each point in the plot? I > didn't look carefully) and calls the Maxima->Lisp translator, presumably > in hope of greater speed of evaluation. > > > Indeed tracing translate shows that the above calls repeatedly translate on f_rk_4. One gets things such as: 1 Enter translate [translate(f_rk_4)] 1 Exit translate [f_rk_4] 1 Enter translate [translate(f_rk_4)] 1 Exit translate [f_rk_4] 1 Enter translate [translate(f_rk_4)] 1 Exit translate [f_rk_4] 1 Enter translate [translate(f_rk_4)] 1 Exit translate [f_rk_4] 1 Enter translate [translate(f_rk_4)] 1 Exit translate [f_rk_4] 1 Enter translate [translate(f_rk_4)] ... Which seems to point to an error in the invocation of translate. Anyways removing the call to translate doesn't make a very significant difference: without translate (%i5) drawdf([x*(1-x-y), y*(3/4-y-x/2)], [x,0,1.1], [y,0,1], duration=40, soln_arrows=true, field_degree=2, point_at(1/2,1/2), solns_at([0.1,0.2], [0.2,0.1], [1,0.8], [0.8,1], [0.1,0.1], [0.6,0.05], [0.05,0.4], [1,0.01], [0.01,0.75])) $ Evaluation took 8.5190 seconds (8.5310 elapsed) using 1329.628 MB. with translate (%i8) drawdf([x*(1-x-y), y*(3/4-y-x/2)], [x,0,1.1], [y,0,1], duration=40, soln_arrows=true, field_degree=2, point_at(1/2,1/2), solns_at([0.1,0.2], [0.2,0.1], [1,0.8], [0.8,1], [0.1,0.1], [0.6,0.05], [0.05,0.4], [1,0.01], [0.01,0.75])) $ Evaluation took 6.9180 seconds (6.9290 elapsed) using 1252.857 MB. and more importantly the above example now runs to completion in around 10s. So i think it is advisable to remove the call to translate in make_f_rk_4 that is so that the last line is: [dxdt_var,dydt_var]))))$ -- Michel Talon |