I want to optimize an objective function with dependent decision variables as below.
Sum [I * (x(i) - x(i-1) + lo(i) - g(i)) * p(i)]
Please note that the decision variable is only x(i) and x(i-1) is a value came from previous step of optimization. I have no idea how to write this objective function. Should I use function handler? Thanks