## GRADIENT Statement

**GRADIENT** * variables ***;**

The GRADIENT statement defines
the gradient vector which contains the first-order derivatives of the
objective function *f* with respect to *x*_{1}, ... ,*x*_{n}.
For more information, see the section "Derivatives".
To specify the values of nonzero derivatives,
the variables specified in the GRADIENT statement must be defined
at the left-hand side of algebraic expressions in programming
statements.
For example,consider the Rosenbrock function:

proc nlp tech=congra;
min y;
decvar x1 x2;
gradient g1 g2;
y1 = 10 * (x2 - x1 * x1);
y2 = 1 - x1;
y = .5 * (y1 * y1 + y2 * y2);
g1 = -200 * x1 * (x2 - x1 * x1) - (1 - x1);
g2 = 100 * (x2 - x1 * x1);
run;

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.