Question: Why is Maple 15 x100 (one hundred) timse slower than Mathematica 8?

xsys11demo.mw

The attached worksheet (xsys11demo.mw, first-order non-linear ODE system) is ~x100 (one hundred) times slower that the "same" program in Mathematica 8. Both give the same/satisfactory numerical results and have similar/identical structure (I can supply the Mathematica 8 notebook, if requested).

I assume that my attached worksheet must be sub-optimally programmed and would be grateful any specific directed advice on how to speed it up.

Regards,         Michael Caola

# Maple15\xsys11demo.mw, standard worksheet, BoltzQM, Shift & enter, ADD not SUM, 1-D math for procedure

with(StringTools): FormatTime(%c); with(DEtools):with(plots) : printlevel := 1:  mm := 3: nn := 3: a := 5.: e := 1.:  R := .1: h := 1.:

 

"Fri Mar 23 00:33:17 2012"

(1)

 

dproc3 := proc (nn, t, Y, YP) local n, nd, md;  for n to nn do; YP[n] := -((I*e^2*4)/(h*a^2))*Y[n]*add(add(Y[nd]*conjugate(Y[nd])*evalf(Int(evalf(Int(sin(Pi*n*x/a)*sin(Pi*nd*x/a)*sin(Pi*n*y/a)*sin(Pi*nd*y/a)/sqrt((x-y)^2+4*R^2*sin(Pi*md/mm)^2), y = 0. .. a)), x = 0. .. a)), md = 1 .. mm-1),   nd = 1 .. nn); end do;end proc; ic3 := array([seq(1/sqrt(nn), n = 1 .. nn)]); dvars3 := [seq(c[n](t), n = 1 .. nn)]; p := dsolve(type=numeric, number = nn, procedure = dproc3, start = 0., initial = ic3, procvars = dvars3, range=0..0.1, method=rkf45); FormatTime(%c);display([seq(odeplot(p,[t,abs(c[n](t))]),n=1 .. nn)]);

dproc3 := proc (nn, t, Y, YP) local n, nd, md; for n to nn do YP[n] := -(4*I)*e^2*Y[n]*add(add(Y[nd]*conjugate(Y[nd])*evalf(Int(evalf(Int(sin(Pi*n*x/a)*sin(Pi*nd*x/a)*sin(Pi*n*y/a)*sin(Pi*nd*y/a)/sqrt((x-y)^2+4*R^2*sin(Pi*md/mm)^2), y = 0. .. a)), x = 0. .. a)), md = 1 .. mm-1), nd = 1 .. nn)/(h*a^2) end do end proc

 

array( 1 .. 3, [( 1 ) = ((1/3)*3^(1/2)), ( 2 ) = ((1/3)*3^(1/2)), ( 3 ) = ((1/3)*3^(1/2))  ] )

 

[c[1](t), c[2](t), c[3](t)]

 

"Fri Mar 23 00:52:43 2012"

 

 

 

 

Download xsys11demo.mw

The attached worksheet (xsys11demo.mw, first-order non-linear ODE system) is ~x100 (one hundred) times slower that the "same" program in Mathematica 8. Both give the same/satisfactory numerical results and have similar/identical structure (I can supply the Mathematica 8 notebook, if requested).

I assume that my attached worksheet must be sub-optimally programmed and would be grateful any specific directed advice on how to speed it up.

Regards,         Michael Caola

Please Wait...