From ControlTheoryPro.com

Contents
1 Introduction to Lagrange Equations of Motion for NonConservative Forces^{[1]}
The Lagrangian description of a mechanical system is different. For Lagrangian mechanics it is assumed that the position of the system at 2 instances of time (t_{1} and t_{2}) are known (or knowable) and fixed. The system must move/behave between times t_{1} and t_{2} such that the system has the least "action". The "action" being defined by
"Action" 
where
 is called the Lagrange function or Lagrangian
 is a generalized coordinate which can represent the x, y, z of Cartesian coordinates or the θ, R of Polar coordinates, etc.
2 Lagrange Equation of Motion for Conversative Forces
The Lagrange Equation of Motion for Conservative Forces is below
.  ' 
This results is based on D'Alembert's equation which starts by calculating differential work work done on a particle by calculating the change kinetic energy:
' 
This is work done by a force for a displacement . In terms of generalized coordinates we have
for convenience 
A generalized force is of such nature that the product is the work done by driving forces when alone is changed by . We mention that a generalized force doe snot have to be a force in the usual sense. For example, if is an angle, the must be a torque in order that be work.
3 Derivation of Lagrange Equation of Motion for NonConversative Forces^{[2]}
The Lagrange equation above was derived for conservative forces only. A more general form would need to include nonconservative forces, such as friction, and that is what is derived in this section.
The Lagrange equation of motion for the q_{1} coordinate if some of the forces are nonconservative (such as friction) is The final result of this derivation is
.  Lagrange Equation of Motion for All Forces 
where:
 is the Lagrangian function,
 is the generalized coordinate, and
 are the conservative forces.
The kinetic energy of a particle is its ability to do work by virute of its motion. All forces, both conservative and nonconservative, acting on the particle contribute to the particle's motion. If we add a single nonconservative force, friction, to the conservative forces acting on the particle then
.  ' 
where
 is the total work done by all conservative forces,
 is the work done by friction, and
 is the change in kinetic (mechanical) energy.
As a result of the nonconservative force, friction, the total kinetic energy is not constant. The change is equal to the amount of work done by the nonconservative force. The mechanical (kinetic) energy of the particle can be described as follows:
.  ' 
where:
 is the final mechanical energy of the particle and
 is the particle initial mechanical energy.
Since friction always removes kinetic energy (it is always negative) the final energy of the particle () is less than the intial energy (). The difference between the final and initial energies captured as internal energy.
' 
where:
 is the internal energy or "lost" mechanical energy.
Further generalizing we get an equation stating the principle of conservation of energy. In other words the total energy does not change, just the form of the energy from kinetic to other such as internal or heat.
.  ' 
Earlier we described a general force
.  ' 
If all the forces are conservative then
' 
where:
 is potential energy and
 is the change in potential energy.
Then we have
.  ' 
Therefore, the Lagrange equations of motion for a single particle for conservative forces can be represented as
' 
Rearranging the equation so that all nonzero components are on the left side of the equation we get
1 
Define the Lagrangian function as
2 
The partial derivative with respect to is
' 
Since potential energy () is not a function of velocity () then
.  3 
Substituting Eqn. (1) and (2) into (3), the Lagrange equations of motion for conservative forces becomes
.  ' 
When there are nonconservative forces present the Lagrange equations of motion become
' 
where:
 are the nonconservative forces acting on the particle.
4 Notes
 Zak, Stanislaw H. Systems and Control. Oxford University Press, New York, 2003. ISBN 0195150112.
 Wikibooks: Classic Mechanics, Lagrangian