[AMPL 2815] is it possible to solve a linear program with data from another nonlinear program and use the result back in the nonlinear problem?

View: New views
3 Messages — Rating Filter:   Alert me  

[AMPL 2815] is it possible to solve a linear program with data from another nonlinear program and use the result back in the nonlinear problem?

by Aswin Dhamodharan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
This is Aswin Dhamodharan.
I am currently trying to deal with non linear constraints in my model.
I can break them down into a couple of simple linear programs.
Here is the exact case:
To find max (A-B,0)
I ve the foll lps that represent the expression above:
min z
st z>= (A-B)
    z>=0
max y
st y<= A-B-z

The values of A and B are from a INLP that is quite complex.
I need to use the value of max(A-B,0) which is y, for many instances
of A and B.
Hence I need to use the above 2 lps to evaluate all the instances and
return back all the values.
Is it possible with AMPL? And the solver i use for my INLP model is
KNITRO.
How do i pass the values of (A-B) and z from one model to another?
Any place where I could look for it, say in AMPL book?

I have received excellent support from this group in the past.
I am thankful for it and am expecting some help with the above problem
of mine too.

Thanks
Aswin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 2818] Re: is it possible to solve a linear program with data from another nonlinear program and use the result back in the nonlinear problem?

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



> How do i pass the values of (A-B) and z from one model to another?
> Any place where I could look for it, say in AMPL book?

After you have done a solve, you can use "let" statements to assign values
from the variables of one model to the parameters of a second model; then
you can solve the second model.  Using "for" loops, this can be repeated
many times.  See sections 14.4 and 14.5 of the AMPL book for a discussion of
how this is done, and www.ampl.com/NEW/LOOP2 for examples of some iterative
schemes implemented in this way.

Bob Fourer
4er@...


> -----Original Message-----
> From: ampl@... [mailto:ampl@...]
> On Behalf Of Aswin Dhamodharan [aswin.dhamu@...]
> Sent: Monday, September 14, 2009 2:55 PM
> To: AMPL Modeling Language
> Subject: [AMPL 2815] is it possible to solve a linear program with data
> from another nonlinear program and use the result back in the nonlinear
> problem?
>
>
> Hi,
> This is Aswin Dhamodharan.
> I am currently trying to deal with non linear constraints in my model.
> I can break them down into a couple of simple linear programs.
> Here is the exact case:
> To find max (A-B,0)
> I ve the foll lps that represent the expression above:
> min z
> st z>= (A-B)
>     z>=0
> max y
> st y<= A-B-z
>
> The values of A and B are from a INLP that is quite complex.
> I need to use the value of max(A-B,0) which is y, for many instances
> of A and B.
> Hence I need to use the above 2 lps to evaluate all the instances and
> return back all the values.
> Is it possible with AMPL? And the solver i use for my INLP model is
> KNITRO.
> How do i pass the values of (A-B) and z from one model to another?
> Any place where I could look for it, say in AMPL book?
>
> I have received excellent support from this group in the past.
> I am thankful for it and am expecting some help with the above problem
> of mine too.
>
> Thanks
> Aswin
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 2833] Re: is it possible to solve a linear program with data from another nonlinear program and use the result back in the nonlinear problem?

by Aswin Dhamodharan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello sir,

Thanks a lot.
It should help me as I develop my model capturing the whole problem,
for, I managed to overcome the existing problem with an easier
approach.

Thanks
Aswin

On Sep 15, 8:07 am, "Robert Fourer" <4...@...> wrote:

> > How do i pass the values of (A-B) and z from one model to another?
> > Any place where I could look for it, say in AMPL book?
>
> After you have done a solve, you can use "let" statements to assign values
> from the variables of one model to the parameters of a second model; then
> you can solve the second model.  Using "for" loops, this can be repeated
> many times.  See sections 14.4 and 14.5 of the AMPL book for a discussion of
> how this is done, andwww.ampl.com/NEW/LOOP2for examples of some iterative
> schemes implemented in this way.
>
> Bob Fourer
> 4...@...
>
> > -----Original Message-----
> > From: ampl@... [mailto:ampl@...]
> > On Behalf Of Aswin Dhamodharan [aswin.dh...@...]
> > Sent: Monday, September 14, 2009 2:55 PM
> > To: AMPL Modeling Language
> > Subject: [AMPL 2815] is it possible to solve a linear program with data
> > from another nonlinear program and use the result back in the nonlinear
> > problem?
>
> > Hi,
> > This is Aswin Dhamodharan.
> > I am currently trying to deal with non linear constraints in my model.
> > I can break them down into a couple of simple linear programs.
> > Here is the exact case:
> > To find max (A-B,0)
> > I ve the foll lps that represent the expression above:
> > min z
> > st z>= (A-B)
> >     z>=0
> > max y
> > st y<= A-B-z
>
> > The values of A and B are from a INLP that is quite complex.
> > I need to use the value of max(A-B,0) which is y, for many instances
> > of A and B.
> > Hence I need to use the above 2 lps to evaluate all the instances and
> > return back all the values.
> > Is it possible with AMPL? And the solver i use for my INLP model is
> > KNITRO.
> > How do i pass the values of (A-B) and z from one model to another?
> > Any place where I could look for it, say in AMPL book?
>
> > I have received excellent support from this group in the past.
> > I am thankful for it and am expecting some help with the above problem
> > of mine too.
>
> > Thanks
> > Aswin
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---