Optimizer key concepts: Airline Example
This chapter shows you how to:
- Apply parametric variations to Variable and Decision nodes in optimizations
- Use a parametric array of Initial Guesses
- Combine uncertainty with optimization using
- Fractile or Average Stochastic method (FAST)
- Multiple Optimizations of Separate Samples (MOSS) method
- Optimize using reduced objectives
- Use Time as an intrinsic or extrinsic index
- Understand special characteristics of NLPs
- Improve efficiency of NLPs using the SetContext parameter of DefineOptimization()
- Plane an Optimization inside a Dynamic Loop
Concepts covered in the Airline NLP example
The Airline NLP demonstrates a set of key concepts that Analytica Optimizer modelers should be familiar with. Although it includes some topics that apply only to NLP models, each module includes content that is relevant to all optimization types.
Before reading this chapter, you should already be familiar with the basic parameters of DefineOptimization() and OptSolution() functions (Chapter 1 on page 5-7), and roles of intrinsic and extrinsic indexes in optimization (Chapter 3 of this guide).
Additionally, Modules 3 and 4 of the Airline NLP example assume familiarity with Monte Carlo simulation and Probability Distributions (User Guide Chapter 16). Module 7 assumes familiarity with the Dynamic() function (User Guide Chapter 18).
Topics relevant to all optimization types (LP, QP, and NLP) are:
- Module 1: Setting up basic Airline NLP example
- Module 2: Parametric Analysis
- Combining uncertainty with optimization:
- Module 3: Optimizing on Fractiles or Averages Stochastically (FAST)
- Module 4: Multiple Optimizations of Separate Samples (MOSS) method
- Module 5: Abstracted objectives; example of Time as an extrinsic index
- Module 6: Intrinsic decision arrays; example of Time as an intrinsic index
Embedded topics relevant only to Non-Linear Problems (NLPs) are:
- Improving efficiency using context variables (Modules 4 and 5)
- Module 7: Embedding an NLP inside a dynamic loop
NLP Characteristics
The Airline model is an example of a Non-Linear Program (NLP), the most general formulation for an optimization. In this type of optimization, the objective and the constraints can be arbitrary functions of the decision variables, continuous or discontinuous. This generality comes at the price of longer computation times, and less precision than linear and quadratic programs (LP and QP). There is also the possibility with smooth NLPs that the Optimizer will return a local optimum that is not the global optimum solution. In general, it is hard to prove whether a solution is globally optimal or not. For these reasons, it is better to reformulate nonlinear problems as linear or quadratic when possible.
Searching rather than solving
Algorithms for solving Linear Programs (LP) and Quadratic programs (QP) operate directly on arrays of coefficients for linear and quadratic terms. Once Analytica deduces these coefficients from your model, the problem is solved by the underlying engine without further interaction with your Analytica model. But NLP optimizations work differently. While an NLP is being solved, your model is being repeatedly evaluated at each search point. The search begins with an Initial Guess for the decision variables. Once the initial guess is established, the optimizer will calculate the corresponding objective quantity according to the structure of the model. For smooth models, the optimizer uses gradient and Jacobians (determined through finite differencing) to decide which decision values to use for the next guess. The iterative process continues until the gradient is within minimums (signaling a local or global optimum) or until time or iteration limits are reached.
Initial Guesses in NLPs
Since NLP methods cannot guarantee a global optimum, the solution may depend on the initial guess for decisions. Normally, Analytica evaluates the defined quantities in decision nodes and uses these values for initial guesses. You can optionally override the defined value using the Initial Guess attribute (see “The Initial Guess attribute” on page 11 and “Initial Guess” on page 66 for details about overriding initial guesses).
Improving efficiency by identifying Context Variables
As the Optimizer repeatedly assigns different values to the decision variables, it requires Analytica to repeatedly evaluate the objective function and all intermediate variables. In special cases where the optimization contains extrinsic indexes, the intermediate variables may be arrays that contain more slices of data than the optimization needs. This is a situation where Analytica’s efficiency with arrays can actually slow down NLP solution searches. The DefineOptimization() function has an optional parameter to remedy this: SetContext. Understanding which variables to designate as context variables is key to making sure that NLPs are running as fast as possible in Analytica. We develop this important concept in Module 4 of the example.
Enable comment auto-refresher