Loops "for" and "while" in JuMP

Please take the time to read Please read: make it easier to help you.

In particular, it is easier to help if you can make a minimal reproducible example that demonstrates the error.

If you want to modify coefficients in a nonlinear expression, @Libbum is correct, parameters are the solution.