שליחה במסרון: Nonsmooth mechanics and convex optimization