0

I am having trouble pulling out values out of a function that I am trying to optimize. The code looks similar to what follows. I want to minimize c by changing x through scipy.optimize.minimize, but am also trying to pull a and b out of the function as well. What is the best way to do this?

def function(x, inputs)

a = math
b = math
c = math

return(c)

1 Answers1

0

You should be able to just compute a and b outside of the function. It doesn't need to be part of the function if the result is not optimized. Just use x, inputs, and c to compute a and b outside of the function.

Dorian
  • 1,439
  • 1
  • 11
  • 26