Difference between revisions of "Optimizer key concepts: Airline Example"

Line 13: Line 13:
 
* Module 6: Time as an Intrinsic Index
 
* Module 6: Time as an Intrinsic Index
 
* Module 7: Embedding an NLP in a Dynamic Loop
 
* Module 7: Embedding an NLP in a Dynamic Loop
* Controlling Engine Selection and Settings
+
* Controlling Engine Selection and Setting
 
+
<br />
== Airline NLP Module 1: Base Case ==
 
You can navigate to the Airline NLP example starting in the directory in which Analytica is installed.
 
 
 
<code>Example Models/Optimizer Examples/Airline NLP.ana</code>
 
 
 
The goal is to determine optimum ticket fare and the number of planes to operate such that the airline can achieve the highest profit possible.
 
 
 
Decisions are '''Fare''' and the '''Number of Planes'''. Since this is an NLP, the values we use to define these decisions will be used as initial guesses in the optimization. '''Fare''' will be a continuous variable with lower and upper bounds. '''Number of Planes''' will be an Integer value with lower and upper bounds.
 
<nowiki>
 
    Decision Fare := 200
 
    Domain of Fare := Continuous(100,400)
 
    Decision Number_of_Planes := 3
 
    Domain of Number_of_Planes := Integer(1,5)
 
</nowiki>
 
First, we assume a base level of demand in passenger-trips per year assuming a base fare of $200 per trip.
 
 
 
<nowiki>    Variable Base_Demand := 400k</nowiki>
 
 
 
Actual demand will vary by price according to market demand elasticity.
 
 
 
<nowiki>    Variable Elasticity := 3
 
    Variable Demand := Base_Demand*(Fare/200)^(-Elacticity)</nowiki>
 
 
 
Each plane holds 200 passengers. We assume each plane makes two trips per day, 360 days per year.
 
 
 
<nowiki>    Variable Seats_per_plane := 200
 
    Variable Annual_Capacity := Number_of_Planes*Seats_per_Plane*360*2</nowiki>
 
 
 
Annual seats sold is limited either by capacity or by passenger demand.
 
 
 
<nowiki>    Variable Seats_Sold := Min([Demand, Annual_Capacity])</nowiki>
 
 
 
We assume annual fixed cost per plane and variable cost per passenger.
 
 
 
<nowiki>    Variable Fixed_cost := 15M
 
    Variable Var_cost := 30</nowiki>
 
 
 
The objective, '''Profit''', is the difference between revenue and cost.
 
 
 
<nowiki>    Objective Profit := Seats_sold * (Fare - Var_cost)
 
          - Number_of_Planes * Fixed_cost</nowiki>
 
 
 
Finally, we create the optimization node and solution quantities.
 
 
 
<nowiki>    Variable Opt := DefineOptimization(
 
          Decisions: Number_of_Planes, Fare
 
          Maximize: Profit)
 
    Decision Optimal_Fare := OptSolution(Opt, Fare)
 
    Decision Optimal_Planes := OptSolution(Opt, Number_of_Planes)
 
    Objective Optimal_Profit := OptObjective(Opt)
 
    Variable Opt_Status := OptStatusText(Opt)</nowiki>
 
 
 
 
<footer> Optimizing with Arrays / {{PAGENAME}} / Optimizer Attribute Reference</footer>
 
<footer> Optimizing with Arrays / {{PAGENAME}} / Optimizer Attribute Reference</footer>

Revision as of 14:40, 18 November 2015


The Airline Non-Linear Program (NLP) Example 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.

Sections


Comments


You are not allowed to post comments.