19
SAJJAD KHUDHUR ABBAS Ceo , Founder & Head of SHacademy Chemical Engineering , Al-Muthanna University, Iraq Oil & Gas Safety and Health Professional – OSHACADEMY Trainer of Trainers (TOT) - Canadian Center of Episode 50 : Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Episode 50 : Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Embed Size (px)

Citation preview

Page 1: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

SAJJAD KHUDHUR ABBASCeo , Founder & Head of SHacademyChemical Engineering , Al-Muthanna University, IraqOil & Gas Safety and Health Professional – OSHACADEMYTrainer of Trainers (TOT) - Canadian Center of Human Development

Episode 50 : Simulation Problem Solution Approaches

Convergence Techniques Simulation Strategies

Page 2: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

2

Convergence Techniques

A typical algorithm for Newton's method

i.Choose initial vector x(0)

ii. Set iteration counter i = 0

iii.Check convergence f (xi) iv.v.

vi. vii.

, if so stopSolve linear system J(xi) i = -f (xi ), for i

Update step x i+l = xi + i

i = i + 1 return to (iii)

Page 3: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

3

3.2.3.3. Quasi-Newton (QN) Methods

These methods represent a very important class of techniques because of their extensive use in practical alqorithms. They attempt to use an approximation to the Jacobian and then update this at each step thus reducing the overall computational work.

The QN method uses an approximation Hk to the true Jacobian i and computes the step via a Newton-like iteration. That is,

Hk sk = -fk ;x k+l = xk+ k sk

(3.11)

or for the inverse

Sk = (Hk) –1

We have, sk = -f k

(3.12)

We wish to update Sk or Hk in each iteration so that they approach the true Jacobian (or inverse). The type of updating formula determines the various QN methods. As previously defined we have,

(3.13)

andsk = p k+l = xk+1 -xk

q k+1 = f k+l - f kFor the QN process, p k+l and

The Taylor series would give,

q k+l = J k p k+l + ………

qk+1 can only be calculated after the step calculation.

(3.14)

However, the matrix Hk generally does not quantities correctly. That is,

q k+1 H k p k+1

orsk p k+l pk+1

(3.15)

Thus we want to update H k to H k+1 so that, q k+1 = H k p k+1. This is Newton (QN) condition.

the Quasi-

Page 4: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Main steps of a QN-method

A typical Broyden algorithm

1. Estimate H(O) by differencing and invert to S(O). Choose initial starting point x(o).2. Evaluate E(O) = f(x(o))T f(x(o)). If E(O) < , exit with solution x(o) .3. Estimate p (1) = - S(o) f(o) . Set i = 04. Let x (i+l) = x (i) + p (i+l) . Evaluate f (i+l) . Check Error E (i+l) .5. Evaluate denominator in update formula [(p k+l ) T S k q k+l]. If equal to 10 -6 go to step 7.6. Update inverse: Si+1 = Si + (p i +l - S i q i+1)(p i+l ) T/ [(p i+l ) T S i q i+l]7. Estimate new step. Set i = i + 1, then, set p i+l = -s i f i .8. Return to step 4.

Page 5: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Sparse Matrix Methods

Definition: A sparse matrix is a matrix in which zero components dominate.Aim: To eliminate operations on the zeros and so increase computation

speed and reduce storage requirements.

Structured Matrices: Tridiagonal systems where, A x = b

Page 6: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Example of an Unstructured matrix

1

1

f 5

1

1

1

f 3 1 1 1

f 4 1 11

A

f

1

2

In order to solve the problem Ax = b,

first we need to convert A into the structured form

x 1 x 2 x 3 x 4 x 5 f 1

1 1

Page 7: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

x = Q y (3.28)

Solving Sparse Linear Systems: A x = b

The general approach is to reduce A to block lower triangular form, although the matrix A could be treated directly using sparse elimination techniques. For the block lower triangular form we have permutation matrices P and Q such that we write our original system of equations as:

P A Q y = b` = P b(3.26)

and P A Q has the form:

ANN

AN1

A11

A21 A22

. ..

.

..

Matrices Aii ; i = 1(1)N are square diagonal block matrices. The above system of equations given by (3.26) can then be solved for y via a series of block forward substitutions,

A11 y 1 = b` 1

(3.27)Aii y i = b i - Aik y k ; i = 2(1)N

The solution of the original system is found from the vector y by a simple permutation.

Page 8: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

x 4 x 5 1

1 1 1 1

1 1 1

1 1

1 1 1

f 5

f 4

A 2

f 3

f

x 1 x 2 x 3

f1 1

We can regard this as permuting rows of A such thatB = R AR = 1, 3, 5, 4, 2

That is, we have,00111

1

1010A

1 0 0 1 0

10101 1

x 1 x 2 x 3

x 4

f1 1 1

1

1

1

1 B 2

f 3 1 1 1

1

11

10

101

x 5

4

f 5

f

f

1

Note the corrections for the lecture notes !

Page 9: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

We can now associate the permutation matrix D with the output variable order, ie., D = 1 4 2 5 3. We can apply these permutations to B such that M = D B D T to get,

0

0

1 0 00 0

0 0 1

0 0DT 0 0 0 0 1

1 0 0 10

1 1 0 1

0

B 1 0 1 0 1

1 0 0 00

0 0 0 1

0

D 0 1 0 0 0

2

We solve M y = D R b for y

and then, x = D y (3.34)

Note the corrections for the lecture notes !

0

0

0 0 1

1 0 0 1 0

0

1

0 0

0

0

1 00

0 1 1 1 1 0

0

0 1

x1 x 2 x 3 x 4 x 5

f1 1 1 0 0 0

f 1 1 0 0 0

f 3 1 1 1 0 0

f 4 0 1 1 1 1 f 5 1 0 0 1 1

Page 10: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Simulation Strategy: What to select?

E-1

E-2

E-3

R-1

SP-1

D-1

C-1

variables Solvex

M-1

x

x Equation Oriented

x

equations

x

x represents variables of the connecting streamsx

x

x

M-1 E-1 E-2 R-1 E-3 D-1 SP-1 C-1

Page 11: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

What is Simulation Strategy ?

* Determine appropriate solution method by analyzing the needs of the problem being solved

- Which approach to use ?

- Only one approach ?

- Choice of numerical method

- Initialization

Page 12: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

What is Simulation Strategy ?

* Determine appropriate solution method by analyzing the needs of the problem being solved

- Which approach to use ? Depends on the problem

- Only one approach ? Depends on the problem- Choice of numerical method Depends on choices made above

- Initialization

Page 13: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Selection of Simulation Approach*Recycle-loops: How many are present ?

* Process Model: Linear or non-linear ?

*Type of simulation problem: Identify type

* Process information: What is known ?

*Robustness: Must always give a result?

* Computational efficiency: Must be very fast?

Page 14: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Modular approach versus equation oriented approach

Strategy: Start with SM and switch to EO or

Two-Tier approach (simultaneous modular)

Sequential Modular Approach Equation Oriented ApproachSimulate one unit model at a time Solve all unit models together

Decompose flowsheet Order equationsIterate in tear streams Update all unknown

variables simultaneously

Less flexible but more robust More flexible but less robustInitialization is important Initialization is very important

Storage requirement not high Storage requirement can be very high

Page 15: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Convergence Techniques (Modular)

Table 3.1: The formof J that can be used in equations 3.35 –3.36 for different convergence techniques.

h (y) = y - w = 0

y i+l = y i – J h (y i)

Equation for tear- stream convergence

Update methodChoice of the method defines J

Flowsheeting problem, use SS and then WM, for specification problem, use Broydon

Method JSuccessive substitution I

Wegstein D= diag {d}; djj = (y i – y i -1)/(h i – h i -1) j

jjj

Dominant Eigen-value 1/(1 -) I; = (wi – wi -1)/( yi – yi -

1)Broydon’s rule Full matrix QN– update (see

3.2.3.3)Newton [ F( yi )/ y] –1

Page 16: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Table 3.1: The formof J that can be used in equations 3.35 –3.36 for different convergence techniques.

Convergence Techniques (Equation Oriented)

F A y - b = 0

y i+l = y i – J h (y i)

Mathematical model of process flowsheet

Update method

NM or QN-methods solve EO &

optimization problemsChoice of the method defines J

Method JSuccessive substitution I

Wegstein D= diag {d}; djj = (y i – y i -1)/(h i – h i -1) j

jjj

Dominant Eigen-value 1/(1 -) I; = (wi – wi -1)/( yi – yi

-1)Broydon’s rule Full matrix QN– update (see

3.2.3.3)Newton [ F( yi )/ y] –1

Page 17: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies
Page 18: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies
Page 19: Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques Simulation Strategies

Thanks for Watching Please follow me / SAJJAD KHUDHUR ABBAS