Can Python scipy.optimize.fmin() Optimize More Than One Variable at Once?

  • Python
  • Thread starter dacruick
  • Start date
  • Tags
    Python
In summary, the purpose of scipy.optimize.fmin() is to minimize a function by finding the values of the input variables that minimize the output of the function. It is different from other optimization functions in Python because it does not require the function to be differentiable and can handle a wide range of optimization problems. The parameters of scipy.optimize.fmin() include the function to be minimized, the initial values for the input variables, optional arguments for the function, and the method used for optimization (default is the downhill simplex algorithm). Scipy.optimize.fmin() does not directly handle constraints, but there are ways to incorporate constraints into the function being minimized. Finally, yes, scipy.optimize.fmin() can be used for multi-dimensional optimization by specifying the
  • #1
dacruick
1,042
1
Hi All,

I am trying to optimize for more than 1 variable at the same time. is that possible?
 
Technology news on Phys.org
  • #2
I am trying to use this properly but I keep getting the same error.

TypeError: optimizefunction() argument after * must be a sequence

def optimizefunction(x,y,z):
x=5

return abs(x-y*z)

print scipy.optimize.fmin(optimizefunction, 2, (y,z))
 

Related to Can Python scipy.optimize.fmin() Optimize More Than One Variable at Once?

1. What is the purpose of scipy.optimize.fmin()?

The purpose of scipy.optimize.fmin() is to minimize a function by finding the values of the input variables that minimize the output of the function.

2. How is scipy.optimize.fmin() different from other optimization functions in Python?

Scipy.optimize.fmin() is a general-purpose optimization function that uses the downhill simplex algorithm to minimize a function. It is different from other optimization functions in Python because it does not require the function to be differentiable and can handle a wide range of optimization problems.

3. What are the parameters of scipy.optimize.fmin()?

The parameters of scipy.optimize.fmin() include the function to be minimized, the initial values for the input variables, optional arguments for the function, and the method used for optimization (default is the downhill simplex algorithm).

4. How does scipy.optimize.fmin() handle constraints?

Scipy.optimize.fmin() does not directly handle constraints, but there are ways to incorporate constraints into the function being minimized. One approach is to use the "constraints" parameter and specify a function that returns the value of the constraint at a given set of input variables. Another approach is to use the "bounds" parameter and specify the bounds for each input variable.

5. Can scipy.optimize.fmin() be used for multi-dimensional optimization?

Yes, scipy.optimize.fmin() can be used for multi-dimensional optimization by specifying the initial values for all input variables in the form of a list or array.

Similar threads

  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
2
Replies
62
Views
5K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
2K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
3
Views
527
  • Programming and Computer Science
Replies
4
Views
973
  • Programming and Computer Science
Replies
2
Views
937
  • Programming and Computer Science
Replies
16
Views
1K
Back
Top