Lecture 5: Feedback Systems of Reactors

Download Report

Transcript Lecture 5: Feedback Systems of Reactors

Lecture 6: Feedback Systems
of Reactors
CE 498/698 and ERS 685
Principles of Water Quality
Modeling
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
1
Feedback
W1
Q01c0
Q12c1
W2
Q23c2
Q21c2
k1V1c1
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
k2V2c2
2
W1
Q01c0
W2
Q12c1
1
Q21c2
Q23c2
2
k1V1c1
k2V2c2
W1  Q01c0 
Lake 1:
V1
dc1
 W1  Q12 c1  k1V1c1  Q21c2
dt
Lake 2:
V2
dc2
 W2  Q12 c1  Q23c2  k 2V2 c2  Q21c2
dt
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
3
Lake 1:
dc1
V1
 W1  Q12 c1  k1V1c1  Q21c2
dt
Lake 2:
V2
dc2
 W2  Q12 c1  Q23c2  k 2V2 c2  Q21c2
dt
dc
Steady-state:
0
dt
a11c1  a12c2  W1
and
a11  Q12  k1V1
a21  Q12
a22  Q21  k 2V2  Q23
a12  Q21
CE 498/698 and ERS 685
(Spring 2004)
a21c1  a22c2  W2
Lecture 6
4
system parameters unknowns loadings
a11c1  a12 c2  a13c3  W1
a21c1  a22 c2  a23c3  W2
A C  W 
a31c1  a32 c2  a33c3  W3
LINEAR ALGEBRAIC EQUATIONS
Matrix algebra
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
5
a11c1  a12 c2  a13c3  W1
a21c1  a22 c2  a23c3  W2
A C  W 
a31c1  a32 c2  a33c3  W3
 a11
 A  a21
a31
a12
a22
a32
CE 498/698 and ERS 685
(Spring 2004)
a13 
a23 

a33 
 c1 
 
C  c2 
c 
 3
Lecture 6
W1 
 
W   W2 
W 
 3
6
Gauss-Jordan method
To compute the matrix inverse
Identity matrix
1 0 0
33 identity matrix: I   0 1 0


0 0 1
I  C   C
augmented matrix:
CE 498/698 and ERS 685
(Spring 2004)
 a11
a
 21
 a31
Lecture 6
a12
a22
a32
a13 1 0 0
a23 0 1 0

a33 0 0 1
7
Gauss-Jordan method
To compute the matrix inverse
1) Normalize
2) Elimination
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
8
Gauss-Jordan method
1) Normalize
 a11
a
 21
 a31

1

a21
a31

a22
a32
a13 1 0 0
a23 0 1 0

a33 0 0 1
a12
a11
a22
a32
a13
a11
a23
a33
a12
CE 498/698 and ERS 685
(Spring 2004)
1
a11
0
0
Divide by a11

0 0

1 0
0 1

Lecture 6
9
Gauss-Jordan method
2) Elimination

1

a21
a31

a12
a11
a22
a32
a13
a11
a23
a33
1
a11
0
0

 1

a21  a21

 a31


CE 498/698 and ERS 685
(Spring 2004)

0 0

1 0
0 1


a21

a12
a11
a
a22  12 a21
a11
a32
Lecture 6
a12
a21
a11

a13
1
a21
a21 0 0
a11
a11

a13
1

0 0
a11
a11

a
1
a23  13 a21  a21 1 0
a11
a11

a33
0
0 1


10
Gauss-Jordan method
2) Elimination

a12
1

a11

0 a  a12 a
22
21

a11

a12
a31
0 a32 
a11

CE 498/698 and ERS 685
(Spring 2004)

a13
1
0 0
a11
a11

a13
1
a23  a21  a21 1 0

a11
a11

a13
1
a33  a31  a31 0 1
a11
a11

Lecture 6
11
Gauss-Jordan method
1) Normalization

a12
1

a11

0 a  a12 a
22
21

a11

a12
a31
0 a32 
a11

CE 498/698 and ERS 685
(Spring 2004)

a13
1
0 0
a11
a11

a13
1
a23  a21  a21 1 0

a11
a11

a13
1
a33  a31  a31 0 1
a11
a11

Lecture 6
12
Gauss-Jordan method
1 0 0 a111

1
0
1
0
a
21

1
0 0 1 a31
a121
1
a22
1
a32
a131 
1 
a23

1

a33
Matrix inverse
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
13
Gauss-Jordan method
example
3c1  0.1c2  0.2c3  7.85
0.1c1  7c2  0.3c3  19.3
0.3c1  0.2c2  10c3  71.4
augmented
matrix
CE 498/698 and ERS 685
(Spring 2004)
 3  0.1  0.2 1 0 0
 0. 1
7
 0. 3 0 1 0 


0.3  0.2 10 0 0 1
Lecture 6
14
Gauss-Jordan method
example
Divide by 3
(normalize)
 3  0.1  0.2 1 0 0
 0. 1
7
 0. 3 0 1 0 


0.3  0.2 10 0 0 1
 1  0.033  0.067 0.333 0 0
 0 .1
7
 0 .3
0
1 0


10
0
0 1
0.3  0.2
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
15
Gauss-Jordan method
example
 1  0.033  0.067 0.333 0 0
 0 .1
7
 0 .3
0
1 0


10
0
0 1
0.3  0.2
Divide by 7.003
(normalize)
CE 498/698 and ERS 685
(Spring 2004)
1  0.033  0.067 0.333 0 0
0 7.003  0.293  0.033 1 0


0  0.190 10.020  0.100 0 1
Lecture 6
16
Gauss-Jordan method
example
0
0
1  0.033  0.067 0.333
0
1
 0.042  0.005 0.143 0


0
1
0  0.190 10.020  0.100
1 0  0.068 0.333 0.005 0
0 1  0.042  0.005 0.143 0


0 0 10.012  0.101 0.027 1
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
17
Gauss-Jordan method
example
1 0 0 0.332 0.005 0.007
0 1 0  0.005 0.143 0.004


0 0 1  0.010 0.003 0.100
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
18
Gauss-Jordan method
• Can also be used to solve for
concentrations
 a11
a
 21
 a31
a12
a22
a32
CE 498/698 and ERS 685
(Spring 2004)
a13 W1 
a23 W2 

a33 W3 
1 0 0 c1 
0 1 0 c 
2

0 0 1 c3 
Lecture 6
19
Excel - MINVERSE
1. Enter your [A] matrix
2. Block an area the same size
3. Type =MINVERSE(block location of
[A]matrix) and press
CNTL+SHIFT+ENTER
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
20
A C  W 
We want to solve for {C}
 A A1C   A1W 
Multiply both sides by [A]-1
 A A1  I 
I C  C
Definitions of identity matrix
C   A1W 
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
21
Homework Problem 6.2(a)
• Use both Gauss-Jordan method and
Excel MINVERSE function
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
22
{C} = response
{W} = forcing functions
[A]-1 = parameters
{response} =[interactions]{forcing functions}
Unit change in loading of reactor 2
c1  a111W1  a121W2  a131W3
Response of reactor 1
1
1
1
c2  a21
W1  a22
W2  a23
W3
1
1
c3  a31
W1  a32
W2  a331W3
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
23
Matrix Multiplication (Box 6.1)
# columns in matrix 1 = # rows in matrix 2
 a11
 AB  a21
a31
a12
a22
a32
a13  b11 b12 
a23  b21 b22 


a33  b31 b32 
 a11b11  a12b21  a13b31
 AB  a21b11  a22b21  a23b31


CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
a11b12  a12b22  a13b32 





24
Terminology


SUPERDIAGONAL 

Effects of d/s loadings



on u/s reactors














 SUBDIAGONAL

 Effects of u/s loadings

 on d/s reactors



CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
25
Time-variable response for
two reactors
dc1
V1
 W1  Q12 c1  k1V1c1  Q21c2
dt
dc2
V2
 W2  Q12 c1  Q23c2  k 2V2 c2  Q21c2
dt
Q12
dc1
11 
 k1
 11c1  12 c2
V1
dt
where
dc2
Q21
  21c1   22 c2
12 
dt
V
1
CE 498/698 and ERS 685
(Spring 2004)
Lecture 6
Q12
 21 
V2
Q23  Q12
 22 
 k2
V2
26
Time-variable response for
two reactors
General solution if c1=c10 at t = 0
c1  c1 f e
 f t
c2  c2 f e
where
 c1s e  t
 f t
s
 c2 s e  t
s
’s are functions of ’s
c’s are coefficients that depend on
eigenvalues and initial concentrations
f = fast eigenvalue
s = slow eigenvalue
CE 498/698 and ERS 685
(Spring 2004)
f >>s
Lecture 6
see formulas
on page 111
27