TRY NOW!
AMPL > >Resources > >The AMPL Book > >Example Files

EXAMPLE FILES

You can download all of model, data and script file examples for the AMPL book (second edition) from this page.

You can download everything in one file:

Or download individual files from our listings below, by filename or by figure number.

Try it! Use our simplified AMPL Student Edition web interface to experiment with any of these examples. All example files are pre-loaded as part of the interface.

Book examples by filename

Model file

Figure

Data file

Figure

Script file

Figure

 

 

assign.dat

3-2

 

 

blend.mod

2-4

 

 

 

 

cut.mod

14-2

cut.dat

14-4

cut.run

14-3

cut2.mod

14-6

 

 

cut2.run

 

diet.mod

2-1

diet.dat

2-2

 

 

 

 

diet2.dat

2-3

diet.run

14-1

 

 

diet2a.dat

2-3

 

 

dietu.mod

5-1

dietu.dat

5-2

 

 

econ.mod

19-3

econ.dat

19-2

 

 

econmin.mod

19-1

 

 

 

 

econ2.mod

19-4

econ2.dat

 

 

 

econ.mod

19-3

econ.dat

19-2

 

 

econmin.mod

19-1

 

 

 

 

econ2.mod

19-4

econ2.dat

 

 

 

econ2min.mod

 

 

 

 

 

econnl.mod

19-5

econnl.dat

 

 

 

iocol1.mod

16-2

 

 

 

 

iocol2.mod

16-3

 

 

 

 

iorow.mod

16-1

 

 

 

 

minmax.mod

17-9

 

 

 

 

multi.mod

4-1

multi.dat

4-2

 

 

multic.mod

6-5

 

 

 

 

multmip1.mod

20-1a

multmip1.dat

20-1b

 

 

multmip2.mod

 

multmip2.dat

 

 

 

multmip3.mod

20-2a

multmip3.dat

20-2b

 

 

net1.mod

15-2a

net1.dat

15-2b

 

 

net1node.mod

15-10

 

 

 

 

net2.mod

15-3a

net2.dat

15-3b

 

 

net3.mod

15-4a

net3.dat

15-4b

 

 

net3node.mod

15-11

 

 

 

 

netasgn.mod

15-9

 

 

 

 

netfeeds.mod

15-14

 

 

 

 

netmax.mod

15-6

 

 

 

 

netmax3.mod

15-12

 

 

 

 

netmcol.mod

16-6

 

 

 

 

netmulti.mod

15-13

 

 

 

 

netshort.mod

15-7

 

 

 

 

netthru.mod

15-15

 

 

 

 

nltrans.mod

18-4

nltrans.dat

18-5

 

 

nltransb.mod

 

 

 

 

 

nltransc.mod

 

 

 

 

 

nltransd.mod

 

 

 

 

 

prod0.mod

 

 

 

 

 

prod.mod

1-2

prod.dat

1-3

 

 

sched.mod

16-4

sched.dat

16-5

 

 

steel.mod

1-4a

steel.dat

1-4b

 

 

 

 

steel2.dat

 

 

 

steel3.mod

1-5a

steel3.dat

1-5b

 

 

steel4.mod

1-6a

steel4.dat

1-6b

 

 

steel4r.mod

 

steel4r.dat

 

 

 

steelP.mod

4-6

steelP.dat

4-7

 

 

steelpl1.mod

17-5a

steelpl1.dat

17-5b

 

 

steelpl2.mod

 

steelpl2.dat

 

 

 

steelpl3.mod

 

 

 

 

 

steelpl4.mod

 

steelpl4.dat

 

 

 

steelpl5.mod

 

steelpl5.dat

 

 

 

steelT0.mod

4-3

 

 

 

 

 

 

 

 

steelT.sa1

 

 

 

 

 

steelT.sa2

 

steelT.mod

4-4

steelT.dat

4-5

steelT.sa3

13-1

 

 

 

 

steelT.sa4

13-3

 

 

 

 

steelT.sa5

13-4

 

 

 

 

steelT.sa7

13-5

 

 

 

 

steelT.tab1

13-2

steelT2.mod

5-3

steelT2.dat

5-4

 

 

steelT3.mod

6-3

steelT3.dat

6-4

 

 

transp.mod

3-1a

transp.dat

3-1b

 

 

transp2.mod

6-1

 

 

 

 

transp3.mod

6-2a

transp3.dat

6-2b