leastsq in optimization toolbox 1.0d of matlab 4.2c

leastsq in optimization toolbox 1.0d of matlab 4.2c

Post by Mr. De Chao Wan » Wed, 25 Mar 1998 04:00:00



Hi,

    I would like to use the leastsq function in the optimization toolbox

(matlab 4.2c for optimization toolbox 1.0d version only) to perform
some calculations. I would like to introduce some equality constraints
in the (linear and non-linear) least square calculation. Is there any
function
similar than leastsq which can include some equality constraints in the
optimiation toolbox 1.0d for matlab 4.2c. Although constr can perform
calculation with constraints, it cannot be used in the least square
calculation.
Thanks.

Wang De Chao

 
 
 

leastsq in optimization toolbox 1.0d of matlab 4.2c

Post by John D'Erri » Wed, 25 Mar 1998 04:00:00




> Hi,

>     I would like to use the leastsq function in the optimization toolbox

> (matlab 4.2c for optimization toolbox 1.0d version only) to perform
> some calculations. I would like to introduce some equality constraints
> in the (linear and non-linear) least square calculation. Is there any
> function
> similar than leastsq which can include some equality constraints in the
> optimiation toolbox 1.0d for matlab 4.2c. Although constr can perform
> calculation with constraints, it cannot be used in the least square
> calculation.

Well, yes it can. Use the same objective function that leastsq
would call, but at the end, return the sum of the squares of your
residuals to constr as its objective. Also compute and return the
inequality constraints.

A quick perusal of constr tells me that it does not explicitly
include equality constraints, but you can get around this either
by eliminating a number of the unknowns using a QR factorization
if the equality constraints are linear, or by using a set of double
inequality constraints, viz,

 G <= 0
-G <= 0

John D'Errico


 
 
 

leastsq in optimization toolbox 1.0d of matlab 4.2c

Post by Doug Schwa » Wed, 25 Mar 1998 04:00:00




>A quick perusal of constr tells me that it does not explicitly
>include equality constraints, but you can get around this either
>by eliminating a number of the unknowns using a QR factorization
>if the equality constraints are linear, or by using a set of double
>inequality constraints, viz,

Although it is not documented in the function, constr *can* handle
equality constraints.  Simply put the equality constraints first in the
constraint vector in the objective function and set OPTIONS(13) to the
number of equality constraints.

  opt = foptions;
  opt(13) = <number of equality constraints>;
  x = constr('objective',x0,opt);

--
Doug Schwarz
Eastman Kodak Company

 
 
 

1. leastsq in Optimization Toolbox

Hi,

    I would like to use the leastsq function in the optimization toolbox
to perform some calculations. I would like to introduce some equality
constraints in the least square calculation. Is there any function
similar than leastsq which can include some equality constraints.
Although constr can perform calculation with constraints, it cannot be
used in the least square calculation.  Thanks.

D. C. Wang

2. zip for os/2

3. SP Toolbox plug-ins

4. Q: extracting video frames from cd-i

5. INS Toolbox

6. which modem to choose for answering machine ?

7. Differences between Matlab 4.2c and 4.2c.1 on Mac?

8. Tech rep. available on par. of flow sim. package

9. fuzzy logic toolbox for matlab 4.2c

10. where can I get fuzzy logic toolbox for matlab 4.2c, simulink 1.3

11. Matlab MathWorks.Optimization.Toolbox.v2.2.for ... new !

12. SOSTOOLS: Sum of Squares Optimization MATLAB Toolbox Released

13. MOSEK optimization toolbox for MATLAB.