What is the best way to handle a constraint of the type $ax_1^2+x_2^2+...+x_n^2=c$ in a gradient descent algorithm? I would like to solve an optimization problem of the type:$$ \min J(x_1,..,x_n)$$ with this constraint using gradient descent. I tried to think of a way to alter the gradient so that it doesn't affect the constraint, but I didn't manage to do something useful. What I did was that after each gradient descent, I projected (in a more or less correct way...) the result onto the constraint. I got the results I wanted, but I don't think my approach was 100% valid...
What's the best way to handle a quadratic constraint
constraints;constrained optimization
Yes, that's a valid way of incorporating constraints into nonlinear programming problems. These types of algorithms are called reduced gradient or gradient projection methods. The method of that type I'm most familiar with is the generalized reduced gradient (GRG) method, and there are other methods out there as well.