Q_j=\frac{d}{dt}\frac{\partial V}{\partial \dot{q_j}}-\frac{\partial V}{\partial q_j}, j=1...n