Question: Where should I restart?

Hi, sorry if the question is stupid =)

On my slow machine only two iterations (consisting of 200 iterations) are possible without restart. So, to be able to leave evaluation for the night, I would like to restart server inside the loops.

But if I do so, will the values of a, m and n (see below) be lost?

So the question is - how can I restart maple server after this loop [for i to iter do] execution without needed values loss?



printlevel := 4;

iter := 200;

for a from 1.5 by .5 to 1.5 do

for m from .999 by .999 to .999 do

for n from -2.5 by 5 to -2.5 do

ODE := diff(diff(x(t), t), t)+.2*(diff(x(t), t))-x(t) = a*sin(t);

k[1] := 0;

ics[1] := x(k[1]) = m, (D(x))(k[1]) = n;

for i to iter do

X[i] := dsolve({ODE, ics[i]});

u[i] := rhs(X[i]);

v[i] := diff(rhs(X[i]), t);

S1[i] := RootFinding:-NextZero(unapply(rhs(X[i])-1, t), k[i]+0.1e-3);

S2[i] := RootFinding:-NextZero(unapply(rhs(X[i])+1, t), k[i]+0.1e-3);

k[i+1] := min(select(type, [S1[i], S2[i]], numeric));

p[i] := evalf(subs(t = k[i+1], u[i]));

q[i] := evalf(subs(t = k[i+1], v[i]));

ics[i+1] := x(k[i+1]) = p[i], (D(x))(k[i+1]) = -q[i];

plot([u[i](t), v[i](t), t = k[i] .. k[i+1]]);

plo[i] := plot([u[i](t), v[i](t), t = k[i] .. k[i+1]])

end do;


plotsetup(ps, plotoutput = sprintf("c:/tmp/partA[%a]M[%a]N[%a].eps", a, m, n), plotoptions = `color,portrait,noborder,width=16cm,height=12cm`);

plots:-display(seq([plo[i]], i = 3*iter*(1/4) .. iter));


end do

end do

end do

Please Wait...