Objecive function format

20 views
Skip to first unread message

Abilash25

unread,
Mar 19, 2018, 5:24:52 PM3/19/18
to AMPL Modeling Language
Hi,

My question is about a format of objective function? I used baron solver and defined an objective function like this:

OF: x1 + x2 + (x1 + x3)/2

instead of defining like this:

OF: 1.5x1 + x2 + 0.5x3

The results were different?!

Was that an accident? or it happens and it pursue a specific format.

Thank you.

AMPL Google Group

unread,
Mar 19, 2018, 5:48:11 PM3/19/18
to am...@googlegroups.com
The first objective function involve the division of floating point and second does not. I would recommend to write in the second format as the inaccuracy might be accumulated in the floating point division. The difference could be attributed to the floating point operations. Are you concern with the result of the optimization problem?

--
Paras Tiwari
am...@googlegroups.com
{#HS:544498794-3114#}
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



Michael Saunders

unread,
Mar 19, 2018, 6:46:22 PM3/19/18
to am...@googlegroups.com
Hi Paras,

I would say it's highly unlikely that floating-point error would cause a noticeable difference
(because it's of order 2e-16).  Whoever asked the question should explain more about
whatever difference was noticed.

Michael


On Mon, Mar 19, 2018 at 2:48 PM, AMPL Google Group <am...@googlegroups.com> wrote:
The first objective function involve the division of floating point and second does not. I would recommend to write in the second format as the inaccuracy might be accumulated in the floating point division. The difference could be attributed to the floating point operations. Are you concern with the result of the optimization problem?

--
Paras Tiwari
am...@googlegroups.com
{#HS:544498794-3114#}
On Mon, Mar 19, 2018 at 9:25 PM UTC, <am...@googlegroups.com> wrote:
Hi,

My question is about a format of objective function? I used baron solver and defined an objective function like this:

OF: x1 + x2 + (x1 + x3)/2

instead of defining like this:

OF: 1.5x1 + x2 + 0.5x3

The results were different?!

Was that an accident? or it happens and it pursue a specific format.

Thank you.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.

To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.

Abilash25

unread,
Mar 20, 2018, 10:58:37 AM3/20/18
to AMPL Modeling Language
Hi Paras and Micheal,

I noticed this messages when using OF2

 Doing local search
 Solving bounding LP
 Problem solved during preprocessing
 Lower bound is 0.100000000000E+052
 Problem is infeasible

 Cleaning up

and this when it used OF1 and solved by BARON

1322 variables:
	1104 nonlinear variables
	218 linear variables
1619 constraints; 7294 nonzeros
	1185 nonlinear constraints
	434 linear constraints
	1610 equality constraints
	9 inequality constraints
1 nonlinear objective; 21 nonzeros.

z = 0.311913

I expect that z varies between 0.1 to 0.9.

This is very odd!

Paras, thank you for the response but I think considering your idea may change optimum?!

Regards



On Monday, March 19, 2018 at 6:46:22 PM UTC-4, Michael Saunders wrote:
Hi Paras,

I would say it's highly unlikely that floating-point error would cause a noticeable difference
(because it's of order 2e-16).  Whoever asked the question should explain more about
whatever difference was noticed.

Michael

On Mon, Mar 19, 2018 at 2:48 PM, AMPL Google Group <am...@googlegroups.com> wrote:
The first objective function involve the division of floating point and second does not. I would recommend to write in the second format as the inaccuracy might be accumulated in the floating point division. The difference could be attributed to the floating point operations. Are you concern with the result of the optimization problem?

--
Paras Tiwari
am...@googlegroups.com
{#HS:544498794-3114#}
On Mon, Mar 19, 2018 at 9:25 PM UTC, <am...@googlegroups.com> wrote:
Hi,

My question is about a format of objective function? I used baron solver and defined an objective function like this:

OF: x1 + x2 + (x1 + x3)/2

instead of defining like this:

OF: 1.5x1 + x2 + 0.5x3

The results were different?!

Was that an accident? or it happens and it pursue a specific format.

Thank you.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.

To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.

AMPL Google Group

unread,
Mar 20, 2018, 1:16:27 PM3/20/18
to am...@googlegroups.com
Would it be possible for you to send your model and data file so that we could run at our end?

--
Paras Tiwari
am...@googlegroups.com
{#HS:544498794-3114#}

Abilash25

unread,
Mar 20, 2018, 3:04:51 PM3/20/18
to AMPL Modeling Language
Hi Paras,

Yes, I can, Could you send me your email address?
It's part of a project and I have no permission to put it here. 

AMPL Google Group

unread,
Mar 20, 2018, 4:16:41 PM3/20/18
to am...@googlegroups.com
You can send it to sup...@ampl.com

--
Paras Tiwari
am...@googlegroups.com
{#HS:544498794-3114#}
On Tue, Mar 20, 2018 at 7:05 PM UTC, <am...@googlegroups.com> wrote:
Hi Paras,

Yes, I can, Could you send me your email address?
It's part of a project and I have no permission to put it here.



On Tue, Mar 20, 2018 at 5:16 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Would it be possible for you to send your model and data file so that we could run at our end?

--
Paras Tiwari
am...@googlegroups.com


Reply all
Reply to author
Forward
0 new messages