Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
First order optimality Measure

Subject: First order optimality Measure

From: George A.

Date: 30 Jan, 2013 18:05:08

Message: 1 of 7

Hello all,

I am trying to solve a system of nonlinear equations
I have 2 formulations of the system.
The one formulation is better scaled, exploiting some algebra. I solve this using lsqnonlin and get a solution, with a function norm and first order optimality measure within the tolerances I set (10^-10).

I then give this solution to the 2nd formulation to check that it is recognized as a solution in this formulation as well. Although the function norm at this point (the solution found for the 1st formulation) is still "pretty small" (greater than before but still 10^-7), the first order optimality measure is huge (10^4). Both with the Jacobian turned 'on' or 'off'.

Could there be any Matlab-related reason why this is happening?

Any thoughts are appreciated,
George

Subject: First order optimality Measure

From: Matt J

Date: 30 Jan, 2013 18:21:08

Message: 2 of 7

"George A." <ga2311@columbia.edu> wrote in message <kebnck$oln$1@newscl01ah.mathworks.com>...
>
> I then give this solution to the 2nd formulation to check that it is recognized as a solution in this formulation as well. Although the function norm at this point (the solution found for the 1st formulation) is still "pretty small" (greater than before but still 10^-7), the first order optimality measure is huge (10^4). Both with the Jacobian turned 'on' or 'off'.
>
> Could there be any Matlab-related reason why this is happening?
==================

Any differences in bound constraints imposed in the second formulation? The first order optimality measure would have to take those into account, too.

Subject: First order optimality Measure

From: George A.

Date: 31 Jan, 2013 17:15:12

Message: 3 of 7

"Matt J" wrote in message <keboak$skq$1@newscl01ah.mathworks.com>...
> "George A." <ga2311@columbia.edu> wrote in message <kebnck$oln$1@newscl01ah.mathworks.com>...
> >
> > I then give this solution to the 2nd formulation to check that it is recognized as a solution in this formulation as well. Although the function norm at this point (the solution found for the 1st formulation) is still "pretty small" (greater than before but still 10^-7), the first order optimality measure is huge (10^4). Both with the Jacobian turned 'on' or 'off'.
> >
> > Could there be any Matlab-related reason why this is happening?
> ==================
>
> Any differences in bound constraints imposed in the second formulation? The first order optimality measure would have to take those into account, too.
========================

Thank you for this Matt.
No the bounds are the same in both cases [0,inf], and the tolerances as well

Subject: First order optimality Measure

From: Matt J

Date: 1 Feb, 2013 20:59:05

Message: 4 of 7

"George A." <ga2311@columbia.edu> wrote in message <kee8r0$mka$1@newscl01ah.mathworks.com>...
>
> Thank you for this Matt.
> No the bounds are the same in both cases [0,inf], and the tolerances as well
===============

OK. Well, it could be happening for purely mathematical reasons. Consider even the very simple linear scalar lsq problem

 min f(x) = (a*x)^2/2

where a=1e5. Then at x0=1e-8, the objective function is quite small

 f(x0) = 5e-7

but the first order optimality measure, i.e. the derivative, is 100....considerably larger.

Subject: First order optimality Measure

From: George A.

Date: 4 Feb, 2013 04:10:07

Message: 5 of 7

"Matt J" wrote in message <kehaap$qts$1@newscl01ah.mathworks.com>...
> "George A." <ga2311@columbia.edu> wrote in message <kee8r0$mka$1@newscl01ah.mathworks.com>...
> >
> > Thank you for this Matt.
> > No the bounds are the same in both cases [0,inf], and the tolerances as well
> ===============
>
> OK. Well, it could be happening for purely mathematical reasons. Consider even the very simple linear scalar lsq problem
>
> min f(x) = (a*x)^2/2
>
> where a=1e5. Then at x0=1e-8, the objective function is quite small
>
> f(x0) = 5e-7
>
> but the first order optimality measure, i.e. the derivative, is 100....considerably larger.
================

Well, I don't think this should be the case here, because I already have a point found as a solution for the first formulation (norm and 1st order optimality measure < 10^-6), but this same point when provided as initial point to the second (equivalent) formulation gives a 1st order optimality measure of 10^4..

Subject: First order optimality Measure

From: George A.

Date: 4 Feb, 2013 21:36:11

Message: 6 of 7

"George A." <ga2311@columbia.edu> wrote in message <kencav$mhu$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <kehaap$qts$1@newscl01ah.mathworks.com>...
> > "George A." <ga2311@columbia.edu> wrote in message <kee8r0$mka$1@newscl01ah.mathworks.com>...
> > >
> > > Thank you for this Matt.
> > > No the bounds are the same in both cases [0,inf], and the tolerances as well
> > ===============
> >
> > OK. Well, it could be happening for purely mathematical reasons. Consider even the very simple linear scalar lsq problem
> >
> > min f(x) = (a*x)^2/2
> >
> > where a=1e5. Then at x0=1e-8, the objective function is quite small
> >
> > f(x0) = 5e-7
> >
> > but the first order optimality measure, i.e. the derivative, is 100....considerably larger.
> ================
>
> Well, I don't think this should be the case here, because I already have a point found as a solution for the first formulation (norm and 1st order optimality measure < 10^-6), but this same point when provided as initial point to the second (equivalent) formulation gives a 1st order optimality measure of 10^4..

Let me rephrase my question:
Since I have 2 formulations of the same problem, which are equivalent in algebraic terms. Is there any possible explanation (scaling problem of one of the 2 formulations, significant non-linearities or anything) why the numerical solution given to one, is not recognized as a (numerical) solution to the other?
In other words could it be the case that equivalence in algebraic terms, does not necessarily mean equivalence in numerical terms? Or this is absurd and the only explanation can be an error with my code in one of the 2 versions (although I have not managed to find such an error up to now)

Subject: First order optimality Measure

From: George A.

Date: 5 Feb, 2013 16:00:14

Message: 7 of 7

"George A." <ga2311@columbia.edu> wrote in message <kep9kb$j1c$1@newscl01ah.mathworks.com>...
> "George A." <ga2311@columbia.edu> wrote in message <kencav$mhu$1@newscl01ah.mathworks.com>...
> > "Matt J" wrote in message <kehaap$qts$1@newscl01ah.mathworks.com>...
> > > "George A." <ga2311@columbia.edu> wrote in message <kee8r0$mka$1@newscl01ah.mathworks.com>...
> > > >
> > > > Thank you for this Matt.
> > > > No the bounds are the same in both cases [0,inf], and the tolerances as well
> > > ===============
> > >
> > > OK. Well, it could be happening for purely mathematical reasons. Consider even the very simple linear scalar lsq problem
> > >
> > > min f(x) = (a*x)^2/2
> > >
> > > where a=1e5. Then at x0=1e-8, the objective function is quite small
> > >
> > > f(x0) = 5e-7
> > >
> > > but the first order optimality measure, i.e. the derivative, is 100....considerably larger.
================
 
Well, I don't think this should be the case here, because I already have a point found as a solution for the first formulation (norm and 1st order optimality measure < 10^-6), but this same point when provided as initial point to the second (equivalent) formulation gives a 1st order optimality measure of 10^4..
 
Let me rephrase my question:
Since I have 2 formulations of the same problem, which are equivalent in algebraic terms. Is there any possible explanation (scaling problem of one of the 2 formulations, significant non-linearities or anything) why the numerical solution given to one, is not recognized as a (numerical) solution to the other?
In other words could it be the case that equivalence in algebraic terms, does not necessarily mean equivalence in numerical terms? Or this sounds absurd?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us