ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.
-
date post
21-Dec-2015 -
Category
Documents
-
view
223 -
download
2
Transcript of ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.
![Page 1: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/1.jpg)
ECIV 301
Programming & Graphics
Numerical Methods for Engineers
REVIEW III
![Page 2: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/2.jpg)
Topics• Regression Analysis
– Linear Regression– Linearized Regression– Polynomial Regression
• Numerical Integration– Newton Cotes– Trapezoidal Rule– Simpson Rules– Gaussian Quadrature
![Page 3: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/3.jpg)
Topics• Numerical Differentiation
– Finite Difference Forms
• ODE – Initial Value Problems– Runge Kutta Methods
• ODE – Boundary Value Problems– Finite Difference Method
![Page 4: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/4.jpg)
Regression
Often we are faced with the problem…
x y0.924 -0.003880.928 -0.00743
0.93283 0.005690.93875 0.00188
0.94 0.01278
-0.01
-0.005
0
0.005
0.01
0.015
0.92 0.925 0.93 0.935 0.94 0.945
what value of y corresponds to x=0.935?
![Page 5: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/5.jpg)
Curve FittingQuestion 2: Is it possible to find a simple and convenient formula that represents data approximately ?
-0.01
-0.005
0
0.005
0.01
0.015
0.92 0.925 0.93 0.935 0.94 0.945
e.g. Best Fit ?
Approximation
![Page 6: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/6.jpg)
Experimental Measurements
Strain
Str
ess
![Page 7: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/7.jpg)
BEST FIT CRITERIA
Strain
y S
tres
s
xaaxl 10)(
ii
iii
xaay
xlye
10
)(
Error at each Point
![Page 8: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/8.jpg)
Best Fit => Minimize Error
n
iii
n
ielimeasuredi
n
ii
xaay
yye
1
210
1
2mod,,
1
2
Best Strategy
![Page 9: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/9.jpg)
Best Fit => Minimize Error
n
iii
n
ii xaaye
1
210
1
2
Objective:
What are the values of ao and a1
that minimize ?
n
iie
1
2
![Page 10: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/10.jpg)
Least Square Approximation
101
210
1
2 ,aaSxaaye r
n
iii
n
ii
In our case
Since xi and yi are known from given data
02,
110
0
10
n
iii
r xaaya
aaS
02,
110
1
10
n
iiii
r xxaaya
aaS
![Page 11: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/11.jpg)
Least Square Approximation
n
ii
n
i
n
ii
r xaaya
aaS
11
10
10
10 ,
n
ii
n
ii
n
iii
r xaxaxya
aaS
1
21
10
11
10 ,
![Page 12: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/12.jpg)
Least Square Approximation
n
iii
n
ii
n
ii xyxaxa
11
21
10
n
ii
n
ii yxana
1110
2 Eqtns 2 Unknowns
![Page 13: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/13.jpg)
Least Square Approximation
xaya 10
2
11
2
1111
n
ii
n
ii
n
ii
n
ii
n
iii
xxn
yxyxna
n
xx
n
ii
1
n
yy
n
ii
1
![Page 14: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/14.jpg)
Example
y = 0.8393x + 0.0714
0
1
2
3
4
5
6
7
0 2 4 6 8
Series1
Linear (Series1)
![Page 15: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/15.jpg)
Quantification of Error
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
42.37
241
n
yy
n
ii
![Page 16: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/16.jpg)
Quantification of Error
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
n
iit yyS
1
2
![Page 17: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/17.jpg)
Quantification of Error
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
n
iit yyS
1
2
1
n
Ss t
y
![Page 18: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/18.jpg)
Quantification of Error
n
iit yyS
1
2
1
n
Ss t
y
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
Standard Deviation Shows Spread Around mean Value
![Page 19: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/19.jpg)
y = 0.8393x + 0.0714
0
1
2
3
4
5
6
7
0 2 4 6 8
Quantification of Error
n
iii
n
iir xaayeS
1
210
1
2
![Page 20: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/20.jpg)
Quantification of Error
n
iii
n
iir xaayeS
1
210
1
2
2/
n
Ss r
xy
“Standard Deviation” for Linear Regressiony = 0.8393x + 0.0714
0
1
2
3
4
5
6
7
0 2 4 6 8
![Page 21: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/21.jpg)
Quantification of Error
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
n
iit yyS
1
2
y = 0.8393x + 0.0714
0
1
2
3
4
5
6
7
0 2 4 6 8
n
iiir xaayS
1
210Better Representation
Less Spread
![Page 22: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/22.jpg)
Quantification of Error
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8
Exper 1
Average
n
iit yyS
1
2
y = 0.8393x + 0.0714
0
1
2
3
4
5
6
7
0 2 4 6 8
n
iiir xaayS
1
210
t
rt
S
SSr
2
Coefficient of Determination
t
rt
S
SSrr
2
Correlation Coefficient
![Page 23: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/23.jpg)
Linearized Regressionxbeay 1
1
xba
eay xb
11
1
ln
lnln 1
BxA
1
1ln
bB
aA
The Exponential Equation
![Page 24: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/24.jpg)
Linearized Regression2
2bxay
xba
xay b
2210
21010
log
loglog 2
BxA
2
210log
bB
aA
The Power Equation
![Page 25: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/25.jpg)
Linearized Regression
xb
xay
33
33
3 111
axa
b
y
BxA
3
3
3
1
a
bB
aA
The Saturation-Growth-Rate Equation
![Page 26: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/26.jpg)
Polynomial Regression
exaxaay 2210
A Parabola is Preferable
![Page 27: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/27.jpg)
Polynomial Regression
210r
n
1i
222i10i
n
1i
2i
a,a,aS
xaxaay
e
Minimize
![Page 28: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/28.jpg)
Polynomial Regression
0xaxaay2a
a,a,aS n
1i
2i2i10i
0
210r
0xxaxaay2a
a,a,aS n
1ii
2i2i10i
1
210r
0xxaxaay2a
a,a,aS n
1i
2i
2i2i10i
2
210r
![Page 29: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/29.jpg)
Polynomial Regression
i22i1i0 yaxaxa)n(
ii23i1
2i0i yxaxaxax
i2i2
4i1
3i0
2i yxaxaxax
3 Eqtns 3 Unknowns
![Page 30: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/30.jpg)
Polynomial Regression
i2i
ii
i
2
1
0
4i
3i
2i
3i
2ii
2ii
yx
yx
y
a
a
a
xxx
xxx
xxn
Use any of the Methods we Learned
![Page 31: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/31.jpg)
Polynomial Regression
n
1i
222i10i210r xaxaaya,a,aS
With a0, a1, a2 known the Total Error
3n
Ss r
xy Standard Error
t
rt2
S
SSr
Coefficient of
Determination
![Page 32: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/32.jpg)
Polynomial Regression
n
1i
2mmi10im10r xaxaaya,a,aS
For Polynomial of Order m
1mn
Ss r
xy Standard Error
t
rt2
S
SSr
Coefficient of
Determination
![Page 33: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/33.jpg)
Numerical Integration & Differentiation
![Page 34: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/34.jpg)
Motivation
x
xfxxf
x
y ii
![Page 35: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/35.jpg)
Motivation
x
xfxxf
x
y ii
![Page 36: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/36.jpg)
Motivation
x
xfxxf
dx
dy ii
x
0lim
![Page 37: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/37.jpg)
Motivation
b
a
dxxfI
AREA BETWEEN a AND b
![Page 38: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/38.jpg)
Motivation
)()( tydt
dtv
![Page 39: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/39.jpg)
Motivation
b
a
dxtvty
![Page 40: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/40.jpg)
Motivation
![Page 41: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/41.jpg)
Motivation
Calculate Derivative
Given
![Page 42: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/42.jpg)
MotivationGiven
Calculate
![Page 43: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/43.jpg)
Think as Engineers!
![Page 44: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/44.jpg)
In Summary
INTERPOLATE
![Page 45: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/45.jpg)
In SummaryNewton-Cotes Formulas
Replace a complicated function or tabulated data with an approximating
function that is easy to integrate
b
a
n
b
a
dxxfdxxfI
nn
nnon xaxaxaaxf
111
![Page 46: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/46.jpg)
In Summary
Also by piecewise approximation
b
ax
x
x
n
b
a
i
i
i
dxxf
dxxfI
1
![Page 47: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/47.jpg)
Closed/Open Forms
CLOSED OPEN
![Page 48: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/48.jpg)
Trapezoidal RuleLinear Interpolation
12
3hOError
![Page 49: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/49.jpg)
Trapezoidal Rule Multiple Application
![Page 50: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/50.jpg)
Trapezoidal Rule Multiple Application
![Page 51: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/51.jpg)
Trapezoidal Rule Multiple Application
n
xfxfxfabI
n
n
ii
2
22
10
x a=xo x1 x2 … xn-1 b=xn
f(x) f(x0) f(x1) f(x2) f(xn-1) f(xn)
![Page 52: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/52.jpg)
Simpson’s 1/3 Rule
Quadratic Interpolation
22102 )( xaxaaxf
90
5hOError
![Page 53: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/53.jpg)
Simpson’s 3/8 Rule
Cubic Interpolation
33
22102 xaxaxaa)x(f
80
3 5hOError
![Page 54: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/54.jpg)
Gauss Quadrature
x1 x2
2211 xfwxfwI
![Page 55: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/55.jpg)
General Case
2211
1
1
xfwxfwdx)x(fI
Gauss Method calculates pairs of wi, xi for the Integration limits
-1,1
For Other Integration LimitsUse Transformation
![Page 56: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/56.jpg)
Gauss Quadrature
b
a
dx)x(fIGxaax 10
10 aaa
10 aab
For xg=-1, x=a
For xg=1, x=b
20
aba
21
aba
![Page 57: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/57.jpg)
Gauss Quadrature
b
a
dx)x(fI
2
Gxababx
Gdx
abdx
2
1
12dx)x(f
abdx)x(fI
b
a
![Page 58: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/58.jpg)
Gauss Quadrature
1
12dx)x(f
abdx)x(fI
b
a
n
ii xfwab
I12
![Page 59: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/59.jpg)
Gauss Quadrature
Points
Weighting Factors wi
Function Arguments
Error
2 W0=1.0 X0=-0.577350269 F(4)()
W1=1.0 X1= 0.577350269
3 W0=0.5555556 X0=-0.77459669 F(6)()
W1=0.8888888 X1=0.0
W2=0.5555556 X2=0.77459669
![Page 60: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/60.jpg)
Gaussian Points
Points
Weighting Factors wi
Function Arguments
Error
4 W0=0.3478548 X0=-0.861136312 F(8)()
W1=0.6521452 X1=-339981044
W2=0.6521452 X2=- 339981044
W3=0.3478548 X3=0.861136312
![Page 61: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/61.jpg)
Gaussian Quadrature
Not a good method if function is not available
![Page 62: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/62.jpg)
Fig 23.1FORWARD FINITE DIFFERENCE
![Page 63: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/63.jpg)
Fig 23.2BACKWARD FINITE DIFFERENCE
![Page 64: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/64.jpg)
Fig 23.3CENTERED FINITE DIFFERENCE
![Page 65: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/65.jpg)
Data with Errors
![Page 66: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/66.jpg)
ODE IVP, BVP
![Page 67: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/67.jpg)
Pendulum
W=mg
02
2
l
sinmg
dt
dm
02
2
l
sing
dt
d
OrdinaryDifferentialEquation
![Page 68: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/68.jpg)
ODEs
02
2
l
sing
dt
dNon Linear
Linearization
Assume is small
sin 02
2
l
g
dt
d
![Page 69: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/69.jpg)
ODEs
02
2
l
g
dt
dSecond Order
ydt
d
Systems of ODEs
0
l
g
dt
dy
![Page 70: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/70.jpg)
ODE
15810450 234 x.xxx.y
5820122 23 .xxxdx
dy
![Page 71: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/71.jpg)
ODE - OBJECTIVES
Cx.xxx.y 5810450 234
5820122 23 .xxxdx
dy
dx.xxxy 5820122 23
15810450 234 x.xxx.y
Undetermined
![Page 72: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/72.jpg)
ODE- Objectives
15810450 234 x.xxx.y
Initial Conditions
10 y
![Page 73: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/73.jpg)
ODE-Objectives
y,xfdx
dy
Given
.C.Iknowny,f 0
Calculate
xy
![Page 74: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/74.jpg)
Runge-Kutta MethodsNew Value = Old Value + Slope X Step Size
hyy ii 1
![Page 75: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/75.jpg)
Runge Kutta Methods
hyy ii 1
Definition of yields different Runge-Kutta Methods
![Page 76: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/76.jpg)
Euler’s Method
hyy ii 1
y,xfdx
dy
ii y,xfLet
![Page 77: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/77.jpg)
Sources of Error
Truncation: Caused by discretization
• Local Truncation• Propagated Truncation
Roundoff: Limited number of significant digits
![Page 78: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/78.jpg)
Sources of Error
Propagated
Local
![Page 79: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/79.jpg)
Euler’s Method
![Page 80: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/80.jpg)
Heun’s Method
Predictor Corrector
2-Steps
![Page 81: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/81.jpg)
Heun’s Method
Predict
Predictor-CorrectorSolution in 2 steps
hyy ii 10
ii y,xf
Let
![Page 82: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/82.jpg)
Heun’s Method
Correct
Corrector
hyy ii 1
01ii y,xf
Estimate
2
01
iiii y,xfy,xfLet
![Page 83: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/83.jpg)
Error in Heun’s Method
![Page 84: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/84.jpg)
The Mid-Point Method
hyy ii 1
Remember:Definition of yields different Runge-Kutta Methods
![Page 85: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/85.jpg)
Mid-Point Method
Predictor Corrector
2-Steps
![Page 86: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/86.jpg)
Mid-Point Method
Predictor
Predict
22
1
hyy i
i
ii y,xf
Let
![Page 87: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/87.jpg)
Mid-Point Method
Corrector
Correct
hyy ii 1
2
1
2
1 ,ii
yxf
Estimate
2
1
2
1 ,ii
yxfLet
![Page 88: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/88.jpg)
![Page 89: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/89.jpg)
Runge Kutta – 2nd Order
hyy ii 1
21 3
2
3
1kk
y,xfdx
dy .C.Iknowny,f 0
ii y,xfk 1
hky,hxfk ii 12 4
3
4
3
![Page 90: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/90.jpg)
Runge Kutta – 3rd Order
hyy ii 1 321 46
1kkk
y,xfdx
dy .C.Iknowny,f 0
ii y,xfk 1
hky,hxfk ii 12 2
1
2
1
hkhky,hxfk ii 213 2
![Page 91: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/91.jpg)
Runge Kutta – 4th Order
hyy ii 1 4321 226
1kkkk
y,xfdx
dy .C.Iknowny,f 0
ii y,xfk 1
hky,hxfk ii 12 2
1
2
1
hky,hxfk ii 34
hky,hxfk ii 23 2
1
2
1
![Page 92: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/92.jpg)
Boundary Value Problems
![Page 93: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/93.jpg)
Fig 23.3CENTERED FINITE DIFFERENCE
![Page 94: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/94.jpg)
xo
Boundary Value Problems
x1 x2 x3 xn-1 xn...
![Page 95: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/95.jpg)
Boundary Value Problems
xo x1 x2 x3 xn-1 xn...
),(2 112
012 yxfhyyy
![Page 96: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/96.jpg)
Boundary Value Problems
xo x1 x2 x3 xn-1 xn...
),(2 222
123 yxfhyyy
![Page 97: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/97.jpg)
Boundary Value Problems
xo x1 x2 x3 xn-1 xn...
),(2 332
234 yxfhyyy
![Page 98: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/98.jpg)
Boundary Value Problems
xo x1 x2 x3 xn-1 xn...
),(2 112
21 nnnnn yxfhyyy
![Page 99: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/99.jpg)
Boundary Value ProblemsCollect Equations:
),(2 112
012 yxfhyyy
),(2 222
123 yxfhyyy
),(2 112
21 nnnnn yxfhyyy
BOUNDARY CONDITIONS
![Page 100: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/100.jpg)
T0 T5T0 T5
Example
02
2
TTcdx
Tda
x1 x2 x3 x4
![Page 101: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/101.jpg)
Example
02
12012
TTc
h
TTTa
aTchTchTT 20
212 2
T0 T5T0 T5
x1 x2 x3 x4x1 x2 x3 x4
![Page 102: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/102.jpg)
Example
02
22123
TTc
h
TTTa
aTchTchTT 21
223 2
T0 T5T0 T5
x1 x2 x3 x4x1 x2 x3 x4
![Page 103: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/103.jpg)
Example
02
32234
TTc
h
TTTa
aTchTchTT 22
234 2
T0 T5T0 T5
x1 x2 x3 x4x1 x2 x3 x4
![Page 104: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/104.jpg)
Example
02
42345
TTc
h
TTTa
aTchTchTT 22
234 2
T0 T5T0 T5
x1 x2 x3 x4x1 x2 x3 x4
![Page 105: ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.](https://reader036.fdocuments.in/reader036/viewer/2022062320/56649d5c5503460f94a3b3d5/html5/thumbnails/105.jpg)
Example
52
2
20
2
4
3
2
1
2
2
2
2
2100
1210
0121
0012
TTch
Tch
Tch
TTch
T
T
T
T
ch
ch
ch
ch
a
a
a
a
T0 T5T0 T5
x1 x2 x3 x4x1 x2 x3 x4