expect to export a series of graphs, but no diagram,

then i debug to export one diagram, it is success, why in this case not export

https://drive.google.com/file/d/0B2D69u2pweEvcDZVZ0tsRTc2dTg/edit?usp=sharing

restart;

with(combinat):

list1 := permute([a, b, a, b, a, b], 3);

list1a := subs(b=1,subs(a=0, list1));

n := 3;

list1a := permute([seq(seq(k,k=0..1),k2=1..n)], n);

list2 := permute([a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h], 3);

list3 := subs(h=18,subs(g=17,subs(f=16,subs(e=15,subs(d=14,subs(c=13,subs(b=12,subs(a=11,list2))))))));

list3 := permute([seq(seq(k,k=11..18),k2=1..3)], 3);

Iter:= iterstructs(Permutation([seq(seq(k,k=11..(10+nops(list1a))),k2=1..3)]), size=3):

list3b := [];

while not Iter[finished] do

p:= Iter[nextvalue]();

list3b := [p, op(list3b)];

end do:

list5 := Matrix(nops(list1a)*nops(list3), 1);

count := 1;

for n from 1 to nops(list3) do

temp1 := subs(1=list1a[1],list3[n]);

for k from 11 to nops(list1a)+10 do

temp1 := subs(k=list1a[k-10],temp1);

od;

list5[count] := temp1;

count := count + 1;

od;

Lfh := proc(numoflevel, hx, fx, varx)

if numoflevel = 1 then

hello := 0;

for kk from 1 to nops(var) do

hello := hello + diff(hx[kk], varx[kk])*fx[kk];

od;

return hello;

else

hello := 0;

for kk from 1 to nops(var) do

hello := hello + diff(Lfh(numoflevel-1, hx, fx, varx), varx[kk])*fx[kk];

od;

return hello;

end if;

end proc:

CheckRelativeRankZero := proc(h1, f1, g1,variables1,Count)

IsFinish := 0;

Result := 0;

for ii from 1 to 8 do

if IsFinish = 0 then

Lf2h := Lfh(ii,h1,f1,variables1);

Print(“Lf2h=”);

Print(Lf2h);

Lgf2h := Lfh(1,[seq(Lf2h,n=1..nops(variables1))],g1,variables1);

if Lgf2h = 0 then

print(“Lgf2h = 0”)

print(f1);

print(Lf2h);

print("find at ", ii);

IsFinish := 1;

Result :=Lf2h;

end if;

end if;

od;

return Result;

end proc:

IsZeroMatrix := proc(h1)

Iszero := 1;

for ii from 1 to 3 do

for jj from 1 to 3 do

if h1[ii][jj] <> 0 then

Iszero := 0;

end if

od;

od;

return Iszero;

end proc:

with(combstruct):

list6:= convert(list5, list):

list7 := [];

for ii from 1 to nops(list6) do

if list6[ii] <> 0 then

list7 := [list6[ii], op(list7)];

end if;

od;

with(LinearAlgebra):

with(VectorCalculus):

varlist := [x1, x2, x3];

Iter:= iterstructs(Permutation(list7), size=2):

Count := 1;

with(DEtools):

Iter:= iterstructs(Permutation(list7), size=2):

Count := 1;

list8 := [];

while not Iter[finished] do

p:= Iter[nextvalue]();

I1 := 0;

I2 := 0;

if IsZeroMatrix(p[1]) = 0 and IsZeroMatrix(p[2]) = 0 then

group1 := Matrix(p[1]);

for ii from 1 to 3 do

for jj from 1 to 3 do

if group1[ii][jj] = 1 then

I1 := I1 + varlist[ii]*varlist[jj];

end if;

od;

od;

group2 := Matrix(p[2]);

for ii from 1 to 3 do

for jj from 1 to 3 do

if group2[ii][jj] = 1 then

I2 := I2 + varlist[ii]*varlist[jj];

end if;

od;

od;

f2:=[I1, I2];

g2:=[0,-1,1];

h2:=[x1,0,0];

Lf2h := CheckRelativeRankZero(h2,f2, g2, varlist, Count);

print(“Lf2h=”);

print(Lf2h);

RightSide := MatrixMatrixMultiply(Matrix([[0,diff(I2, varlist[3]),-diff(I2,varlist[2])],[-diff(I2, varlist[3]),0,diff(I2, varlist[1])],[diff(I2, varlist[2]),-diff(I2, varlist[1]),0]]), Matrix([[diff(I1, varlist[1])],[diff(I1, varlist[2])],[diff(I1, varlist[3])]]));

print(“RightSide”);

print(RightSide);

Lf2_h := Lfh(1, Lf2h, f2, varlist);

LgLf_h := Lfh(1,Lfh(1,h2,f2,varlist),g2, varlist);

if LgLf_h = 0 then

u:=0;

else

u := -Lf2_h/LgLf_h;

end if;

newsys := [Diff(x1(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[1][1]))) + g[1]*u,

Diff(x2(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[2][1]))) + g[2]*u,

Diff(x3(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[3][1]))) + g[3]*u];

eval(plotsetup):

`plotsetup/devices`[jpeg]:=[jpeg,`plot.jpg`,[],[],``]:

plotsetup(jpeg, plotoutput=cat(cat(`testhamiplot`, Count),`.jpg`),plotoptions=`height=700,width=800`);

DEplot3d(value(newsys), [x1(t), x2(t), x3(t)], t = 0..1,[[x1(0) = 1, x2(0) = 1, x3(0) = 1]]);

Count := Count +1;

end if;

end do: