We present the first necessary and sufficient conditions for the existence of a unique perfect-foresight solution, returning to a given steady-state, in an otherwise linear model with occasionally binding constraints. We derive further conditions on the existence of a solution in such models, and provide a proof of the inescapability of the “curse of dimensionality” for them. We also construct the first solution algorithm for these models that is guaranteed to return a solution in finite time, if one exists. When extended to allow for other non-linearities and future uncertainty, our solution algorithm is shown to produce fast and accurate simulations. In an application, we show that widely used New Keynesian models with endogenous states possess multiple perfect foresight equilibrium paths when there is a zero lower bound on nominal interest rates. However, we show that price level targeting is sufficient to restore determinacy in these situations.