Getting started
Knitro can take its input from many different calling programs and programming languages, with various levels of abstraction. There are essentially three ways to interact with Knitro (in addition, a specific interface for Microsoft Excel is available):
via a modeling language like AMPL, AIMMS, GAMS, or MPL;
via a numerical computing environment like R or MATLAB;
via a programming language such as C, C++, Java, C#, Python, Julia or Fortran.
The first two methods are usually simpler to set up. Calling from a programming language offers a very fine control over the solver’s behaviour. With the C and Python APIs, Knitro’s Nonlinear Modeler also provides automatic differentiation, removing the need to supply derivatives manually (see Section Evaluation callbacks).
This section provides a hands-on example for each method, starting with Python, then AMPL, MATLAB, C++, and R.