Create optimal_dynamics.py