CPE 332 Computer Engineering Mathematics II - PowerPoint PPT Presentation

About This Presentation
Title:

CPE 332 Computer Engineering Mathematics II

Description:

... Gauss Elimination Gauss Jordan (Including Matrix Inverse) ... Classical Forth Order RK Method ... – PowerPoint PPT presentation

Number of Views:160
Avg rating:3.0/5.0
Slides: 57
Provided by: iLLUS242
Category:

less

Transcript and Presenter's Notes

Title: CPE 332 Computer Engineering Mathematics II


1
CPE 332Computer Engineering Mathematics II
  • Chapter 12
  • Curve Fitting

2
Curve Fitting
  • ?????????? ???????????????????????????
    ??????????????????? ????????????????? Function
    ??????????????????????????????????????
  • Function ????????????????? Polynomial ??? Degree
    ?????
  • Function ???????????????????????? Cosine Function
  • ???????????????? ?????????????????? Function
    ?????????????????????????? ????????????
    Interpolation

3
Interpolation
y
x
4
Linear Interpolation
y
x
5
Second Degree Piecewise Interpolation
y
x
6
Third Degree Piecewise Interpolation
y
x
7
Higher Order Degree
  • ?????????? ?????????????? Oscillate ???
  • Function ???????????? Polynomial ??????????????
  • N Degree ????? N1 ????????????????? Function

8
Spline Interpolation
  • ?????????? Polynomial Degree ???? ??????????
    Third Degree ???? Cube
  • ????? Cubic Spline
  • Cubic Spline ???? Polynomial ??????? 2 ???(??????
    4) ?????????????????????????????? Polynomial
    ??????????????? ??????????? Polynomial
    ??????????? First Derivative ??? Second
    Derivative ???????
  • 2 ?????? 2 ????? ???????????????????? First ???
    Second Derivative ???? 4 ????? 4 Unknown
  • ????????????????????? First Derivative
    ??????????????? ????????? Second Derivative
    ???????????? ??????? ???????? Natural Spline
  • ??????????????????????

9
Spline Interpolation
y
x
10
???????? Cubic Spline Interpolation (1)
  • ????????????????????????
  • ????????????? Curve ??????????????? ?????? Third
    Degree Polynomial
  • ?? 4 Unknown ????????? ???????????????? 4 ?????
    ?????? 4 ?????? Data ????????
  • ????? 3rd Degree Polynomial ????????????? 4 ???
    ????????????????????? 4 ??? ??????????????
    ?????????????? 4 ???????? Polynomial ??????????
  • Polynomial ?????????????????????????????????

11
???????? Cubic Spline Interpolation (2)
  • Example ????? Data 7 ?????????
  • Yi 2 0 3 4 5 3 1 Xi 0 1 2 3 4 5 6
  • ??????? Third Degree Polynomial ????? Fit Data
    ????????

12
???????? Cubic Spline Interpolation (3)
y1
y0
?????????? Cubic Polynomial 2 ?????? Fit 4 ??????
?????? 2 Fit 4 ???????? ????????? 4 ???????????
13
Cubic Spline Int.(4)
  • Polynomial ?????? ??????????????
  • ???????????

14
Cubic Spline Int.(5)
  • Polynomial ????????? ??????????????
  • ???????????

15
Cubic Spline Int.(6)
16
Cubic Spline Int.(7)
17
Cubic Spline Int.(8)
18
Cubic Spline Int.(9)
  • ???????????????????????????????????????
  • ????????????????? First Derivative ??????????
    Polynomial ?????? ?????????? First Derivative
    ???????????? Polynomial ?????? 2
  • ??????????? ??????????????? First Derivative
    ???????????????? Polynomial ???????????
    ????????????
  • ???????????????????? 4 ????? ??????? 4
    Coefficient ????????????????? Function ?????????
    ????????? First Derivative ????????????? (4 ???
    ???)
  • ???????? ???????????? Data (?????????????)
    ?????????? Third Degree Polynomial ????????

19
Cubic Spline Int.(10)
  • ?????????? Data n ?????? xii1,..,n ??? yi
    i1,..,n ???????????? Cubic Polynomial, Si(x)
    ??????? n-1 function ?????????? Interpolate
    ????????????? ?????????????????????????????

20
Cubic Spline Int.(11)
  • ????? Polynomial ??????????????????????? Variable
    ????????? (Delay) ??????????? xi
    ??????????????????? ?????
  • ??? First ??? Second Derivative ????????
    Polynomial ???????????????????

21
Cubic Spline Int.(12)
  • ?????? xi ????????????????????? Polynomial
    ????????
  • ????????? xi ?????????????? Function ???
  • ????????? ??????(?????????????????????????????????
    ???????????????)

22
Cubic Spline Int.(13)
  • ???????????????????????? First Derivative
    ???????????????????
  • ??????? ??????
  • ????????????? ??? Second Derivative
    ??????????????????????????

23
Cubic Spline Int.(14)
  • ??????
  • ???????
  • ???
  • ???
  • ??????

24
Cubic Spline Int.(15)
  • ??????????????????? ????????
  • ???????
  • ????????????????????
  • ???? ai ??? ci ??????????????????????

25
Cubic Spline Int.(16)
  • ???????????????????????????
  • ?????????????????? Matrix ??????

26
Cubic Spline Int.(17)
  • ???
  • ???????????????????? Matrix ?????????

27
Cubic Spline Int.(18)
  • ???????????????? n-2 ???????? n unknown
    ???????????????????? ??? Condition
    ???????????????????????????
  • ??? Condition ????????????????????? ?????????
    Variation ??? Cubic Spline Interpolation ????????

28
Cubic Spline Int.(19)
  • ?????????????????? Spline ?????? ??? ???
    Condition ?????????????????
  • Natural Spline
  • ??????????? M1Mn0
  • Parabolic Runout Spline
  • ??????????? M1M2 ??? MnMn-1
  • Cubic Runout Spline
  • ????????? M12M2-M3 ??? Mn2Mn-1-Mn-2
  • ?????????????????????????????? Natural Spline

29
Cubic Spline Int.(20)
  • Natural Spline
  • ???????? M1Mn0 Matrix ???????????? n-2 ?????
    ??? n-2 Unknown ??????
  • ?????????????????????? Mi ?????????????????
    Coefficient ???????? Polynomial ???

30
Cubic Spline Int.(21)
  • ?????????? Coefficient Matrix ??????????????????
    Diagonal ??????????????? ???? Matrix ???????
    Matrix ????? ????? Toeplitz Matrix
  • Toeplitz Matrix ????????????????? ?????? O(n2)
    Computation Time ???????????? O(n3)
  • Algorithm ????????? Levinson Algorithm
  • Toeplitz Matrix ???????? LU Decomposition ??????
    O(n2) ????????????
  • ?????????????????????????????? Matrix ??? ???
    Levinson Algorithm ???????????????????????
    ????????????????????????????????????????? Linear
    Algebra ??? Numerical Method

31
Example Natural Spline
  • ??????????????? ???????? Spline ??????? Fit Data
    ????????? n7, h 1, M0M70
  • Yi 2 0 3 4 5 3 1 Xi 0 1 2 3 4 5 6
  • ??????????? Matrix ??????
  • ??????????????

32
  • ??????? Coefficient ??? Cubic ???? 6 ??????

33
Polynomial Coefficient Matrix
  • gtgt pa b c d
  • p
  • 1.4987 0 -3.4987 2.0000
  • -2.4936 4.4962 0.9974 0
  • 1.4756 -2.9846 2.5090 3.0000
  • -1.4090 1.4423 0.9667 4.0000
  • 1.1603 -2.7846 -0.3756 5.0000
  • -0.2321 0.6962 -2.4641 3.0000
  • ????????????? Plot ????? Polynomial ???????????
    ??????? 6 Polynomial ??? 6 ????

34
Natural Spline Interpolation
35
Natural Spline Interpolation RFirst Der G
Second Der B
36
Natural Spline Interpolation RFirst D G
Second D B vs 6th D Poly K
?????????????? Polynomial ????? Degree ?????????
Overshoot ??? Spline ????? Curve ???????????????
????????????????????
37
Regression
  • ???????? Data ????????????? ?????? ????????
    Interpolation ???? Polynomial ????????????
  • ???????????? Data ????????????????????????????????
    ? ?????????????? Random
  • ???????????? Noise ????????
  • ??? Fit ???? Polynomial ?????????? Spline
    ??????????????????????????????

38
Regression Data with Noise
Y
X
39
Polynomial Fit Noise Data
Y
X
40
Ordinary Simple Linear Least-Squares Regression
  • ???????? ?????????????????? Function ?????
    ??????????? ???? Exponential ?????????????
  • ????????????????????????????????????????
    ????????????? Data ??????????????????????????
  • ??????????????? Fit ?????? ???????? Error ??????
    ????????????????? Regression
  • ??????????????????? (?????????????????)????????
    Linear Regression
  • ?????????????? Simple Linear Regression
    ???????????????????? ???????????????????????????
  • ??????????? Multiple Linear Regression
    ???????????????????????? ???????????? Linear
    Equation ??????????
  • ??????????????? yaxb (?????????? y a bx
    ???????????????????????? a ??? b
    ?????????????????????????)
  • Parameter 2 ??????????????? a slope ??? b
    y-intercept

41
Ordinary Simple Linear Least Square Regression
  • ???????? Fit ???????????? Error ?????????
    ?????????????????? Least-Square ????? Ordinary
    Least Square Regression (OLS) (???? Linear Least
    Square)
  • ???????? Error ???????????????????????? Data
    ????????????????????? ???????????
  • Linear Regression ???????????????????
    ???????????????????????????????? Random Variable
    ??????
  • Linear Regression ????????????????????????? ???
    OLS ????????????

42
Linear Least-Squares Regression
Y
Error
X
43
Ordinary Linear Least Square Regression (OLS)
  • ??? a ??? b ????????????? Summation ??? Error
    ?????????? ?????????
  • ???????????????????????????? Derivative
    ????????????????????????? 0 (??? Minima)
  • ??????? Unknown ??? a ??? b ?????????????
    Derivative ????????????????????????? 0 ??????
  • df(a,b)/da 0
  • df(a,b)/db 0
  • f(a,b) ??? Sum of Square Error Function
  • ???????????????????????????? r correlation
    coefficient ????????????????????????????? Fit
    ????????????, r ?????????????? -1,1

44
Linear Least-Squares Regression
Regression line
(xi,yi)
yi
ei
axib
xi
???????????? Data Pair (xi,yi) i 1,2,,n
??????? n ???
Variable X ??? Y ????????? ??????? Continuous
??? Discrete
45
(No Transcript)
46
R, r Correlation Coefficient
???? Correlation Coefficient ??? Pearson
Product-Moment Correlation Coefficient
?????????????????????????????? Covariance
?????????????? Standard Deviation ??????????
Variable (???????????) ??? ?????????????????????
r 1 ???? -1 ??????????????????????????????? ????
???????? (????????? ????????????) ??? r
???????????????????????????????????????
47
Nonlinear Regression
  • ??????????????????????????????????????
    ?????????????? Function ???????? Regression ????
  • Exponential Model
  • Power Equation
  • Saturation-Growth-Rate Equation
  • Polynomial Regression
  • ?????????????????????????????

48
Example
  • 1. ???????????????????????? ???? CPE 332 ???????
    ????? ?????????????? ?????????????????????????????
    ???????????? ????????? ?????????????????????????
  • ????? OLS Regression ?????????????????????????????
    ??? ????? Plot Scatter Diagram ????????????????
    ??????????????? Correlation Coefficient

Data Hour Grade
1 5 72
2 8 51
3 2 86
4 6 75
5 4 88
Data Hour Grade
6 10 40
7 7 68
8 6 63
9 12 46
10 8 65
49
Example
50
Example
51
y-5.0159x 99.5079
r -0.9069
52
End of Chapter 12
  • Download
  • Homework 12 ????????????????? 12.00 ?.(??????????
    ???????? ???? 5-310)

53
Course Ends
  • Prepare For Exam
  • ???????? 6 ??? ???????? (?????????????????????)
  • ?????????? Midterm ?????????
  • 1. Function Approximation (1 ???)
  • Taylor Series/McLauren Series
  • 2. Roots of Function (1 ???)
  • Bisection
  • Newton-Ralphson
  • 3. Linear Equations (1 ???) ???????????????????
  • Gauss Elimination
  • Gauss Jordan (Including Matrix Inverse)
  • Gauss Seidel
  • LU Decomposition (Crout Decomposition)

54
Course Ends
  • Prepare For Exam
  • 4. Numerical Integration (1 ???) ?????? Finite
    Difference
  • Trapezoidal Rule
  • Simpson 1/3 Rule
  • Richardson Extrapolation
  • 5. ODE (1 ???)
  • Classical Forth Order RK Method ???????????
  • 6. Curve Fitting (1 ???)
  • Natural Spline
  • OLS Regression

55
Formulas
56
END OF CPE 332 T1-56
  • Minimum 40 ?????????????????????
  • A ????????? 80 ??????
Write a Comment
User Comments (0)
About PowerShow.com