I am learning python and scipy. In my self study, I am attempting to minimize following function using scipy.optimize
> def opti_min(sr1_opt,sr3_opt):
> op = np.sqrt(np.sum(sr1_opt)+np.sum(sr3_opt))
> return op
opt = minimize(opti_min,strip,method = 'nelder-mead')
sr1_opt is a list:- [6.536055555554877e-07, 6.668262226847675e-07, 4.935691987513913e-07, 6.422222222223324e-07, 7.493249219562971e-07, 7.812500000001055e-07, 8.513020291362223e-07]
sr3_opt is also a list:- [4.127111433753003e-06, 4.419413067362789e-06, 4.721714700973233e-06]
strip is also a list to be used for initial values:- strip = [0.0025,0.005]
sr1_opt values are calculated as (actual value - strip[0])**2 and sr3_opt values are calculated as (actual value - strip[1])**2 for each entry in the list.
Hence, the required output is the strip values that will minimize the variable 'op'
the error I am getting is:- TypeError: opti_min() missing 1 required positional argument: 'sr3_opt'
What am I missing?
More importantly, which method should I use for constrained minimization if I want output for strip to be more than zero? Thanks in Advance