def complex_simulation(x): """ A nonlinear simulation function with some time delay """ time.sleep(0.1) y = np.cos(-x**2/9.0)+np.sin(x/6) return y