Thank you for your help so far. I am having trouble with an assignment in my code,
I have an expression ‘trq’, which is assigned in every step inside a loop inside constraints. The value I get for this expression is very different from the value I get if I run it after solving the problem(using the values in the end of solve), what could be the problem.
trq(i) = m*(r_wh/fd)*( (square(v(i+1) - v(i)))/d_x(i) - ( (C_0(i) + G(i) ) + C_v(i)*v(i) + C_v2 * square(v(i)) ) );
in which only ‘v’ is the variable and all others are coefficients.