Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

AMPL Optimization Problem: To manage its excess cash over the next 12 months, a

ID: 3773544 • Letter: A

Question

AMPL Optimization Problem:

To manage its excess cash over the next 12 months, a company may purchase 1-month, 2-month or 3-month certificates of deposit from any of several different banks. The current cash on hand and amounts invested are known, while the company must estimate the cash receipts and expenditures for each month, and the returns on the different certificates.The company’s problem is to determine the best investment strategy, subject to cash requirements. (As a practical matter, the company would use the first month of the optimal solution as a guide to its current purchases, and then re-solve with updated estimates at the beginning of the next month.)

Suppose that the company’s estimated receipts and expenses (in thousands of dollars) over the next 12 months are as follows:

month

receipt

expense

1

3200

200

2

3600

200

3

3100

400

4

1000

800

5

1000

2100

6

1000

4500

7

1200

3300

8

1200

1800

9

1200

600

10

1500

200

11

1800

200

12

1900

200

The two banks competing for the business are estimating the following rates of return for the next

12 months

CIT:

1

2

3

NBD:

1

2

3

1

0.00433

0.01067

0.01988

1

0.00425

0.01067

0.02013

2

0.00437

0.01075

0.02

2

0.00429

0.01075

0.02025

3

0.00442

0.01083

0.02013

3

0.00433

0.01083

0.02063

4

0.00446

0.01092

0.02038

4

0.00437

0.01092

0.02088

5

0.0045

0.011

0.0205

5

0.00442

0.011

0.021

6

0.00458

0.01125

0.02088

6

0.0045

0.01125

0.02138

7

0.00467

0.01142

0.02113

7

0.00458

0.01142

0.02162

8

0.00487

0.01183

0.02187

8

0.00479

0.01183

0.02212

9

0.005

0.01217

0.02237

9

0.00492

0.01217

0.02262

10

0.005

0.01217

0.0225

10

0.00492

0.01217

0.02275

11

0.00492

0.01217

0.0225

11

0.00483

0.01233

0.02275

12

0.00483

0.01217

0.02275

12

0.00475

0.0125

0.02312

Formulate and AMPL MOD and DAT file for the presceding problem. Solve the resulting linear program.

Please tell me what I need to put in to a .MOD file and a .DAT file in AMPL. I already know how to do it algebrarically. Please do not answer if you don't know AMPL. Thank you!

month

receipt

expense

1

3200

200

2

3600

200

3

3100

400

4

1000

800

5

1000

2100

6

1000

4500

7

1200

3300

8

1200

1800

9

1200

600

10

1500

200

11

1800

200

12

1900

200

Explanation / Answer

Example problem to solve your question see it once:

A Product Mixture Problem: The nutritionist at a food research lab is trying to develop a new type of multigrain flour. The grains that can be included have the following composition and price.

% of Nutrient in Grain

1 2 3 4

Starch 30 20 40 25

Fiber 40 65 35 40

Protein 20 15 5 30

Gluten 10 0 20 5

Cost(cs/kg.) 70 40 60 80

Because of taste considerations, the percent of grain 2 in the mix cannot exceed 20, the percent of grain 3 in the mix has to be at least 30, and the percent of grain 1 in the mix has to be between 10 to 25. The percent protein content in the flour must be at least 18, the percent gluten content has to be between 8 to 13, and the percent fiber content at most 50. Find the least costly way of blending the grains to make the flour, subject to the constraints

The decision variables are: xj = Percent of grain jin the flour,j = 1 to 4

The model is: Minimize cost = 70x1 + 40x2 + 60x3 + 80x4

s. to x1 + x2 + x3 + x4 = 100

x2 20, x3 30

10 x1 25

0.20x1 + 0. 15x2 + 0.05x3 + 0.30x4 18

8 0.10x1 + 0.20x3 + 0.05x4 13

0.40x1 + 0.65x2 + 0.35x3 + 0.40x4 50

xj 0 for all j = 1 to 4

AMPL Data File:

grain.dat set GRAIN := G1 G2 G3 G4 ;

set NUTRIENT := Starch Fiber Protein Gluten;

param n_percent :

Starch Fiber Protein Gluten := G1 30 40 20 10

G2 20 65 15 0

G3 40 35 5 20

G4 25 40 30 5 ;

param cost := G1 70 G2 40 G3 60 G4 80 ;

param u_grain := G1 25 G2 20 G3 100 G4 100 ;

param l_grain := G1 10 G2 0 G3 30 G4 0 ;

param u_nutrient := Starch 100 Fiber 50 Protein 100 Gluten 13 ;

param l_nutrient := Starch 0 Fiber 0 Protein 18 Gluten 8 ;

AMPL Solutions draw% ampl ampl:

model grain.mod;

ampl: data grain.dat; ampl: solve;

CPLEX 6.0: optimal solution;

objective 6450

3 iterations (0 in phase I)

ampl: display G_percent;

G_percent [*] := G1 15 G2 20 G3 30 G4 35 ;

ampl: display G_percent.dual;

G_percent.dual [*] := G1 0 G2 0 G3 0 G4 0 ; ampl: display G_percent.lb, G_percent.ub, G_percent.slack; : G_percent.lb G_percent.ub G_percent.slack :=

G1 10 25 5

G2 0 20 0

G3 30 100 0

G4 0 100 35 ;

ampl: display Flour; 5

Flour = 50

ampl: display Grain_u, Grain_l; : Grain_u Grain_l :=

G1 0 0

G2 -25 0

G3 0 5

G4 0 0 ;

ampl: display Nutri_u, Nutri_l; : Nutri_u Nutri_l :=

Fiber 0 0

Gluten 0 0

Protein 0 100

Starch 0 0 ;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote