Commit 3c002fbf authored by Raj's avatar Raj
Browse files

SHO cost minimize logic fix

parent 0e6f0d92
......@@ -39,7 +39,7 @@ def SHOfit(parms, w_vec, resp_vec):
Cantilever response vector as a function of frequency
"""
# Cost function to minimize.
cost = lambda p: np.sum((SHOfunc(parms, w_vec) - resp_vec) ** 2)
cost = lambda p: np.sum((np.abs(SHOfunc(p, w_vec)) - np.abs(resp_vec)) ** 2)
popt = minimize(cost, parms, method='TNC', options={'disp':False})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment