A model-based two-stage heuristic algorithm is proposed for the unit ramp rate and system security-constrained unit commitment problem. The first stage is to determine a feasible on/off status of the units. An initial on/off status is constructed and its feasibility is tested by using the model. If the on/off status is infeasible, a relaxation model of the studied problem is constructed by approximating the objective function linearly and relaxing some constraints, which makes the on/off status of the units feasible. The second stage is to determine the output level of the units by solving the associated economic dispatch model. The test based on a 118-bus system show the effectiveness and robustness of the proposed algorithm.