On 7/28/2011 1:02 PM, John Smith wrote:
> I am trying to use lsqlin to solve three equations with more than three
> unknowns. I am calling lsqlin in a loop. Here are some results:
>
> Warning: Largescale algorithm requires at least as many equations as
> variables
> in C matrix; using mediumscale algorithm instead.
>> In lsqlin at 282
> In least_squares at 611
> Maximum number of iterations exceeded; increase options.MaxIter.
> To continue solving the problem with the current solution as the
> starting point, set x0 = x before calling lsqlin.
>
> soltn =
>
> 940.0000
> 0
> 940.0000
> 134.2857
> 336.8863
>
>
> Warning: Largescale algorithm requires at least as many equations as
> variables
> in C matrix; using mediumscale algorithm instead.
>> In lsqlin at 282
> In least_squares at 611
> Optimization terminated.
>
> soltn =
>
> 940.0000
> 940.0000
> 0
> 0
> 471.1721
>
>
>
>
> I think I understand the first result it has not found a solution, but
> is displaying how far it got. Can anyone explain what the second result
> means? Why was it terminated? Is the answer a solution?
>
> Thanks for the help.
Sorry for the confusing exit message. "terminated" simply means stopped,
it doesn't necessarily mean anything bad happened.
You can check the quality of the solution by examining the exit flag, or
by substituting the answer into the problem.
To see how to obtain an exit flag, or to avoid the warning by setting
the LargeScale option to 'off', consult the function reference page:
http://www.mathworks.com/help/toolbox/optim/ug/lsqlin.html
Alan Weiss
MATLAB mathematical toolbox documentation
