In the following script:
import numpy as np from scipy.optimize import minimise a=np.array(range(4)) b=np.array(range(4,8)) def sm(x,a,b): sm=np.zer
Modifying the proposal of FuzzyDuck, I replace sm +=((b-a)**2) which return me the desired result.