![]() |
Frontline Systems, Inc. |
||||||||||||||||||
|
|||||||||||||||||||
|
This page illustrates how you can solve the following constrained nonlinear optimization problem: Minimize using the Solver Platform SDK with its MATLAB Object-Oriented API. Click the links below to see example MATLAB code written using the SDK's other APIs.
To solve a constrained nonlinear optimization problem using the Object-Oriented API, you must write a MATLAB function (called an Evaluator in the terminology of the SDK) that computes values for the objective and constraints. You can access a wide range of information about the problem and the current state of the solution in this Evaluator, and signal whether the SDK should continue or terminate the solution process early. The MATLAB code below closely resembles the code you'd write to solve the same problem in C++, C# or Java.
You create a Problem object, and add this Evaluator to the Problem object's collection of Evaluators. In this example, we set properties to specify the lower and upper bounds we need for the constraints, thereby defining both inequalities and equalities. The SDK offers several ways to specify constraints -- another way is shown in the Procedural API example code. For any type of optimization problem, you simply call Optimize. All errors are reported by raising exceptions, which will cause the catch clause to be executed.
For further information and an example of a mixed-integer linear programming problem written in the SDK's Object-Oriented API for MATLAB, C++, C#, Visual Basic, VB.NET, and Java, click Solver Platform SDK Language/OS Support. |
|
||||||||||||||||||||||||||