Exercise 1-6 "impossible deduced bounds" presolve error

Hi, I am new to AMPL and have started the AMPL handbook and just finished the first chapter: Production Models - Maximizing Profits. I was doing the exercises and was stumped when I came to the last one (1-6), i.e. the oil refining process one.

I get the following error:

presolve, variable Barrels_Product_Made['HF']:
impossible deduced bounds: lower = 3.41477, upper = 0.303303;
difference = 3.11147

presolve, variable Barrels_Product_Made['D']:
impossible deduced bounds: lower = 11.724, upper = 0.303303;
difference = 11.4207

presolve, variable Barrels_Product_Made['RG']:
impossible deduced bounds: lower = 18.3945, upper = 3.52326;
difference = 14.8712

presolve, variable Barrels_Product_Made['PG']:
impossible deduced bounds: lower = 19.1484, upper = 3.36667;
difference = 15.7817

presolve: constraint Intermediate_For_Products['B'] cannot hold:
body >= 370 cannot be <= 6.88992; difference = 363.11

I think it’s probably due to the way I am entering the data for Ujk, i.e. “maximum allowed units of attribute k per barrel of final product j”. In sub-section (c) of the exercise, it gives the values for the attribute limits and also says this: “Limits left blank, such as density for gasoline, are irrelevant and may be set to some relatively large number.”. I tried giving Infinity, 99999, etc. for them, but the error persists.

Any help on this would be appreciated? Thanks.

For the limits left blank, a large value like 99999 should work. The error might be somewhere else in the data file — can you reply with the data file attached? (Use the “Upload” icon.)

exercise.1.6.c.dat (954 Bytes)
exercise.1.6.c.mod (2.8 KB)

I have uploaded both the model and data files. Also, I changed the research octane to a negative large number. But the same error persists.

All of the blank entries in the max_attrib_per_product_barrel table should be large positive numbers. You should double-check the other data as well, to be sure it all matches what’s shown in the exercise.

Also you’ll need to study the constraints to be sure they are saying what you want. AMPL’s “expand” command can be useful for examining the constraints that are being generated. For example, you have the following for constraint Attributes_Intermediates, which does not seem right:

ampl: expand Attributes_Intermediates;
subject to Attributes_Intermediates['PG','vap']:
	-12.2*Barrels_Product_Made['PG'] <= -233.61;

subject to Attributes_Intermediates['PG','oct']:
	90*Barrels_Product_Made['PG'] <= 303;

subject to Attributes_Intermediates['PG','den']:
	-999*Barrels_Product_Made['PG'] <= -1202;

subject to Attributes_Intermediates['PG','sul']:
	-999*Barrels_Product_Made['PG'] <= -5.862;

subject to Attributes_Intermediates['RG','vap']:
	-12.7*Barrels_Product_Made['RG'] <= -233.61;

subject to Attributes_Intermediates['RG','oct']:
	86*Barrels_Product_Made['RG'] <= 303;
.......

It may look strange to have, for example, -12.2*Barrels_Product_Made['PG'] <= -233.61, but that’s just the same as 12.2*Barrels_Product_Made['PG'] >= 233.61.

1 Like

Thank you so much for this! I was still in the first chapter and hadn’t come across expand yet.

As you rightly pointed out, there was an error in defining the last constraint. It was supposed to be r[i, k] * X[i, j] on the LHS. But I had forgotten to multiply the second part.

I updated the constraint now to this:

# For each product, the total attributes contributed by all intermediates must not exceed the total allowed
subject to Attributes_Intermediates {j in PRODUCT, k in ATTRIBUTE}:
    sum {i in INTERMEDIATE} attributes_per_barrel[i, k] * Barrels_Intermediate_For_Product[i, j] <= max_attrib_per_product_barrel[j, k] * Barrels_Product_Made[j];

On running the solver, I now get a solution:

ampl: solve;
HiGHS 1.5.3: optimal solution; objective 648385.047
6 simplex iterations
0 barrier iterations
 
ampl: display Barrels_Product_Made;
Barrels_Product_Made [*] :=
 D   2237.04
HF  34823
PG   7284.4
RG  35505.6
;