Questions tagged [fminsearch]

For questions about the Matlab function fminsearch that computes the unconstrained minimum of a given function with the Nelder-Mead algorithm.

SYNOPSIS

x = fminsearch ( costf , x0 )
x = fminsearch ( costf , x0 , options )
[x,fval,exitflag,output] = fminsearch ( costf , x0 , options )

Description

This function searches for the unconstrained minimum of a given cost function.

The provided algorithm is a direct search algorithm, i.e. an algorithm which does not use the derivative of the cost function. It is based on the update of a simplex, which is a set of k>=n+1 vertices, where each vertex is associated with one point and one function value. This algorithm is the Nelder-Mead algorithm.

source

122 questions
0
votes
1 answer

Stopping criteria for fminsearch in Matlab

I am using fminsearch to fit parameters for a system of DEs to observed data. I am not expecting to get a great fit. fminsearch pretty quickly finds what appears to be an acceptable min for the objective function, but then does not stop. It's…
Esme_
  • 1,360
  • 3
  • 18
  • 30
0
votes
1 answer

A function with variables and parameters as arguments of fminunc function

I am trying to use fminunc function in matlab to solve an unconstrained minimization problem. This function has the format [x,f] = fminunc (@fun,x0); Here, the defined fun is an input of fminunc as an objective function. However, my fun function…
user3919259
  • 75
  • 1
  • 9
0
votes
1 answer

Error while using fmincon in parallel computing mode

I am using UseParallel command to go for parallel computing in fmincon as normal computation is taking a lot of time. But while using np = 6 Cost = @(u)cost_min( u, CNT, u_in, y_in, Last ); options = optimoptions( 'fmincon', 'UseParallel', true ); …
0
votes
1 answer

fminsearch on a single variable

Using R's help page example on fminsearch as a starting point: # Rosenbrock function rosena <- function(x, a) 100*(x[2]-x[1]^2)^2 + (a-x[1])^2 # min: (a, a^2) fminsearch(rosena, c(-1.2, 1), a = sqrt(2)) # x = (1.414214 2.000010) , fval =…
Sunhwa
  • 125
  • 1
  • 7
0
votes
1 answer

fminsearch with two variables

I am trying to minimize a 5 variable function with fminsearch. I only want to minimize the function for two variables. I have tried the following, without luck: func = @(x,b) myfunction( x, y, z, a, b ); fminsearch(func,[x0,b0]); x is a matrix of…
Elias S.
  • 221
  • 1
  • 3
  • 10
0
votes
0 answers

Using scipy.fmin. TypeError: 'numpy.float64' object is not iterable

I'm trying to use scipy.fmin (docs here) and I can't figure out why it isn't working. My code: def moveMolecule(array): x0 = [0, 0, 0] minV = fmin(calculateV,x0) Where calculateV is: def calculateV(array): # Calculation of LJ potential…
Monica
  • 27
  • 3
  • 8
0
votes
1 answer

Using fminsearch on Matlab for Smallest Circle

for my homework I am supposed to calculate the smallest circle. the first part required me to calculate the euclidean distance, and i managed that with the following code: function euclidean = center(x, y) maximaldist = 0; rng(0, 'twister') A=…
0
votes
2 answers

fmincon - too many constraints - MATLAB

Suppose I have a fmincon function. As we know from matlab documentation we can impose linear and nonlinear constraints. Suppose now I have a function of 3 parameters to optimize. And I want 3 of them to be greater than 0 and 1 of them to be greater…
user3547227
0
votes
0 answers

fmincon: modify current point at each iteration

I am using fmincon. What I would like to achieve is to give fmincon a function F which receives the point the solver currently found, x and outputs an updated point y, s.t. after every iteration, I can modify the current point the optimization…
olamundo
  • 23,991
  • 34
  • 108
  • 149
0
votes
1 answer

Get the optimised variables in fminsearch

When using the fminsearch function of the neldermead package library(neldermead) foo <- function(x){ -exp(-x**2) } sol <- fminsearch(fun = foo, x0 = -10) How can I get the optimum values? I see I can print sol and that this gives the correct…
alberto
  • 2,625
  • 4
  • 29
  • 48
0
votes
1 answer

Maximum Likelihood Estimation of a log function with sevaral parameters

I am trying to find out the parameters for the function below: $$ \log L(\alpha,\beta,v) = v/\beta(e^{-\beta T} -1) + \alpha/\beta \sum_{i=1}^{n}(e^{-\beta(T-t_i)} -1) + \sum_{i=1}^{N}log(v e^{-\beta t_i} + \alpha \sum_{j=1}^{jmax(t_i)}…
0
votes
1 answer

MATLAB : Error using fminsearch()

clc; clearvars; clear all; syms T; syms E; syms v1; syms v2; syms v3; assume(v1>0 & v1<50000); assume(v2>0 & v2<50000); assume(v3>0 & v3<60000); b = 10/60; fun = int(exp(-E/(8.314*T)),T,300,T); s1 = 175.6 * 10^3; fun11 = (1/(v1*sqrt(2*pi)))* exp(-…
0
votes
1 answer

The right package/software for non-linear optimization with semidefinite constraints

I am struggling to solve an optimization problem, numerically, of the following (generic) form. minimize F(x) such that: ___(1): 0 < x < 1 ___(2): M(x) >= 0. where M(x) is a matrix whose elements are quadratic functions of x. The last constraint…
0
votes
1 answer

Error in fminsearch (line 191) fv(:,1) = funfcn(x,varargin{:});

I want to minimize the below function which uses few constants(Hz,h,LR,k,T), but ending up with an error,....Please get me out of this.... I have loaded .rpt file which contains values as shown on top of code.......Thanks in advance. 3.25E+008 …
vivek
  • 15
  • 7
0
votes
1 answer

matlab fmincon error "Solver stopped prematurely"

I have a given path for 6 DOF manipulator for given knots. path(dof,knot) path_f=[-0.5131 -0.6587 -1.0058 -1.4202 -1.7674 -1.9130 -0.8696 -0.6711 -0.1980 0.3667 0.8399 1.0383 -0.8961 -0.7433 -0.3789 0.0560 …
user70299
  • 77
  • 10
1 2 3
8 9