I was wondering if there is a best practices to calculating variables, or more specifically, adding constraints to an optimization model using derivatives of variables.
To provide a concrete example. I have a function let's call output which I know is a non-linear combination of inputs.
ln Q = sum(phi_i ln(X_i) for i in n)
However, I know that there is a budget constraint. And using this I can use the Lagragian to get some information about the change in Q and inputs. More specifically I know.
d(X_i)/X_i = d(Q)/Q - sum(eta * phi_j * (P_i - P_j) for j in n if j != i)
equivalently
d(ln(X_i)) = d(ln(Q)) - sum(eta * phi_j * (P_i - P_j) for j in n if j != i)
Entering the constraints into the JuMP optimization problem is a bit confusing if I don't have a way of calculating Q from d(Q). I suppose I could create a new equation that would be
Q_new = Q_prev + d(Q)
However, when running this model in "near" continuous time, I would have to set up lags where Q_prev was the Q from the previous optimized model. I have seen other modeling languages incorporate d(variable) into the constraints, and I'm wondering if JuMP has an elegant way of doing this.