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
1
vote
1 answer

Warning: Directory name too long.:

I am trying to apply a fitting procedure for a very difficult function which actually is ||F(theoretical)-F(experimental)||^2. I need to fit about 12 parameters. I decided not to print this function cause it contains about 20K chars. To do…
0
votes
0 answers

Matlab optimization using fminsearch give wrong answers- how to fix?

I have a task in school in which i need to calculate coefficient of this model. f = Tp + exp(V*z/(2*D))* k * z./(2*(pi*t.^3*D).^0.5) .* exp(-z^2./(4*D*t) - V^2/(4*D)*t) t is 4:4:420 and T is [0.0222 0.0167 0.0211 0.0167 0.0200 0.0200…
0
votes
0 answers

Matlab fminsearch optimization exiting early - how to fix?

I am running an optimization procedure using Fminsearch. It would be too complicated to post all the code here (and I cannot share everything for confidentiality), but I'll give a good description and hopefully you can give me some general ideas on…
0
votes
1 answer

How to minimise chi squared to optimise two parameters in Python

I am getting rather confused on the process of optimising the values of Two parameters I have given their estimated values. import scipy.optimize as optimize # Define the function you want to minimize def my_function(x, y): return x**2 +…
0
votes
1 answer

Optimization of double integral function to calibrate parameters

I have an integral that looks like that: I want to the values of ai that minimize H. I am trying to replicate the example from a book (example 8.1), where the authors say they used GA/fminsearch in MATLAB. I am not very familiar with MATLAB, but I…
Pedro Alencar
  • 1,049
  • 7
  • 20
0
votes
1 answer

How to Add Matrix as x0 Variable in fminsearch?

I am using fminsearch to minimize objective function. This requires defining variable x0 (usually vector) as estimates of solution which algorithm uses as starting point of finding solution. However, I want to create many estimates and evaluate…
Dario Mirić
  • 111
  • 3
0
votes
1 answer

Using vector as an input in fminsearch in MatLab

I am trying to understand how the following code optimize the objective function. I thought if I use vector as an input for fminsearch as below, the result 'Kp' should give me the point where the objective function is minimized. For example, Kp[1]…
Chang
  • 83
  • 1
  • 6
0
votes
1 answer

MATLAB: Error in Using 'fminsearch' function

I am doing a small research that requires to find the argmin of some function. This is the function I wrote. I want to find a vector x that gives the minimum output of this function. I tried fminsearch(@crc,x), but I got the following error. Error…
Chris
  • 95
  • 5
0
votes
1 answer

How to solve local minimum issue when using fminsearch in Matlab?

I am using 'fminsearch' in Matlab to solve the value function iteration problem. parfor i_a = 1:Na %Loop over state variable a for i_d = 1:Nd %Loop over state variable d for i_y = 1:Ny …
Chang
  • 83
  • 1
  • 6
0
votes
1 answer

Matlab's GlobalSearch function : error message and can't start the searching for minimum

I have a system of matricial equations where I want to find 2 matrices of 7x7 (so I am working with (1x98) vectors). I have an issue when I want to use GlobalSearch Matlab function. Here my code : Eq1 = (P1.')*(a.')*a*P1 + (P1.')*(a.')*b*P2 +…
user1773603
0
votes
1 answer

Python fmin using lambda expression

I have the following function for which I try to solve Vcr for given S,h,g: Vcr/np.sqrt(g*h)=((2/3)*(1-S+ (Vcr**2)/(2*g*h)))**(3/2) I do as follows: from scipy.optimize import fsolve import numpy as np S = 0.06 h = 15.14 g = 9.8 def…
Jeroen
  • 801
  • 6
  • 20
0
votes
0 answers

Keep getting a error while using fminsearch

simulate function code: function [V] = simulate(I , params) %parameters alphaa = params(1); k = params(2); ka = params(3); delb = params(4); x4 = params(5); x3 = params(6); k3 = params(7); alphac = params(8); k6 = params(9); x6 = params(10); x5 =…
0
votes
0 answers

Finding the minimum using fmin()

I am trying to minimize the "function()" with respect to two parameters. I have done so by creating mesh arrays and used them in the above "function()" to return similar meshed array values. However, upon using "fmin()" to find the minimum, the…
Karthik
  • 113
  • 1
  • 8
0
votes
1 answer

Recurrent problem using scipy.optimize.fmin

I am encountering some problems when translating the following code from MATLAB to Python: Matlab code snippet: x=M_test %M_test is a 1x3 array that holds the adjustment points for the function y=R_test %R_test is also a 1x3 array >>…
enricw
  • 263
  • 4
  • 19
0
votes
1 answer

Refresh part of a plot during fminsearch optimization

I am facing an issue related with the need to update part of a plot at every iteration of fminsearch. In summary, in my "main_optimization" file I have this part of a code that is intended to plot the experimental data to be fitted by my model. This…
ECrespo
  • 135
  • 1
  • 1
  • 8
1 2 3
8 9