For physical systems with conservative forces, we can define a potential function $V$, and a Lagrangian $L=T-V$. At first, I thought that lagrangian mechanics only applied to systems with conservative forces. But on wikipedia, it says that we can extend it to non-conservative forces. However, it doesn't show how to do it for arbitrary non-conservative forces. Can lagrangian mechanics be applied to arbitrary systems with arbitrary forces? If not, what is an example of a system where this is impossible?