I trying to solve the optimization problem ,i faced three kinds of error ,does any one know how can i solve them?
87 views (last 30 days)
Show older comments
EHSAN GHORBANI M
on 21 May 2015
Commented: Walter Roberson
on 21 Dec 2017
first:The value of local variables may have been changed to match the globals. Future versions of MATLAB will require that you declare a variable to be global before you use that variable.
second: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.255027e-18. No feasible solution found.
third:fmincon stopped because the size of the current step is less than the default value of the step size tolerance but constraints are not satisfied to within the default value of the constraint tolerance.
0 Comments
Accepted Answer
Walter Roberson
on 21 May 2015
First: your code is of the form
x = some value
global x
You need to move the "global x" to before you assign the value to x.
Second: either you make a mistake in constructing the values, or else the function goes to +/- infinity within the bounds to be explored, or else the function is discontinuous and the estimation of the derivative is not possible because of that.
You need to re-check how you construct your values, and you need to recheck whether the function is discontinuous or has singularities.
Third: your function either suffers badly from numeric round-off, or else your function is discontinuous. The optimizer has found a point where it cannot step finely enough to find a point that might possibly solve the problem because it has detected that if a solution exists it must be within an interval smaller than the smallest step size you allow, but at both the upper and lower bound of the interval with the potential solution, the constraints cannot be satisfied.
You need to check that your function is continuous and you need to check that your constraints can be satisfied taking into account the limits of double precision calculations.
In summary: you probably asked it to solve a discontinuous optimization, and it cannot find the solution because of the discontinuity.
5 Comments
Walter Roberson
on 21 Dec 2017
fmincon does not have just one step size; see
DiffMaxChange, DiffMinChange, FiniteDifferenceStepSize, StepTolerance
More Answers (0)
See Also
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!