Python Forum
minimize with scipy.optimize
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
minimize with scipy.optimize
#1
Hi evrybody,

i have a noisy signal df.measdata and want to fit a model function in my measurement data. the model function is a sinus, whoms frequency and amplitude can be adapted by the optimizer. i tried a lot already, but scipy.optimize is not working for me, res.x just returns very high numbers for the variables

x0=[1,1]
fun = lambda x: sum(x[0]*np.sin(x[1]*df.timestamp)-df.measdata)
res = minimize(fun, x0, method='Nelder-Mead', tol=0.001)
res.x
can anyone explain which mistake i make?

cheers and regards
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to optimize analog gauge reader? kadink 0 753 May-19-2023, 08:58 PM
Last Post: kadink
  Using scipy.optimize: curve_fit ju21878436312 0 954 Sep-24-2022, 01:15 PM
Last Post: ju21878436312
  SOLVED: scipy.optimize.least_squares problem Skytter13 2 2,814 Mar-06-2022, 10:17 AM
Last Post: Skytter13
  Help with Scipy optimize for numerical problem Jbjbjb1 0 1,556 Jun-22-2021, 05:03 AM
Last Post: Jbjbjb1
  scipy.optimize.basinhopping generates unstable output bb19x11 0 1,655 Mar-09-2020, 04:07 PM
Last Post: bb19x11
  Can't minimize this simple function with constraints Alex009988 0 1,993 Sep-25-2019, 10:33 AM
Last Post: Alex009988
  Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 22,716 Aug-18-2018, 02:27 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020