optimal design of energy systems
TRANSCRIPT
Optimal Design of Energy Systems
Chapter 4 Equation Fitting
Min Soo KIM
Department of Mechanical and Aerospace EngineeringSeoul National University
EquationDevelopment
โข Performance characteristics of equipment
โข Behavior of processes
โข Thermodynamic properties of substances
Key elements
โข To facilitate the process of system simulation
โข To develop a mathematical statement for optimization
Purposes
Chapter 4. Equation fitting
4.1 Mathematical modeling
11 12 1
1 2
n
m m mn
a a a
a a a
Order of matrix m n
T
A Transpose of a matrix [A] => interchanging rows & columns
ex>
1 4
2 5
3 6
A
1 2 3
4 5 6
TA
Chapter 4. Equation fitting
4.2 Matrices
โข Multiplying two matrices
# of columns of the left matrix = # of rows of the right matrix
๐11 โฏ ๐1๐โฎ โฑ โฎ
๐๐1 โฏ ๐๐๐
ร๐11 โฏ ๐1๐โฎ โฑ โฎ๐๐1 โฏ ๐๐๐
โ ๐ร ๐ ๐๐๐ก๐๐๐ฅ
Chapter 4. Equation fitting
4.2 Matrices
โข Simultaneous linear equations
1 2 3
1 2
1 2 3
2 3 6
3 1
4 2 0
x x x
x x
x x x
1
2
3
2 1 3 6
1 3 0 1
4 2 1 0
x
x
x
Chapter 4. Equation fitting
4.2 Matrices
โข Determinant (scalar)
11 12 13
21 22 23
31 32 33
a a a
D a a a
a a a
11 22 33 12 23 31 13 21 32
31 22 13 21 12 33 11 23 32
a a a a a a a a a
a a a a a a a a a
cofactor of
22 33 23 32a a a a
11a [( 1) ]i
[ ]
i j
ij
submatrix formed
by striking outA
th row and j th
column of A
Cofactor of ๐๐๐
Chapter 4. Equation fitting
4.2 Matrices
= ๐11๐ด11 + ๐21๐ด21 + ๐31๐ด31
Example 4.1 : Matrices
Evaluate
1034
21โ12
โ1211
0025
(Solution)
Find row which has many zeros if possible => second row!
det
Chapter 4. Equation fitting
= ๐21๐ด21 + ๐22๐ด22 + ๐23๐ด23 + ๐24๐ด24
= 0 ๐ด21 + 1 โ1 2+21 โ1 03 1 24 1 5
+ 2 โ1 2+31 2 03 โ1 24 2 5
+ (0)๐ด24
= 0 + 10 + 46 + 0 = 56
11 12 13 1 1
21 22 23 2 2
31 32 33 3 3
[ ][ ] [ ]
a a a x b
A X a a a x b B
a a a x b
11 1 12 2 13 3 1
21 1 22 2 23 3 2
31 1 32 2 33 3 3
a x a x a x b
a x a x a x b
a x a x a x b
Simultaneous linear equations
Matrix form
Chapter 4. Equation fitting
4.3 Solution of simultaneous equation
[ ] [ ] ii
A matrix with B matrix substituted in th columnx
A
โข Crammerโs rule
Chapter 4. Equation fitting
4.3 Solution of simultaneous equation
Example 4.2
Using Cramerโs rule, get ๐ฅ2
2 1 โ11 โ2 2โ1 0 3
๐ฅ1๐ฅ2๐ฅ3
=390
(Solution)
๐ฅ2 =
2 3 โ11 9 2โ1 0 32 1 โ11 โ2 2โ1 0 3
=30
โ15= โ2
Coefficient matrix [A]
Triangular matrix
Back substitution
โข Gaussian elimination
Chapter 4. Equation fitting
4.3 Solution of simultaneous equation
2
0 1 2
n
ny a a x a x a x
โข degree of the eq = highest exponent of x
โข # of data point = degree + 1 โ exact expression
> โ best fit
Chapter 4. Equation fitting
4.4 Polynomial representations
Points are equally spaced
Derive 4th degree polynomial
n=4
2
0 1 0 2 0
3 4
3 0 4 0
( ) ( )
( ) ( )
n ny y a x x a x x
R R
n na x x a x x
R R
1 0 1n nx x x x x
2
0 1 2
n
ny a a x a x a x
(next page)
Eq. (4.16)
4
x
Chapter 4. Equation fitting
4.6 Simplifications when the independent variable is uniformly spaced
2 3 4
1 0 1 0 1 0 1 01 1 2 3 4
1 2 3 4
4( ) 4( ) 4( ) 4( )x x x x x x x xy a a a a
R R R R
a a a a
0 0
1 1 1 2 3 4
2 2 1 2 3 4
3 3 1 2 3 4
4 4 1 2 3 4
,
,
, 2 4 8 16
, 3 9 27 64
, 4 16 64 256
x x y y
x x y y a a a a
x x y a a a a
x x y a a a a
x x y a a a a
if substitute (x1,y1)
Substitute all the points to Equation (4.16)
Chapter 4. Equation fitting
4.6 Simplifications when the independent variable is uniformly spaced
Chapter 4. Equation fitting
4.6 Simplifications when the independent variable is uniformly spaced
2
0 1 2y a a x a x
1 2 3 2 1 3 3 1 2( )( ) ( )( ) ( )( )y c x x x x c x x x x c x x x x
1 1 1 1 2 1 3, ( )( )x x y c x x x x
2 2 2 2 1 2 3, ( )( )x x y c x x x x
3 3 3 3 1 3 2, ( )( )x x y c x x x x
1 1
( ) ( )
( ) ( )
nnj i
i
i j i j i i
x x ommiting x xy y
x x ommiting x x
Chapter 4. Equation fitting
4.7 Lagrange interpolation
2
1 1 1 1 1:S P a b Q c Q
2
2 2 2 2 2:S P a b Q c Q
2
3 3 3 3 3:S P a b Q c Q
2
0 1 2
2
0 1 2
2
0 1 2
( )
( )
( )
a S A A S A S
b S B B S B S
c S C C S C S
2( ) ( ) ( )P a S b S Q c S Q
Chapter 4. Equation fitting
4.8 Function of two variables
Example 4.3 : Function of two variables
The range is the difference between the inlet and outlet temperatures of thewater. In table below, for example, when the wet-bulb temperature is 20โand the range is 10โ, inlet and outlet temperature are 35.9โ and 25.9โeach. Express the outlet temperature ๐ in Table below as a function of thewet-bulb temperature (WBT) and the range R
Chapter 4. Equation fitting
Wet-bulb temperature, โ
Range, โ 20 23 26
10 25.9 27.5 29.4
16 27.0 28.4 30.2
22 28.4 29.6 31.3
(Solution)For 3 WBTs, get parabola that represents (R,t)
i) For WBT = 20โ
(R,t) : (10,25.9), (16,27.0), (22,28.4)
โ ๐ก = 24.733 + 0.075006๐ + 0.004146๐ 2
ii) For WBT = 23โ
โ ๐ก = 26.667 + 0.041659๐ + 0.0041469๐ 2
iii) For WBT = 26โ
โ ๐ก = 28.733 + 0.024999๐ + 0.0041467๐ 2
Example 4.3 : Function of two variables
Chapter 4. Equation fitting
(Solution)
Set 2nd degree equation (constant terms(C) , WBT) โถ 24.733,20 , 26.667,23 , 28.733,26
โ ๐ถ = 15.247 + 0.32637๐๐ต๐ + 0.007380๐๐ต๐2
Set 2nd degree equation (coefficient of ๐ , WBT) and (coefficient of ๐ 2 , WBT) as well
๐ก = 15.247 + 0.32637๐๐ต๐ + 0.007380๐๐ต๐2 +0.72375 โ 0.050978๐๐ต๐ + 0.000927๐๐ต๐2 ๐ +
(0.004147 + 0๐๐ต๐ + 0๐๐ต๐2)๐ 2
Chapter 4. Equation fitting
4.9 Exponential forms
ln ln ln
my bx
y b m x
Log-log plot (y=bxm)
If y approaches some value b, as orx x
Estimate b
Calculate m with log-log plot (y-b vs. x)
Fitting (y vs. xm)
Correct value of b
Curve y=b+axm
my b ax
Chapter 4. Equation fitting
4.9 Exponential forms
Misuse of least square method
Example of least square method
Misuses of least square method
(a) Questionable correlation
(b) Applying too low degree
Chapter 4. Equation fitting
4.10 Best fit : Method of least squares
The sum of the squares of the deviation is a minimum
y a bx
2( ) 0i i
za bx y
a
2
1
( ) minm
i i
i
z a bx y
2( ) 0i i i
za bx y x
b
i ima b x y 2
i i i ia x b x x y
Chapter 4. Equation fitting
4.10 Best fit : Method of least squares
โข Method of least square for
Example 4.4 : Best fit : Method of least squares
Determine ๐0 and ๐1 in the equation ๐ฆ = ๐0 + ๐1๐ฅ to provide a best fit inthe sense of least-squares deviation to the data points (1, 4.9), (3, 11.2), (4,13.7), and (6, 20.1)
(Solution)
Chapter 4. Equation fitting
๐ฅ๐ ๐ฆ๐ ๐ฅ๐2 ๐ฅ๐๐ฆ๐
1 4.9 1 4.9
3 11.2 9 33.6
4 13.7 16 54.8
6 20.1 36 120.6
โ 14 49.9 62 213.9
๐ = 44๐0 + 14๐1 = 49.914๐0 + 62๐1 = 213.9
i ima b x y 2
i i i ia x b x x y
๐ฆ = 1.908 + 3.019๐ฅ
4.10 Best fit : Method of Least Squares
โข Method of least squares for2y a bx cx
2
2 3
22 3 4
1 i i i
i i i i i
i i i i i
a b x c x y
a x b x c x y x
a x b x c x y x
๐=1
๐
(๐ + ๐๐ฅ๐ + ๐๐ฅ12 โ ๐ฆ๐)
2 โ ๐๐๐
Chapter 4. Equation fitting
4.11 Method of Least Squares Applied to Nonpolynomial Forms
โข Method of least squares
โ apply to equation with constant coefficients
cf) sin 2 cy ax bx
Chapter 4. Equation fitting
4.12 The art of equation fitting
โข Choice of the form of the equation
Polynomials with negative exponent(1)
Exponential eq.(2)
Gompertz eq(3)
combination
, 1xcy ab where b c
(1) (2) (3)
Chapter 4. Equation fitting