Question: Problem with loops in a routine

Hi guys, i wrote this fairly simply routine, to basically generate n equations, generate relations between those equations, then attempt to solve them by comparing coeffients, upon which i group together the information about the coefficients, for example i could have the equation ax+by=4x, so from that x=4,b=0 The equations in question are Dx=[x,Dy]+[Dx,y], when D is a map which maps x and y to A, where x and y span A's basis. so Dx and Dy would be a linear combination of x and y. This would be for the 2 dimensional case, for the n dimensional case x and y would extend to n variables. Alot of the program is labelled mainly as irrelevant so please don't feel dismaid by it's length The main question is in the pogram, it's just a problem with the loops i think, thanks. --------------start program-------------- restart: with(Physics): Setup(noncommutativeprefix = {x,D,dx}); [noncommutativeprefix = {dx, D, x}] Liealg:=proc() global dc,r,g,h,pop,dl,df,res,des,tac,d,n,i,a,b,c,rel,se,R,jk,f,Total,Dx,Q,v,jk1: n:= readstat("Enter the dimension of the Lie Algebra"): R:=Matrix(n,n,symbol=k): tac:={}: res:={}: des:={}: f:={}: jk:={}: jk1:={}: r:={}; dc:={}; relevant part------------------------------------------ for h from n to 1 by -1 do for v from 1 while v
Please Wait...