Minimal models for rational functions in a dynamical setting