[AMPL 2876] Derivatives of variables

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

[AMPL 2876] Derivatives of variables

by pioneer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi!

Suppose I have say (just to illustrate the point),
var x;
var y;
var g = x^2 + y^2;

is it possible to get the derivative of g with respect to x or y from
AMPL?

Either as:

(i) the numerical value of dg/dx, evaluated at the optimal solution
or
(ii) the analytical derivative, given as a symbolic expression




Thanks

--~--~---------~--~----~------------~-------~--~----~
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 2877] Re: Derivatives of variables

by mittelmann@asu.edu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


http://www.netlib.org/ampl/solvers/examples/README.gjh

On Oct 12, 2:23 am, pioneer <spencer.m...@...> wrote:

> Hi!
>
> Suppose I have say (just to illustrate the point),
> var x;
> var y;
> var g = x^2 + y^2;
>
> is it possible to get the derivative of g with respect to x or y from
> AMPL?
>
> Either as:
>
> (i) the numerical value of dg/dx, evaluated at the optimal solution
> or
> (ii) the analytical derivative, given as a symbolic expression
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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 2881] Re: Derivatives of variables

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



There is a "solver" you can invoke to get the numerical values of
derivatives at the current values of the variables.  Details are given in
the file previously posted:

   www.netlib.org/ampl/solvers/examples/README.gjh

Source code and makefiles for compiling this program are given in the same
directory.  However, precompiled binaries for popular platforms can be found
in the subdirectories in www.netlib.org/ampl/student.

AMPL does not form analytical derivatives, so there is no way to get the
symbolic expressions for them.

Bob Fourer
4er@...


> -----Original Message-----
> From: ampl@... [mailto:ampl@...]
> On Behalf Of pioneer [spencer.math@...]
> Sent: Monday, October 12, 2009 4:23 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2876] Derivatives of variables
>
> Hi!
>
> Suppose I have say (just to illustrate the point),
> var x;
> var y;
> var g = x^2 + y^2;
>
> is it possible to get the derivative of g with respect to x or y from
> AMPL?
>
> Either as:
>
> (i) the numerical value of dg/dx, evaluated at the optimal solution
> or
> (ii) the analytical derivative, given as a symbolic expression
>
> Thanks
>



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---