Question: Problems w/ eval

Hello,

I'm having a bit of difficulty with the function "eval" I would like it to perform a full evaluation of an expression, but it does not appear to be doing this. When I try to explicitly pass it a value for the evaluation level it doesn't appear to take the integer input, the only way I can get it to work is to nest calls to eval ...[ie eval(eval(exp))]. Below is the code giving me the problem, the problem occurs on the last line...any suggestions would be appreciated

Thank you.

 

with(LinearAlgebra):
alias(a[11]=a[11](x1,x2),a[12]=a[12](x1,x2),a[21]=a[21](x1,x2),a[22]=a[22](x1,x2));
gradV:=Matrix([[a[11]*x1+a[12]*x2],[a[21]*x1+a[22]*x2]]);
xdot:=Matrix([[x2],[-x2+x1*x2^2]]);
Vdot:=MatrixMatrixMultiply(Transpose(gradV),xdot)(1,1);
Vdot:=collect(Vdot,[x1,x2],`distributed`);
a[11]:=-a[22]*x2^2+a[21];
#a[12]:=-1;
a[21]:=-1;
a[22]:=2;
map(eval,gradV);
Vdot:=eval(collect(Vdot,[x1,x2]));
rhs_curlCond:=eval(diff(eval(gradV(1,1)),x2));
lhs_curlCond:=eval(diff(eval(gradV(2,1)),x1));
curlCond:=rhs_curlCond=lhs_curlCond;
curlCondODE:=-4*x2*x1+(diff(a12(x2), x2))*x2+a12(x2) = -1;
curlCondODE_sol:=dsolve(curlCondODE);
a[12]:=2*x2*x1-1+C1/x2;
rhs_curlCond:=eval(diff(eval(gradV(1,1)),x2));
lhs_curlCond:=eval(diff(eval(gradV(2,1)),x1));
curlCond:=rhs_curlCond=lhs_curlCond;
simplify(curlCond);
Vdot:=collect(Vdot,[x1,x2]);
gradV1:=eval(gradV(1,1));
 

Please Wait...