Spatial Dynamic Models With Intertemporal Optimization