In this paper, we first introduce a variational formulation of the Unit Commitment (UC) problem, in which generation and ramping trajectories of the generating units are continuous time signals and the generating units cost depends on the three signals: The binary commitment status of the units as well as their continuous-time generation and ramping trajectories. We assume such bids are piecewise strictly convex time-varying linear functions of these three variables. Based on this problem derive a tractable approximation by constraining the commitment trajectories to switch in a discrete and finite set of points and representing the trajectories in the function space of piece-wise polynomial functions within the intervals, whose discrete coefficients are then the UC problem decision variables. Our judicious choice of the signal space allows us to represent cost and constraints as linear functions of such coefficients, thus, our UC models preserves the MILP formulation of the UC problem. Numerical simulation over real load data from the California ISO demonstrate that the proposed UC model reduces the total dayahead and real-time operation cost, and the number of ramping scarcity events in the real-time operations.