error in lsqnonlin (line 232) error in lsqncommon (line 88)
1 view (last 30 days)
Show older comments
Hello, there is someone who can tell me how to fix this? the function file (Diff) is correct and there is the green square
[x]=lsqnonlin(@Diff,x0,lb,ub);
Error using lsqncommon (line 88)
The Levenberg-Marquardt algorithm does not handle bound constraints and the
trust-region-reflective algorithm requires at least as many equations as variables; aborting.
Error in lsqnonlin (line 232)
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
0 Comments
Accepted Answer
John D'Errico
on 25 Jul 2015
How to fix it?
You have fewer data points than you have unknowns. So at the very best, in general there will be infinitely many solutions. NO unique solution to the problem.
There are TWO choices of algorithm in lsqnonlin. The trust-region-reflective algorithm supplied does not handle that class of problem, i.e., with too few data points to have a unique solution.
The alternative algorithm is the levenberg-marquardt algorithm. It does not allow the use of bound constraints on a problem.
So how to fix it? Do one of...
1. Get more data
2. Drop the bound constraints
3. Find a different tool than lsqnonlin to solve the problem
Again, recall that the solution will generally not be unique, no matter what tool you do find. There may be zero solutions given the bound constraints, exactly one solution (very rarely), or infinitely many of them.
0 Comments
More Answers (0)
See Also
Categories
Find more on Problem-Based Optimization Setup 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!