Optimal Growth IV: The Endogenous Grid Method