sequential modular

32
THE SEQUENTIAL MODULAR STRATEGY FOR STEADY-STATE PROCESS SIMULATION Once the D.O.F. for our flowsheet model have been satisfied, we must solve a fully determined system of nonlinear algebraic equations: fy 0 l y u (29 = where y R n is the vector of unknown process variables to be solved for, lu R , n are vectors of upper and lower bounds on the process variables (set by physical criteria) and f R R n n : . Simultaneous solution of typically 100s - 100,000s of equations requires an iterative process. The sequential modular strategy is one approach to solving this problem especially tailored to the network structure of process flowsheets. It is basically the technology of choice for steady-state process simulation. PARTITIONING AND PRECEDENCE ORDERING FLOWSHEETS Is there some way to make the above problem easier? Will it help if can we break it into a sequence of smaller problems? We have already seen that the ideas of partitioning and precedence ordering facilitate this. Motivations: a) if computation time grows super linearly with problem size n then solving a sequence of smaller problems is cheaper than solving one big problem. For example, recall that Gaussian elimination is a cubic function of the number of equations. If we can break the overall problem into two subproblems: n n n 2 2 3 3 3 + < and a lot less effort is expended in achieving a solution. b) the resulting subproblems may be easier to solve - e.g., less nonlinear. The sequential modular strategy expoits the topology (structure) of the flowsheet to suggest a partitioning and precedence ordering. As noted above, this is ideal for simulation studies on acyclic flowsheets.

Upload: niteeshasingh

Post on 28-Nov-2014

267 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Sequential Modular

THE SEQUENTIAL MODULAR STRATEGY FOR STEADY-STATE PROCESSSIMULATION

Once the D.O.F. for our flowsheet model have been satisfied, we must solve afully determined system of nonlinear algebraic equations:

f y 0l y u

( ) =≤ ≤

where y R∈ n is the vector of unknown process variables to be solved for,

l u R, ∈ n are vectors of upper and lower bounds on the process variables (set byphysical criteria) and f R Rn n: → .

Simultaneous solution of typically 100s - 100,000s of equations requires aniterative process. The sequential modular strategy is one approach to solving thisproblem especially tailored to the network structure of process flowsheets. It isbasically the technology of choice for steady-state process simulation.

PARTITIONING AND PRECEDENCE ORDERING FLOWSHEETS

Is there some way to make the above problem easier? Will it help if can webreak it into a sequence of smaller problems? We have already seen that theideas of partitioning and precedence ordering facilitate this.

Motivations:

a) if computation time grows super linearly with problem size n thensolving a sequence of smaller problems is cheaper than solving one bigproblem. For example, recall that Gaussian elimination is a cubic functionof the number of equations. If we can break the overall problem into twosubproblems:

n nn

2 2

3 33

+

<

and a lot less effort is expended in achieving a solution.

b) the resulting subproblems may be easier to solve - e.g., less nonlinear.

The sequential modular strategy expoits the topology (structure) of theflowsheet to suggest a partitioning and precedence ordering. As noted above,this is ideal for simulation studies on acyclic flowsheets.

Page 2: Sequential Modular

Example: acyclic flowsheet:

A B C D

E

unit and operating parameters

Partitioning: each unit operation model corresponds to a subproblem (subset ofequations f y( ) = 0)

All subproblems are solved in the same way:

Specify values of variables in input streams to a unit operation andthe unit and operating parameters

⇓Solve the unit operation model equations

⇓To give values for the variables in the outlet streams

Subproblems may or may not require iterative solution of the unit modelequations - if iterative solution required, may be able to exploit specific physicalfeatures of the subproblems.

Examples:

a) isothermal flash - problem can be reduced to an efficient iteration on asingle variable.

b) inside-out algorithms for rigorous distillation calculations - use idealizedphysical properties in outer loop, inner loop provides parameters.

Precedence Ordering: assume:

Page 3: Sequential Modular

a) values of all variables in feed streams to the process are known.

b) values of all the unit and operating parameters are known.

And then proceed in the sequence:

a) all inputs to A known - solve A for its outputs.

b) all input of B now known - solve B for its outputs

c) etc...until the whole flowsheet model is solved.

We have been successful in decomposing a large problems into a sequence ofsmaller (easier) subproblems. In the early days of process simulation usingcomputers, engineers first wrote computer programs to simulate individual unitoperations. Next, they wanted to simulate entire flowsheets. Using the existingunit operation programs and the above calculation sequence is the obvious wayto proceed.

Page 4: Sequential Modular

SEQUENTIAL MODULAR PROCESS FLOWSHEETING PACKAGES - BASICSTRUCTURE

Features:

a) process unit models precoded as subroutines and fixed, and a librarymade available to the user.

b) stream structure fixed - e.g., F T Pi , ,

c) solution procedures embedded in subroutines with unit model equations(e.g., no decoupling of model and calculation procedure).

d) inputs and results of unit model calculations (directionality) fixed - giveninputs, solve for the outputs.

e) hence, sequential solution of units from feed stream(s) to productstream(s).

Problems, what about:

i) recycle streams (material or information)

ii) downstream (design) specifications

in both cases, information flow is no longer unidirectional from feeds toproducts, and the above precedence ordering breaks down. So our main focuswill be on how to deal with recycle streams and design specifications (which areencountered in almost all real life problems).

SOLVING RECYCLE PROBLEMS

Consider a process with the following structure:

A B C D1 2 3

4

5 6

This can be solved in the sequence:

a) solve unit A for stream 2 given feed to process (stream 1)

Page 5: Sequential Modular

b) although stream 2 is now known, unit B cannot be solved unless bothstreams 2 and 4 are known. Similarly unit C cannot be solved for stream4 until stream 3 is calculated by solving unit B:

∴ units B and C must be solved simultaneously to determine streams 3,4 and 5.

c) given stream 5, solve unit D for stream 6.

This leads to three problems in setting up and solving flowsheets with recycles:

i) which minimal subsets of the units need to be solved simultaneously(partitioning)

ii) what is the correct order in which to solve these subsets of units(precedence ordering).

iii) how to solve a subset of units simultaneously (tearing).

We have already discussed a general and efficient approach to the partitioningand precedence ordering problem. We view the flowsheet as a digraph in which:

vertices ≡ unit operationsedges ≡ exist if information or material flows from one unit to

another. The direction of the flow gives the direction ofedge.

Delete feed and product streams. Example of directed graph:

A B C D1 2 3

4

5 6

A B C D2 3 5

Page 6: Sequential Modular

SOLVING THE PARTITIONS - TEARING

The Sargent and Westerberg algorithm for partitioning and precedence orderinggives us the following data:

a) a set of 'groups' of units

b) a correct computation sequence for these groups

Each group may:

a) contain a single unit - unit model subroutine already solves this problem

b) contain multiple units - partitioning guarantees that the members of thisgroup must be solved simultaneously

How do we solve these subsets of units simultaneously? Given a subset of unitsconnected in a cyclic graph:

A B CS1 S2 S3

S5

S4

Tearing is an approach that advocates the following algorithm:

a) guess (tear) one of the streams in the cycle (e.g., S5).

b) perform one calculation pass through the flowsheet.

c) compare the calculated value of the torn stream with the guessed value,and iterate until convergence.

Page 7: Sequential Modular

If we choose to tear S5:

A B CS1 S2 S3

S5

S4

S5'

Given S1 (from preceding partition or input to flowsheet):

1. Guess S52. Given S1 and S5, solve A for S23. Given S2, solve B for S34. Given S3, solve C for S4 and S5'5. Given S5', update guess for S56. Repeat from step 2 until converged

(e.g., S5 = S5')

In general, if the torn stream makes the graph acyclic, the partitioning andprecedence ordering algorithm can be used to derive a unidirectionalcomputation sequence automatically.

This leads to two further problems:

a) how to select which stream(s) to tear in order to break the cycle(s) - e.g.,how to derive the acyclic graph

b) how to update the guess for the torn stream(s) so that the iterativeprocess converges rapidly, and when to terminate the iterative process

Page 8: Sequential Modular

CONVERGENCE ALGORITHMS

Given an acyclic graph:

S5 S2 S3 S5'A B C

In a mathematical sense, S5' is a function of S5 only:

S g S5 5© ( )=

and at the converged solution S5 = S5'. Therefore, converging the torn flowsheetis equivalent to the mathematical problem:

x g x− ( ) = 0

where,

x = the set of stream variables in S5, a subset of the system variables

x y⊂( )

g x( ) = an implicit function evaluated by solving the sequence of unitoperation models. Note that we cannot derive the functional form of this equation explicitly, the functions can only be evaluated numerically by a flowsheet pass.

Remarks:

¥ we have reduced simultaneous solution of a large system of equations tothe simultaneous solution of a much smaller system of equations.

¥ we only have to derive good initial guesses for a small subset of thevariables (the tear stream variables) - rather than all the variables in theflowsheet!

¥ only a small subset of the variables have to be stored in computermemory at any time. This was an important issue in the early days, but itis irrelevant these days.

The pages that follow discuss different strategies for converging these ÔtearÕequations.

Page 9: Sequential Modular

SUCCESSIVE SUBSTITUTION

Idea: use last iteration to directly update torn stream (i.e., exploit the specificfunctional form of the tear equations).

Iterative process:

x g xk 1 k+ = ( ) (k = iteration number)

Note that this, and any other iterative process, is a difference equation, thediscrete analogue to a differential equation.

Advantages:

a) very simple to implement

b) requires very little computer storage

Disadvantages:

a) slow (linear) convergence. If the error at iteration k is defined as:

e x x xk= − * *( = the solution)

then

e ek k+ ≤ < <1 0 1α α( )

b) takes little account of the interaction between the different unknownvariables or between multiple tear streams - may not convergeflowsheets with many strongly interacting recycles.

c) very strict mathematical conditions for local convergence - define:

M ≡

∂∂

∂∂

∂∂

∂∂

gx

gx

gx

gx

n

n n

n

1

1

1

1

K

M O M

K

as the Jacobian matrix (matrix of partial derivatives of a vector offunctions) of g x( ) with respect to x . If the eigenvalues of M are evaluatedat the solution x * :

λ λ λ1 2, , ,K n{ }The if:

Page 10: Sequential Modular

max (spectral radius of )i=1 n i

K| |λ < 1 M

and x0 (the initial guess) is sufficiently close to the solution, the iterativeprocess will converge.

However, for reasons not entirely understood, empirical evidenceindicates that most flowsheets with a single tear stream seem to satisfythese conditions.

Also known as: functional iteration, direct substitution.

ACCELERATED SUCCESSIVE SUBSTITUTION - OVERRELAXATION

Overrelaxation is a technique used to accelerate convergence of iterativemethods for the solution of linear equations (Strang, 1988).

Idea: apply overrelaxation factor to weight the current and previous iterates andmove closer to the solution in a single step:

x x xk 1 k k 1+ += + −* ( )q q1

When applied to successive substitution on nonlinear equations, the analogy is:

x x g xk 1 k k+ = + −q q( ) ( )1If,

q = 0 successive substitution

q < 0 convergence acceleration

0 1< <q convergence stabilization by damping

However, it is difficult to choose a good value for q in advance - for example, theDominant Eigenvalue Method (DEM) monitors the residuals (or right hand sides)of the equations (i.e., the difference x g xk k− ( )) from one iteration to the next inorder to derive a value for q.

For the iteration to remain stable, a rough lower bound of q is -1 (if accelerationis applied at each iteration). This corresponds to an acceleration factor of 2 atbest. To obtain acceleration and stability, DEM only applies acceleration everyfew successive substitution iterations.

Page 11: Sequential Modular

DECOUPLED vs COUPLED VARIABLES

In flowsheeting problems, the iterate variables are neither all strongly coupled,nor all decoupled:

a) all species weakly coupled through VLE (if nonideal).

b) species strongly coupled if they participate in a reaction.

c) with more than one tear stream, strong coupling between the flowrate ofa chemical species in each tear stream.

If variables are uncoupled or weakly coupled, a single acceleration parameter forthe whole set of variables is not sufficient, one is needed for each variable.

WEGSTEIN'S METHOD

Idea: treat each variable with the one dimensional secant method by driving itwith a uniquely associated function. This implies that interactions with othervariables are neglected.

Given: values of argument and function from two successive substitution steps(i.e., x g xk 1k = −( )):

x g x

x g x

k 1 k 1

k k

− −{ }( ){ },

,

( )

Calculate (for each variable j):

a)

s

x x

g gjjk

jk

jk

jk=

−−

1

1( ) ( )x x(inverse of the slope)

b)

q

sjj

=−1

1

c) x q x q xjk

j jk

j jk+ −= + −1 1 1( )

This is also an overrelaxation method, but an individual overrelaxation factor isderived for each variable.

If Wegstein is applied to every step, it is also likely to suffer from instability (if qj

large and negative).

Page 12: Sequential Modular

BOUNDED WEGSTEIN'S METHOD

In order to control stability, the Bounded Wegstein Method is used in mostprocess simulators:

a) compute qj

as above

b) bound qj

in the interval [-n,0].

Upper bound ensures the method defaults to successive substitution.

Lower bound -n in the range -2 to -5 to control stability.

Alternatively, relax the lower bound, but apply Wegstein acceleration only everyfew successive substitution steps. ASPENPLUS has options to control all theseparameters.

Remarks:

¥ if each variable strongly influences a particular and unique function, andwe are fortunate enough to select that association, then Wegstein is likelyto accelerate convergence.

¥ this association is very clear in the case of a single tear stream.

¥ Wegstein's method is very good for partitions with a single tear stream.

NEWTON'S METHOD

Solve general set of nonlinear equations:

f x x g x 0( ) ( )= − =

with Newton family method (multi-dimensional equivalent of Newton Raphsonprocedure in one variable). Iterative process:

x x J x f xk k k k+ −= −1 1( ) ( )

where

J= Jacobian matrix of f x( ) with respect to x .

Page 13: Sequential Modular

Advantages:

a) rapid (quadratic) convergence:

e ek k+ ≤1 2α

b) good for highly interacting flowsheets because interaction betweenvariables fully taken into account by the Jacobian matrix.

Disadvantages

a) requires good initial guesses ( x0 ).

b) because functions g x( ) are not known explicitly, must derive a numericalapproximation to J for each iteration - use finite differenceapproximation.

In practice, one never inverts the Jacobian. Instead, the linear system:

Jp f xk= − ( )

is solved, where:

p x xk k= −+1

FINITE DIFFERENCE APPROXIMATION

Idea: use finite differences to approximate the Jacobian:

J

fxiji

j

≈∆∆

Algorithm:

i) given xk , calculate a single pass through the flowsheet to yield:

g x f xk k( ) → ( ).

ii) ∀ =j N1K (N = number of unknowns):

a) x x xj j

kj

* = + ∆ (perturb jth variable)

b) perform single pass through flowsheet:

→ f x x x* *, , , ,( )1k

j NkK K

Page 14: Sequential Modular

c)

J

fx

f fxij

i

j

i ik

j

= ≈−∂

* ( )x∆

Therefore, N+1 passes through the flowsheet are required to get J before thenext step xk 1+ can be calculated. Meanwhile, Wegstein may have converged infewer than N+1 passes through the flowsheet! In practice, NewtonÕs method isusually too expensive. It should only be used when no other method willconverge due to a high level of interaction of the iterate variables.

QUASI NEWTON METHODS - BROYDEN'S METHOD

Idea: approximation to the Jacobian matrix is updated at each iteration usingonly current and previous values of x and f x( ) .

Iterative process:

x x W f xk k k k+ = +1 ( )

where Wk is an approximation to the negative inverse of the Jacobian matrix J(hence no need to invert matrix at each step).

During each iteration, update Wk according to the formula (least change secantupdate):

W W

p W y p W

p W yk k

k k k kT k

kT k k

+ = − +1 ( )

where:

p x xk k k= −+1

y f x f xk k k= −+( ) ( )1

Advantages:

a) only requires a single pass through the flowsheet at each iteration.

b) accurately reflects interaction of variables. Again, good for highlycoupled problems.

c) no need to invert approximation to Jacobian at each step.

Disadvantages:

a) convergence is only superlinear (not quadratic). Ultimately we face thetrade-off that the number of steps with Newton's method less than with

Page 15: Sequential Modular

Broyden's method, but the cost per step of Broyden's method issubstantially less.

b) what W0 to use?

i) −I

ii) − ( )−J x0

1- calculate by finite differences (N+1 flowsheet passes) and

then invert.

Meanwhile, Wegstein's method may have converged.

CONVERGENCE CRITERIA

How to decide when to terminate the iterative process?

a) the tear equations are satisfied, e.g.:

f x x g x( ) ( )k k k= − ≤ ε

b) the iterate variables are not changing from one iteration to the next, e.g.:

i) relative error check:

x x xk kr

k+ − ≤1 ε

ii) absolute error check:

x xk ka

+ − ≤1 ε

iii) or combine both:

x x xk kr

ka

+ − ≤ +1 ε ε

x ≡ some norm of the vector x . Note these two approaches only equivalentwith successive substitution (e.g., x g xk k+ =1 ( )).

Neither guarantees we have found a solution to the problem. For example:

i) criterion a) could imply the function is very close to zero, but does notcross zero - e.g., an asymptote.

ii) criterion b) could merely imply the iterative process is making noprogress towards the solution -

f x( )k >> ε .

Page 16: Sequential Modular

iii) badly posed problem (redundant specification) - may have infinitesolutions. Iterative process will converge to an arbitrary solution.

iv) convergence only within the specified tolerance - try again with a tightertolerance.

v) tear function may be converged, but individual unit calculations may notbe converged, or in error - check diagnostics generated by simulator

Always check the results of a numerical calculation:

a) make sure you know what convergence criterion the simulator is using!

b) hand calculations - e.g., overall mass and energy balances satisfied.

c) look at the figures - do they make sense? Engineering judgement andexperience.

Page 17: Sequential Modular

NESTED RECYCLE LOOPS

Consider the following flowsheet partition with two nested recycle loops:

A B C DS1 S2 S3 S4 S6

S5

S7

One approach to solving this problem is to tear streams 5 and 7 and set up anested iteration. This is illustrated as a flowchart composed of unit operationcalculations in Figure 1.

xo

7Update

Stream 7

x1

B

C

D

UpdateStream 5

x5o

A

Figure 1: Flowchart for Nested Iteration

Note the idea of a convergence block inserted in the calculation sequence: theconvergence block calculates an updated value for the tear stream (the outputstream from the block) from the current value of the tear stream calculated froma (possibly partial) flowsheet pass (the input stream from the block). The

Page 18: Sequential Modular

equation encapsulated by the convergence block and used to update the tearstream may be any of the iterative methods discussed in the preceding sections.

The disadvantages of a nested iteration are that:

1. it is very computationally expensive: the inner recycle loop must beconverged for each iteration on the outer recycle loop.

2. the nested iterations interact. In general, nested iterations tend to interactstrongly and lead to severe convergence problems (except in very specificcases where there can be an advantage).

So this leads to the following idea (which is one of the most intensively studiedacademic problems in this area): can we select the tear streams so as to improvethe performance of the iterative procedure?

Simple example: select the tear stream in the above example so that nesting isnot necessary:

S1A

S2B

S3' S3C

S4D

S6

S5

S7

Tearing S3 alone makes the flowsheet acyclic. Given a guess for S3, S3' can becalculated from a single pass through the flowsheet.

Page 19: Sequential Modular

SELECTING TEAR SETS

The objective here is to transform a cyclic flowsheet into an acyclic flowsheet bytearing a subset of the streams. This immediately leads to a constraint: enoughstreams must be torn so that each cycle in the flowsheet is opened at least once.

How can we formulate this constraint systematically in mathematical terms? Ifthis is possible, we might be able to automatically identify situations such as theone above in which nested iterations can be avoided by careful selection of thetear stream(s). We shall illustrate this with the cyclic flowsheet shown in Figure 2.Again we view the process flowsheet as a digraph.

S1 S2 S3 S4 S5

S7

S8

S6

Figure 2: Cyclic Flowsheet

Algorithm:

1. Trace all the elementary cycles in the digraph:

Cycle 1: S2, S3, S4, S8Cycle 2: S2, S6, S8Cycle 3: S3, S7

We have already seen a couple of simple minded approaches for this step.Efficient algorithms exist for this purpose.

2. Construct the cycle/stream matrix M where columns correspond to theprocess streams and rows correspond to the cycles, and:

Mij = 1 if cycle i contains stream j

= 0 otherwise

Page 20: Sequential Modular

For our example this leads to:

Streams

CyclesC1C2C3

S1 S2 S3 S4 S5 S6 S7 S8

0 1 1 1 0 0 0 10 1 0 0 0 1 0 10 0 1 0 0 0 1 0

3. Introduce binary (i.e., they can only be either zero or unity) variables( zj ∈ { }0 1, ) for each stream to indicate that:

zj= 1 if stream j is torn

= 0 otherwise

We can now formulate the constraint that the torn flowsheet must be acyclicmathematically. Using the matrix M , determine zj that will satisfy theinequality:

M z iij j

j

NStream

≥ ∀=∑ 1

1

cycles

In words: choose a set of streams to tear such that each cycle is opened atleast once. A flowsheet with all cycles opened at least once will be acyclic. Thisis a set covering constraint, which is a standard constraint in combinatorialoptimization.

4. Given the acyclic digraph, determine the calculation sequence for the units inthe flowsheet.

Remarks on his approach:

a) the set of tear streams to be torn Ð S z j NStreamj j: = ={ }1 1, K is called a

tear set.

b) a valid tear set is one that opens each cycle at least once; i.e., the values of

zj satisfy the set covering constraint.

c) there is always more than one valid tear set in a flowsheet!

Remark c) is easily demonstrated for the flowsheet in Figure 2; valid tear setsinclude:

{S4, S6, S7}, {S2, S3}, {S3, S6}, etc., etc. . . .

Page 21: Sequential Modular

OPTIMAL TEAR SETS

So far we have only defined a feasibility problem that meets our primary objective(derive an acyclic graph):

Feasibility problem: select a valid tear set.

As there are always multiple solutions to this feasibility problem, we can take theanalysis one step further and pose an optimization problem:

Optimization problem: select the best valid tear set (search over the space ofvalid (or feasible) tear sets for the best one according to a preselected criterion).

For the latter, we must define what we mean by the best tear set: a secondaryobjective. Note that solving a steady-state simulation is also a feasibility problem,but (we hope) it has a unique solution. Alternatively, we bound the solutionspace to find the desired solution. This is the first of many optimization problemsthat we shall see.

Table 1 summarizes some of the criteria that have been advocated in theextensive literature on this subject. Remarks:

a) criterion 4 is really our secondary objective.

b) it has been shown that criterion 4 is equivalent to selecting a tear set thatopens each cycle the minimum number of times Ñ reasoning from theproperties of the successive substitution iteration.

All four criteria can be interpreted as minimizing a sum of weights on eachstream:

Minimize w zj j

j

NStream

=∑

1

Therefore, we can formulate this secondary objective and the constraints derivedfrom the primary objective as a constrained optimization problem: given thecycle/stream matrix M and the stream weights wj , determine the binaryvariables zj so as to:

Minimize w zj j

j

NStream

=∑

1

(objective)

Subject to : cycles M z iij j

j

NStream

≥ ∀=∑ 1

1

(constraints)

Page 22: Sequential Modular

Table 1: Criteria for an 'Optimal' Tear Set

Reasoning Criterion

1. Nested iterations are problematic andobtaining good initial guesses is difficult

Choose a tear set with theminimum number of streams(cardinality). Still may bemultiple solutions.

2. Different streams may have a differentnumber of unknowns appearing in them(especially if there are design specificationson internal streams). Hence, minimize thenumber of equations in the tear iteration.

Choose a tear set with theminimum total number ofunknowns.

3. It may be more difficult to get an initialguess for certain streams.

Weight each stream accordingto the difficulty in guessing it.Choose the tear set whichminimizes the sum of theweights.

4. Really, our objective is to obtainconvergence as quickly as possible.

Choose the tear set thatminimizes the number ofiterations required forconvergence.

The above mathematical formulation of an optimization problem is known as amathematical program.

Remarks:

a) in general, set covering problems are difficult to solve (NP-complete).Many special algorithms have been devised for the tearing problem

b) the weights are derived from the criterion chosen. For criterion:

1. w j NStreamj = ∀ =1 1K

2. wj = number of unknown variables in stream j

3. wj = degree of difficulty of guessing stream j (subjective)

4. wj = number of cycles containing stream j:

=∑Miji

NCycle

1

Page 23: Sequential Modular

c) most modern simulators automate this task, but the user has the optionto intervene and specify a valid tear set if, for example, there is somespecial characteristic of the current problem.

MULTIPLE TEAR STREAMS

In some cases, a valid tear set containing only one stream does not exist. In thiscase, it is inevitable that multiple streams must be torn.

Example:

A B C DS1 S2 S3 S4 S7

S6

S5

Valid tear sets: {S2, S3}, {S6, S3}, {S2, S4}, etc.. All have cardinality > 1.

How to solve problems with more than one tear stream?

a) resort to nested iteration scheme (undesirable).

b) solve both tear streams simultaneously.

Warning: ASPEN PLUS defaults to nested iteration!

Page 24: Sequential Modular

SIMULTANEOUS CONVERGENCE OF MULTIPLE TEAR STREAMS

A B C DS1 S2 S3 S4 S7

S6

S5 S5'

S6'

Algorithm:

a) guess S6 and S5.

b) calculate single pass through flowsheet.

c) update S5 and S6 simultaneously (simultaneous convergence block).

This is equivalent to solving the system of simultaneous nonlinear equationswith the convergence method:

x g x x

x g x x5 5 5 6

6 6 5 6

00

− =− =

( )( ),

,

where xj is the subset of variables in stream j.

Remarks:

a) note the functional form of the equation; interaction of variables isinevitable.

b) use a convergence method that takes interaction of variables intoaccount; Broyden, Newton (not Wegstein).

c) user must usually define a convergence block and the tear streams to thesimulator in order to take advantage of this approach.

Page 25: Sequential Modular

DESIGN SPECIFICATIONS

Example:

S1

S2

S3 S4 S5B1 B2 B3 B4

B5

S7

S8

S6

A

B

A + B -> C

C

Problem: design the flowsheet so that molar ratio of reactants in the feed streamto the reactor (S4) is R:

F

FRA

B

4

4

,

,

=

One extra equation => one less degree of freedom => must release a specificationon one variable. Adjust the flowrate of S2 to achieve this specification (themanipulated variable).

There are a variety of ways of converging a flowsheet with design specificationsas described in the pages that follow.

Page 26: Sequential Modular

LOCAL CONTROLLERS

Some design specifications can be handled by a single unit operation model,provided the manipulated and sampled variables both occur in the same unitoperation.

Example: design a distillation column to achieve a desired overhead purity byadjusting the reflux ratio.

Rxi

¥ the unit operation model subroutine can be modified to solve severaldifferent problems Ñ e.g., a predetermined set of design problems as wellas the standard simulation problem.

¥ can use tailored algorithms to converge design problems.

However: many design specifications involve manipulated and sampledvariables distributed throughout the flowsheet.

Page 27: Sequential Modular

CONTROL BLOCK APPROACH

Idea: add controller block that adjusts the manipulated variable so as to satisfythe design specification (analogy to feedback controller for regulatory control ofprocess dynamics).

S1

S2

S3 S4 S5A B C D

E

S7

S8

S6

Controller

R*

F 4,A

F4,B

F2

= information flow

Advantage: use standard tearing techniques already developed for materialand/or energy flows.

Disadvantages:

¥ adds more recycles to the flowsheet.

¥ very difficult to derive a general-purpose and reliable control law.

¥ design specifications and manipulated variables must be paired, henceinteraction ignored when there are multiple controllers.

Page 28: Sequential Modular

NESTED CONTROLLERS

Idea: set up a nested iteration with a flowsheet simulation problem as thesubproblem or inner loop.

Algorithm:

START

Updatemanipulated

variable

Convergeflowsheet

(simulation problem)

Evaluatefunction that

definesdesign specification

For outer iteration, use iterative method for a single equation in a singleunknown (e.g., secant method).

Advantages:

¥ no user intervention required.

¥ intuitive - controlled sensitivity study approach.

Page 29: Sequential Modular

Disadvantages:

¥ extremely expensive - flowsheet must be converged for each functionevaluation of the outer iteration.

¥ multiple design specifications establish further levels of nesting.

¥ may be impossible to converge inner iteration(s) for certain values of themanipulated variables - how to continue the iterative process?

¥ usual convergence problems with nested iterations.

Note: this is the method that ASPEN PLUS defaults to. My experience indicatesthat sometimes it tries to be a little more clever than always putting theflowsheet convergence as the innermost iteration.

GENERALIZED EXECUTIVE CONTROLLERS

Idea: solve all the tear streams and all the design specifications simultaneously.

Example:

S1

S2

S3 S4 S5A B C D

E

S7

S8

S6

Solve the following system of equations simultaneously:

x g x

x7 7 7 2

7 2

0

0

− =

=

( )

( )

,

,

F

f Fwhere,

f F

F

FRA

B

( )x7 2

4

4

, ,

,

≡ − (implicit function)

Note that the design specification is not in the functional form required forsuccessive substitution and its variants.

Page 30: Sequential Modular

We can extend this generalized executive controller approach to a powerful andgeneral formulation for the case where there are multiple tear streams andmultiple design specifications. Solve the system of simultaneous nonlinearequations:

x g z xf z x

j j j j N

j j N

j N− = ∀ ==

=

=

( )( )

,,

,

,

1

1

0 10

K

K

K

where,

N = number of tear streams z = vector of manipulated variables f = vector of design specifications

Remarks:

¥ no good unless the iterative procedure used takes variable interactioninto account.

¥ Broyden's method is extremely successful when applied to generalizedexecutive controllers (Perkins, 1979).

¥ the system of equations that must be solved by the iterative process islarger (but still much smaller than the overall process model). This is not areal problem with today's computers.

¥ relatively efficient and robust iteration.

¥ no need for one to one matching between design specifications andmanipulated variables.

¥ in ASPEN PLUS user must set up simultaneous convergence blockmanually.

A pictorial illustration of this approach is shown in Figure 3.

Page 31: Sequential Modular

A B C D

f(y,x j) y

g j (y,x j ) xjx j − g j (y,xj ) = 0

f (y,xj ) = 0

Figure 3: Generalized Executive Controller

CRITIQUE OF THE SEQUENTIAL MODULAR APPROACH

Advantages:

i) executive program very simple, due to the assumption that unit modelscalculate outputs given inputs.

ii) much smaller computer memory requirements. Only those equationsinvolving one unit operation need to be solved simultaneously.Important issue in the early days (not that important any more).

iii) large number of existing unit operation models that calculate outputsgiven inputs. Further, solution methods can be tailored to a particularunit operation: initialization of iterative calculations, use of ideal physicalproperty models to initialize calculations with more sophisticated ones,special model specific procedures (e.g., flash calculations).

iv) intuitive solution strategy - easy for the users to understand (!).

v) clear, understandable error messages (!), problems localized to individualunit operations or recycle stream(s).

vi) good heuristics for initialization and convergence. In practice very robust(in comparison to equation oriented solution technologies).

Disadvantages:

Page 32: Sequential Modular

i) unit models must be coded with their solution routines. Considerableeffort to add or modify models. Unit models only do one type ofcalculation and extra code must be added for localized design calculations.

ii) difficult to converge highly integrated processes - i.e., many recyclestreams.

iii) design calculations much more difficult to set up and converge thansimulation calculations, and more computationally costly.

iv) computationally expensive, in general multiple passes through theflowsheet required.

v) may converge badly posed problems - e.g., redundant specifications(fault with the convergence criterion). Always check results for garbage.

vi) has proven difficult (impossible) to extend to other calculations - e.g.,dynamic simulation, flowsheet optimization.

REFERENCES AND FURTHER READING

1. Biegler L. T., ÒChemical Process SimulationÓ, Chemical Engineering Progress,pp. 50-61, October 1989.

2. Mah R. S. H., ÒChemical Process Structures and Information FlowsÓ, chapter4, Butterworths, 1990.

3. Perkins J. D., ÒEfficient Solution of Design Problems Using a SequentialModular Flowsheeting ProgrammeÓ, Computers and Chemical Engineering, 3,375, 1979.

4. Reklaitis G., ÒIntroduction to Mass and Energy BalancesÓ, Wiley, 1983.

5. Schad R. C., ÒDonÕt Let Recycle Streams Stymie Your SimulationsÓ, ChemicalEngineering Progress, pp. 68-76, December 1994.

6. Strang G., ÒLinear Algebra and its ApplicationsÓ, chapter 7, 3rd edition,Harcourt Brace Jovanovich, 1988.

7. Westerberg A. W., H. P. Hutchinson, R. L. Motard and P. Winter, ÒProcessFlowsheetingÓ, Cambridge University Press, 1979.