Suppose I have a function, f, that returns multiple values.
def f(x):
return x + 1, 2 * x
Scipy documentation tells me that f must be a function that returns a number. I take it that my given function f isn't compatible for scipy.optimize.bisection, but is it possible to perform the bisection method on just one of the return values of f?
You can define a function that calls your function
fand extracts the second return value: