fmincon: Matrix is singular to working precision.

Dear all,
I get the following message but the code seems to be working ok
In fmincon (line 797)
Warning: Matrix is singular to working precision.
Is there a way to rectify this problem?

6 Comments

What version of MATLAB?
And which options did you pass? For example that message at that line number is plausibly due to a singular Hessian.
version 2017a. I use this option
options=optimoptions('fmincon', 'Display','off');
and I get this
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 3.584036e-249.
Thanks
Is it possible that you are working with relatively large values, especially with a lot of variables? If so then the gradient estimation or hessian estimation could produce a singular matrix due to overflow.
Hi there,
Do you have a solution for this ? Would computing the derivatives yourself solve the problem ?
Options:
TypicalX Typical x values. The number of elements in TypicalX is equal to the number of elements in x0, the starting point. The default value is ones(numberofvariables,1). fmincon uses TypicalX for scaling finite differences for gradient estimation.

Sign in to comment.

Answers (0)

Tags

Asked:

on 21 Jan 2018

Commented:

on 29 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!