0

I'm trying to find x of intersection between two simple math functions using only scipy.optimize.minimize I found the point successfully using (fsolve)

fsolve(lambda t: f1(t) - f2(t), x0)

but I'm limited to using only minimize and I couldn't find any solution, any idea?

zoro
  • 3
  • 1

1 Answers1

1
from scipy.optimize import minimize

minimize(lambda t: (f1(t) - f2(t))**2, x0)

should work. For a detailed explanation why, see here for instance.

joni
  • 6,840
  • 2
  • 13
  • 20