Please help for the Invalid constraint

I met a problem when conducting my programming. The logging is below. It seems like my constraint has problems. Thanks for helping.

Disciplined convex programming error:
Invalid constraint: {real affine} ==
{convex}

cvx begin   
cvx_solver gurobi 
variable k integer 
variables p1,q1,i1,v1 
expression v 
v=(1+0.00625k)^2;

min objective
subject to
     -6<=k<=6; 
     v1=v-p1-q1+i1;  
     ...

cvx end

First of all, it looks like you may be confusing assignment = with equality constraints ==. But in all likelihood your problem is not convex (even with the integer requirement relaxed), so CVX can’t solve it.

FAQ: Why doesn’t CVX accept my problem? [READ THIS FIRST]