title: Cplex indexing a dvar with a dvar
body: <p>I have a constraint in OPL in which I need a dvar like an index in another dvar, but CPLEX gives me an error. I try to avoid this error using logical constraint as explained in <a href="https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=2be2ec22-db4b-4a2c-b164-615b9f735dc9&amp;ps=25" rel="nofollow noreferrer">https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=2be2ec22-db4b-4a2c-b164-615b9f735dc9&amp;ps=25</a>. But now a receive this error:</p>
  
  <pre><code>Error 5002: Q is not positive semi-definite
  </code></pre>
  
  <p>This is the constraint:</p>
  
  <pre><code>forall(j in pat,k in gior,w in slotp) 
     vinc4: (k==t[j])*y[j,k,w] == 
             sum(g in giorni)(r[j,g,w+1]) + 
                 sum(g in giorni)(l[j,g,w-1]);
  </code></pre>