1. Yes, you can have multiple statements within a DO loop. 2. No, you cannot update the formula for an IMPVAR after the declaration. I gave correct syntax for the updatedRisk IMPVAR declaration in the previous reply. I think you just need a second IMPVAR statement for actualRisk. I'm not sure, but it looks to me like you might be trying to calculate your objective function by writing a DO loop. In OPTMODEL, objectives are instead declared with a single algebraic expression. In your case, you might need to use the SUM operator with multiple-dimensional indices, something like: sum {i in 1..n, j in 1..i, k in 1..j} mynum[i,j,k] * myvar[i,j,k]. If you write out your objective function on paper as a single algebraic expression, the conversion to the corresponding OPTMODEL code will be immediate.
... View more