optimal design of energy systems

26
Optimal Design of Energy Systems Chapter 4 Equation Fitting Min Soo KIM Department of Mechanical and Aerospace Engineering Seoul National University

Upload: others

Post on 02-Oct-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Optimal Design of Energy Systems

Optimal Design of Energy Systems

Chapter 4 Equation Fitting

Min Soo KIM

Department of Mechanical and Aerospace EngineeringSeoul National University

Page 2: Optimal Design of Energy Systems

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

Page 3: Optimal Design of Energy Systems

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

Page 4: Optimal Design of Energy Systems

โ€ข 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

Page 5: Optimal Design of Energy Systems

โ€ข 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

Page 6: Optimal Design of Energy Systems

โ€ข 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

Page 7: Optimal Design of Energy Systems

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

Page 8: Optimal Design of Energy Systems

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

Page 9: Optimal Design of Energy Systems

[ ] [ ] 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

Page 10: Optimal Design of Energy Systems

Coefficient matrix [A]

Triangular matrix

Back substitution

โ€ข Gaussian elimination

Chapter 4. Equation fitting

4.3 Solution of simultaneous equation

Page 11: Optimal Design of Energy Systems

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

Page 12: Optimal Design of Energy Systems

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

Page 13: Optimal Design of Energy Systems

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

Page 14: Optimal Design of Energy Systems

Chapter 4. Equation fitting

4.6 Simplifications when the independent variable is uniformly spaced

Page 15: Optimal Design of Energy Systems

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

Page 16: Optimal Design of Energy Systems

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

Page 17: Optimal Design of Energy Systems

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

Page 18: Optimal Design of Energy Systems

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

Page 19: Optimal Design of Energy Systems

Chapter 4. Equation fitting

4.9 Exponential forms

ln ln ln

my bx

y b m x

Log-log plot (y=bxm)

Page 20: Optimal Design of Energy Systems

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

Page 21: Optimal Design of Energy Systems

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

Page 22: Optimal Design of Energy Systems

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

Page 23: Optimal Design of Energy Systems

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๐‘ฅ

Page 24: Optimal Design of Energy Systems

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

Page 25: Optimal Design of Energy Systems

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

Page 26: Optimal Design of Energy Systems

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