A Chemical Batch Reactor Schedule Optimizer By Steve Morrison, Ph.D. 1997 Info@MethodicalMiracles.com 214-769-9081 Many chemical plants have a very similar configuration to pulp batch digesters; two examples are plants that make starch and nylon. The algorithm for scheduling batch reactors or batch reactor trains is almost identical to the algorithm for batch digester scheduling with two key differences. First, often a pipe header with various valves feeds the batch reactors instead of a conveyor belt. The difficulties of conveyor belt times and backing up the conveyor belt are not present. However, in their place are difficulties of simultaneously feeding different batch reactors given the valve configuration and possibilities with flexhoses. Also, the compatibility of one material flowing through a pipe dirtied by a previous material must be considered. Sometimes cleanouts are expensive; sometimes cleanouts are impossible. The second key difference is that instead of a blow header emptying the vessels, a typically more complex pipe header transfers the products to the product tanks. Again, multiple simultaneous transfers are possible because of internal valves in the header. Flexhoses may also be available on occasion, and cleanouts must also be addressed. This section demonstrates that the conveyor algorithm can be extended to other batch processing problems. Three section examines three cases: 1. One grade, no from-to times, different reactor train yields 2. One grade, from-to times, different reactor train processing times and yields 3. Many grades, fixed sequence of batches, no from-to times, different reactor train fingerprints All cases have the following characteristics in common. In this hypothetical plant there are twelve reactor trains. Each train three pieces of equipment: a pre-charge tank, a batch reactor, and a batch still to separate the product from the byproducts and unreacted feed. The pre-charge tanks are fed from one common feed header, and the main feed is identical for all grades. Different concentrations of additives are put in the batch reactors. While the additives themselves are not a scarce resource and outside the scheduling system, the products of each reactor train are not to be mixed together. There is no advantage of making one grade versus another in a particular reactor train. However, the reactor trains are different, and some have shorter processing times than others, and some trains produce a higher yield than others, though these effects are constant regardless of grade. Case 1. One Grade, No From-to Times, Different Reactor Train Yields The pipe header can fill multiple pre-charge tanks simultaneously, and there is essentially no constraint on the feed header. However, since the reactor trains often produce different product 1
grades, and metering the actual production of each reactor train is important, the plant policy is that no two batches are to flow through the product make header at the same time. Table 6.7 shows the times to sequence twelve reactor trains for twelve batches. Each reactor train gives a different yield. A key parameter is the sequencing time is the number of different processing times. Number of Different Processing Sequencing Times Time 8 64 seconds 7 65 seconds 6 62 seconds 5 18 seconds 4 15 seconds 3 7 seconds Table 6.7 Case 1: One Grade, No From-to Times, Different Reactor Processing Times. The time is proportional to the number of searches. The time is not a simple function of the number of different processing times, because the differences in processing times, and the number of reactors in each processing time, are also factors. This is why, for example, there is a large increase in processing times between 5 and 6 different processing times. In the particular example, three different reactor trains had the sixth processing time. The same program was used for both batch pulp reactors and case 1 except for one line of code which was altered to match the different requirements for the feed header. Note that overall, the times are much slower than the conveyor algorithm applied to batch pulp digesters. The conveyor belt was a dominant constraint with batch pulp digesters, and it is not a constraint here. While the results of Table 6.7 are somewhat disappointing, the situation is very different if the problem remains the same, but the algorithm is modified to have one additional bound added to the conveyor algorithm: the size or yield of the reactor. In the original version, a batch reactor would be tried if either it was available earlier or it was larger. In the new version, the bound on it being larger is tightened, by checking if the larger size is greater times the delay times the current optimum rate found so far. If it is not, then the larger size is not great enough to produce a new optimum and the batch reactor is not a candidate. Using this method, there is a surprising result; the problem is not NP-hard but rather has a strict polynomial time solution. When there is only one grade, and there are no from-to times for batch reactors, the problem can be solved in one iteration, using the rule of choosing the batch reactor that gives the maximum production rate. Over 80 batches can be optimally solved in less than one second. 2
Case 2: One Grade, From-to Times, Different Reactor Train Processing Times and Yields This case is like Case 1 except all batch reactors and batch stills have the same processing time. Different precharge tanks have different times, and there is an added constraint that the header can only fill one pre-charge tank at a time. This case is superficially closer to conveyor belts and batch pulp digesters. However, as long as there is only one grade and the precharge fill time is independent of the previous batch reactor used, the problem still has a polynomial time solution. The reason this problem reduces to a polynomial time solution is that for scheduling purposes, the precharge operation can be combined with the other operations, and there are no effects that effect a global optimum different than a local optimum. The lesson one can learn from these two cases is that it is not always obvious what is NP- Complete and what has a polynomial time solution. 3
Case 3: Many Grades, Fixed Sequence of Batches, No From-to Times, Different Reactor Train Fingerprints A reactor train fingerprint is describes the variation in batch duration or yield of a particular reactor train with respect to a particular grade. Only variations in duration are studied here. If the grades have different characteristics with different batch reactors, the problem often will not have a polynomial time solution. However, the problem can still be solved with the conveyor algorithm with an additional bound, that of improved makespan time due to the choice of reactor. While this method might often give optimal answers, there is no guarantee of a rigorous optimum. The total duration of a batch is the nominal grade duration plus the reactor train fingerprint, whether positive or negative. One can adjust the reactor train fingerprints by adding or subtracting a constant duration from each reactor train for a particular grade and changing the nominal grade duration by the same duration. In this case is convenient to set the minimum reactor train fingerprint for each grade be 0. This ensures that a lower bound for the reactor train fingerprints is 0. Table 6.8 is an example of nominal grade durations. If it is the case that there are no interactions except on the precharge and discharge steps, each of which are fifteen minutes regardless of grade, then the scheduler does not need to deal with all these durations, only the total. Grade A1 HA1 A2 HA2 B1 HB1 Charge 30 30 30 30 30 30 Steam 15 15 15 15 15 15 React 1:30 1:15 1:45 1:30 1:45 1:00 Quench 5 5 5 5 5 5 Separate 30 30 30 30 30 30 TOTAL 3:35 3:05 3:20 3:35 2:50 3:20 Table 6.8. Batch Reactor Nominal Grade Durations. Table 6.9 gives example reactor train fingerprints. Reactor/Gra A1 HA1 A2 HA2 B1 HB1 de 1 0 0 5 5 10 10 2 0 0 5 5 10 10 3 5 5 2 2 0 0 4 5 5 2 2 0 0 5 5 5 0 0 8 8 6 10 10 0 0 20 20 4
7 10 5 10 5 10 5 8 0 0 10 10 5 5 Table 6.9 Reactor Train Fingerprint Durations in Minutes. If there is no common discharge header and only one grade, then the problem is trivial; simply load each reactor train to minimize delays. If there is only one grade and a common discharge header, the problem is amenable to a conveyor algorithm solution. Either the best reactor for a sequence element is a) One of the currently available ones, or one that has superior characteristics to all that are currently available, or b) The best reactor is one with the best characteristics, or else it is one that is available sooner than all with the best characteristics. Option b is usually very rare since there is only one grade. However, if there are multiple grades, but the batches must be in a fixed order, scheduling is still amenable to the conveyor algorithm. The results of this are that if the batches are all of the same grade, or if the batches must run in a fixed order, then the optimal solution one can find in polynomial time. Simply choose the reactor with a conveyor algorithm. For choices with multiple grades, the solution can still be found with the conveyor algorithm in pseudo-polynomial time. That is the problem complexity grows exponentially with the number of possible grades and number of different kinds of reactors and linearly with the number of batches and reactors. At any point the solution is a) One of the currently available reactors or else a reactor with a better duration or yield for that grade, or b) A reactor with the best duration or yield for that grade or else one that is available sooner. The lesson one can derive from this example is that even for NP-Complete problems, attempting to solve the problem with the conveyor algorithm can still be successful in cases where much of the subsequence can be solved in polynomial or pseudo-polynomial time. 5