Dissipative solitons with a Lagrangian approach