\frac{\partial S}{\partial q_i}=\frac{\partial W}{\partial q_i}