{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ampl2 - Optimization Techniques Ampl2 Sets Writing Models...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Optimization Techniques Ampl-2 Sets, Writing Models and Data Files Using Sets   Zeliha Akca
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Product Mix Example:  3 products: TV sets, stereos and speakers. 5 different parts: Chassis, picture tubes, speaker cones, power  supplies and electronics units.  Produce the mix of products to maximize profits, given the  inventory of products on hand.  Part Name TV set Stereo Speaker inventory Chassis 1 1 0 450 Picture Tube 1 0 0 250 Speaker Cone 2 2 1 800 Power Supply 1 1 0 450 Electronics 2 1 1 600 Profit $75  $50  $35   
Background image of page 2
LP model for Product Mix Example:   Decision variables:        X_TV= the number of TV sets assembled,        X_STEREO=  the number of stereos, and        X_SPEAKER=  the number of speakers Objective Function:  Our goal is to maximize the total gross profit.         Maximize 75  x_TV  + 50  x_STEREO  + 35  x_SPEAKER  (Profit)  Constraints:      Subject to: x_TV  + 1  x_STEREO  + 0  x_SPEAKER  <= 450 (Chassis) x_TV  + 0  x_STEREO  + 0  x_SPEAKER  <= 250 (Picture tubes) x_TV + 2  x_STEREO  + 1  x_SPEAKER  <= 800 (Speaker cones) x_TV + 1  x_STEREO  + 0  x_SPEAKER <= 450 (Power supplies) x_TV  + 1  x_STEREO  + 1  x_SPEAKER  <= 600 (Electronics)       x _TV >=0, x _STEREO >=0, x _SPEAKER >=0 (No negativity) 
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sets In our model: Product Set={TV sets ,stereos, speakers}  Part Set={Chassis, picture tubes, speaker cones, power  supplies, electronics units} Defining in ampl: set  Products; set  Parts;
Background image of page 4
Defining Variables Using Sets We have 1 variable for each product         1 variable for each item in product set We can define variables over product set: If you have 20 variables (x1,..,x20), which way do you prefer?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}