Reply-to: gamsworld@googlegroups.com

Hi Arne,

Thank you so much for this. In my single-mindedness to find something structurally wrong with my solution, i’ve overlooked something so basic as that.

The model runs and produces the solution I was expecting.

Thanks again!

Stevie

On Friday, May 8, 2015 at 8:36:07 AM UTC+1, Arne Stolbjerg Drud wrote:

## Hi Stevie

You should remove â€™.lâ€™.

.l is only used for reporting after the model has been solved. Inside a model you never use .l since it indicates the initial value.

Good luck

Arne

\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, email: ad…@arki.dk

From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Stevie Lochran

Sent: Thursday, May 07, 2015 5:40 PM

To: gams...@googlegroups.com

Subject: Reformulation of DNLP to NLP

Hi all,

I am trying to reformulate the objective function expression

defCost…cost=e= sum((a,i,j,t),pipe_trans_cost(a,i,j,t) * abs(flow(a,i,j,t))) ;

in order to remove the ABS function so that it cab be solved without the problematic discontinuous derivatives. I essentially want the cost function to be decided by the absolute values for the flow, so that negative flows are still contributing to the cost in a positive way.

I have read everything I can find on the subject, including the helpful “Reformulation from a DNLP to NLP” chapter in the CONOPT docs (http://www.gams.com/dd/docs/solvers/conopt/) - page

Following that advice to the letter, I ended up with the following expression and additional code;

defCost…cost=e= sum((a,i,j,t),pipe_trans_cost(a,i,j,t) * (flowplus(a,i,j,t)+flowminus(a,i,j,t)))

positive variables

flowplus(a,i,j,t)

flowminus (a,i,j,t)

equations

reform(a,i,j,t)

reform(a,i,j,t)…flow.l(a,i,j,t) =e= (flowplus.l(a,i,j,t) - flowminus.l(a,i,j,t));

As far as I can tell, I have followed the instructions from the doc above, but I am getting the following errors:

**** 66 equation reform… symbol “flowplus” has no values assigned

**** 66 equation reform… symbol “flowminus” has no values assigned

I have obviously misunderstood the instructions somewhere along the line due to my relative newness to GAMS and my not-great mathematical prowess…

Can anyone help with the reformulation and / or point out my mistake(s)?

Thanks in advance,

Stevie

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.