Q: Representing a formula of decision variables that I can refer to in other parts of the model I am trying to set up a large MIP problem with more than 300 variables. A lot of those variables depend on the combination of others.  What sort of data structure or type can I use to refer to a formula of decision variables.
Let's say I have x[m] + y[m] + z[m] - f(m - 1) = f(m). What can I use to do something like this. I used to have a constraint where x[m] + y[m] + z[m] - f(m - 1) == f(m), but I don't think that's effective.

A: You may consider f as a decision variable and write
int n=300;
range N=1..300;

dvar int x[N];
dvar int y[N];
dvar int z[N];
dvar int f[N];

subject to
{
forall (m in 2..n) x[m] + y[m] + z[m] - f[m-1] == f[m];
}


A: In addition to what Alex said, you can also use the dexpr keyword.
You have a nice and short example of that and Alex's solution in the reference documentation here.
