[AMPL 1623] How to hooking my Matlab code with AMPL?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 1623] How to hooking my Matlab code with AMPL?

Lily-24

Hi, I'm a beginner of AMPL.

I want to test a modified Newton method, which was written in Matlab,
with the existing ".mod" file. The Matlab code require the initial
iterate and the information of the objective function and the gradient
at each iteration, for example

function[x, histout, cost]=mnewton(x0,f)
% where x0=initial iterate;
              f= objective function
                  the calling sequence for f should be
                  [fout, gout]=f(x) where fout=f(x) is a scalar and
gout=gradf(x) is a column vector.

It's said that AMPL is used to translate the models, and send it the a
certain solver. But what's the style of the translated information,
can it be used by the Matlab code "mnewton.m" directly?

Thanks very much in advance!


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

Reply | Threaded
Open this post in threaded view
|

[AMPL 1624] Re: How to hooking my Matlab code with AMPL?

Hans Mittelmann

It is not clear to me why you need AMPL. For testing your code, what
about
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14182&objectType=file
or other such collections?


On Feb 20, 6:35 am, Lily <[hidden email]> wrote:

> Hi, I'm a beginner of AMPL.
>
> I want to test a modified Newton method, which was written in Matlab,
> with the existing ".mod" file. The Matlab code require the initial
> iterate and the information of the objective function and the gradient
> at each iteration, for example
>
> function[x, histout, cost]=mnewton(x0,f)
> % where x0=initial iterate;
>               f= objective function
>                   the calling sequence for f should be
>                   [fout, gout]=f(x) where fout=f(x) is a scalar and
> gout=gradf(x) is a column vector.
>
> It's said that AMPL is used to translate the models, and send it the a
> certain solver. But what's the style of the translated information,
> can it be used by the Matlab code "mnewton.m" directly?
>
> Thanks very much in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 1625] Re: How to hooking my Matlab code with AMPL?

Lily-24

Yes, I need a collection of test problems which contains the convex
constrained optimization problems. I download some ".mod" files from
http://www.sor.princeton.edu/~rvdb/ampl/nlmodels/cute/, but I don't
know how to use them.

Thanks very much for your help.

On Feb 21, 11:22 am, Hans Mittelmann <[hidden email]> wrote:

> It is not clear to me why you need AMPL. For testing your code, what
> abouthttp://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...
> or other such collections?
>
> On Feb 20, 6:35 am, Lily <[hidden email]> wrote:
>
>
>
> > Hi, I'm a beginner of AMPL.
>
> > I want to test a modified Newton method, which was written in Matlab,
> > with the existing ".mod" file. The Matlab code require the initial
> > iterate and the information of the objective function and the gradient
> > at each iteration, for example
>
> > function[x, histout, cost]=mnewton(x0,f)
> > % where x0=initial iterate;
> >               f= objective function
> >                   the calling sequence for f should be
> >                   [fout, gout]=f(x) where fout=f(x) is a scalar and
> > gout=gradf(x) is a column vector.
>
> > It's said that AMPL is used to translate the models, and send it the a
> > certain solver. But what's the style of the translated information,
> > can it be used by the Matlab code "mnewton.m" directly?
>
> > Thanks very much in advance!- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 1626] Re: How to hooking my Matlab code with AMPL?

Lily-24

Yes, I need a collection of test problems which contains the convex
constrained optimization problems. I download some ".mod" files from
http://www.sor.princeton.edu/~rvdb/ampl/nlmodels/cute/, but I don't
know how to use them.

Thanks very much for your help!

On Feb 21, 9:12 pm, Lily <[hidden email]> wrote:

> Yes, I need a collection of test problems which contains the convex
> constrained optimization problems. I download some ".mod" files fromhttp://www.sor.princeton.edu/~rvdb/ampl/nlmodels/cute/, but I don't
> know how to use them.
>
> Thanks very much for your help.
>
> On Feb 21, 11:22 am, Hans Mittelmann <[hidden email]> wrote:
>
>
>
> > It is not clear to me why you need AMPL. For testing your code, what
> > abouthttp://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...
> > or other such collections?
>
> > On Feb 20, 6:35 am, Lily <[hidden email]> wrote:
>
> > > Hi, I'm a beginner of AMPL.
>
> > > I want to test a modified Newton method, which was written in Matlab,
> > > with the existing ".mod" file. The Matlab code require the initial
> > > iterate and the information of the objective function and the gradient
> > > at each iteration, for example
>
> > > function[x, histout, cost]=mnewton(x0,f)
> > > % where x0=initial iterate;
> > >               f= objective function
> > >                   the calling sequence for f should be
> > >                   [fout, gout]=f(x) where fout=f(x) is a scalar and
> > > gout=gradf(x) is a column vector.
>
> > > It's said that AMPL is used to translate the models, and send it the a
> > > certain solver. But what's the style of the translated information,
> > > can it be used by the Matlab code "mnewton.m" directly?
>
> > > Thanks very much in advance!- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 1627] Re: How to hooking my Matlab code with AMPL?

Hans Mittelmann
In reply to this post by Lily-24

You did NOT say that you need constrained problems Always make as
clear as possible what you want! Here is a link to constrained
problems
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14553&objectType=file


On Feb 21, 6:12 am, Lily <[hidden email]> wrote:

> Yes, I need a collection of test problems which contains the convex
> constrained optimization problems. I download some ".mod" files fromhttp://www.sor.princeton.edu/~rvdb/ampl/nlmodels/cute/, but I don't
> know how to use them.
>
> Thanks very much for your help.
>
> On Feb 21, 11:22 am, Hans Mittelmann <[hidden email]> wrote:
>
> > It is not clear to me why you need AMPL. For testing your code, what
> > abouthttp://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objec...
> > or other such collections?
>
> > On Feb 20, 6:35 am, Lily <[hidden email]> wrote:
>
> > > Hi, I'm a beginner of AMPL.
>
> > > I want to test a modified Newton method, which was written in Matlab,
> > > with the existing ".mod" file. The Matlab code require the initial
> > > iterate and the information of the objective function and the gradient
> > > at each iteration, for example
>
> > > function[x, histout, cost]=mnewton(x0,f)
> > > % where x0=initial iterate;
> > >               f= objective function
> > >                   the calling sequence for f should be
> > >                   [fout, gout]=f(x) where fout=f(x) is a scalar and
> > > gout=gradf(x) is a column vector.
>
> > > It's said that AMPL is used to translate the models, and send it the a
> > > certain solver. But what's the style of the translated information,
> > > can it be used by the Matlab code "mnewton.m" directly?
>
> > > Thanks very much in advance!- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 1630] Re: How to hooking my Matlab code with AMPL?

medvall
In reply to this post by Lily-24

Hi Lily,

You can use TOMLAB /AMPL to run AMPL models with solvers in Matlab. I
have not used anything but the TOMLAB solvers, but it should be
possible (the code is open to read and modify).

Best wishes, Marcus
Tomlab Optimization Inc.
http://tomopt.com/tomlab/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---