שיטות נומריות 2. פרק 6 . פירוק ……….(LU and Cholesky) .............…... 2 פרק 7 . חישוב ערכים עצמים ............................................. 9 דוגמה ב MATLAB .................................................... 10 - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
קורס אינטראקטיביקורס אינטראקטיבי המועבר ע”י ד”ר קרסנוב המועבר ע”י ד”ר קרסנוב 88-37688-376 מבוסס על הקורס מבוסס על הקורס
קורס אינטראקטיביקורס אינטראקטיבי המועבר ע”י ד”ר קרסנוב המועבר ע”י ד”ר קרסנוב 88-37688-376 מבוסס על הקורס מבוסס על הקורס
2 .............…... (LU and Cholesky……….)ירוק פ. 6פרק
9 .............................................חישוב ערכים עצמים. 7פרק
MATLAB .................................................... 10דוגמה ב
cubic spline .............…............. 11 . אלגוריתם של 8פרק
Least square approximations ...................... 14. 9פרק
Least square approximationsLeast square approximations. . 99פרק פרק
להתאים לנתונים פולינום:•
nn10 xaxaay
N
1ii
ni
N
1iii
N
1ii
n
1
0
N
1i
2ni
N
1i
ni
N
1ii
N
1i
ni
N
1ii
a
a
aN
yx
yx
y
xx
x
xx
רגרסיה ליניאריתרגרסיה ליניארית
2xxx
xxyyxx
2xxx
yxxy
Nb
N
Na
baxy
N
1k
2kk
1
1yY
nN סטיי
:ה
ריבוים מזעורים רציפיםריבוים מזעורים רציפים . . 1010פרק פרק
להתאים לפונקציה פולינום :כך שערך של אינטגרל הריבויים מזעורים תהיה מינימלי
נקבל מערכת משוואות אלגבריות ליניאריות עבור מקדמים :
xf 01n
1nn
nn a...xaxaxp
min b
a
dxxpxfE 2n
n,...,1,0i,0dxxxpxf2da
dEn i
b
ai
n10 a,...,a,a
n,...,1,0i,dxx)x(fan
0j
i
b
a
j
1ji1ji
1ji
ab
] 0,1[לדוגמה: נתונה פונקציה בקטע לדוגמה: נתונה פונקציה בקטע
2986.1
5973.1
0973.2
3e8
1
1e4
1
1e4
1
dx)xe(x
dx)xe(x
dx)xe(1
a
a
a
5
1
4
1
3
14
1
3
1
2
13
1
2
11
2
2
2
1
0
x22
1
0
x2
1
0
x2
2
1
0
ערך מינימלי לאינטגרל
22102 xaxaaxp יש למצוא פולינום ריבוית שנותן
x2xexf
min 1
0
dxxaxaaxeE
22210
x
ותשובה היא:2
2 x9.1642 x2.5806- 0.3328(x)p
אפשר להציג כל הפונקציה: Legendre בעזרת הפולינומים של
xPaxPaxPaxf nn1100
פולינומים אורתוגונלייםפולינומים אורתוגונליים . . 1111פרק פרק
j i if 0
j i if #
1
1
ji dxxPxP
הם אורתוגונליים: Legendre הפולינומים של
0
1
22
P x 1
P x x
1P x x
3
33
n nn2
n n n
3P x x x
5
1 dP x 1-x
2 n! dx
Legendre PolynomialLegendre Polynomial
How would you work with a least square fit of a function.
dxxsxPaxPaxPaE21
1
221100
Legendre PolynomialLegendre PolynomialHow would you work with a least square fit of a function.
02 0
1
1
2211000
dxxPxsxPaxPaxPada
dE
1
1
0
1
1
022
1
1
011
1
1
000
dxxPxsdxxPxPa
dxxPxPadxxPxPa
Legendre PolynomialLegendre PolynomialThe coefficient a0 is determined by the orthogonality of the Legendre polynomials:
1
1
00
1
1
0
0
1
1
0
1
1
000
dxxPxP
dxxPxs
a
dxxPxsdxxPxPa
Legendre Polynomial ExampleLegendre Polynomial Example
Given a simple polynomial:
22xxs
We want to throw a loop, let’s model it from 0 to 4 with f(x):
xPaxPaxPaxf 221100
Legendre Polynomial ExampleLegendre Polynomial Example
The first step will be to scale the function:
bmux We know that at the ends are 0 and 4 for x and -1 to 1 for u so
8168
22*22
2
uuus
uus22 ux
Legendre Polynomial ExampleLegendre Polynomial ExampleThe coefficients are
6667.102
3333.21
8168
1
1
1
1
2
1
1
00
1
1
0
0
du
duuu
duuPuP
duuPus
a
8 and 16 21 aa
Legendre Polynomial ExampleLegendre Polynomial ExampleThe Legendre functions must be adjusted to handle the scaling:
Legendre Polynomial Example
0
5
10
15
20
25
30
35
0 1 2 3 4 5
X Values
Y V
alu
esLegendrePolynomial
Exact Value
12
1 xu
15.08
15.016
15.0667.10
2
1
0
xP
xP
xPxf
Tchebyshev PolynomialTchebyshev Polynomial
The Tchebyshev polynomials are another set of orthogonal functions, which can be used to represent a function as components of a function.
xTaxTaxTaxf nn1100
Tchebyshev PolynomialTchebyshev PolynomialThese function are orthogonal over a range [ -1, 1 ]. This range can be scaled to fit the function. The orthogonal functions are defined as:
1i j
21
0 if i j
if i j 01 /2 if i j 0
T x T xdx
x
Tchebyshev PolynomialTchebyshev Polynomial
The Tchebyschev functions are:
xTxT2xT
3xx4xT
1x2xT
xxT
1xT
1-nn1n
33
22
1
0
x
Tchebyshev PolynomialTchebyshev Polynomial
How would you work with a least square fit of a function.
dxxsxTaxTaxTaE21
1
221100
Tchebyshev PolynomialTchebyshev PolynomialHow would you work with a least square fit of a function.
02 0
1
1
2211000
dxxTxsxTaxTaxTada
dE
1
1
0
1
1
022
1
1
011
1
1
000
dxxTxsdxxTxTa
dxxTxTadxxTxTa
Rearrange
אפשר להציג את האינטגרל בעזרת צמתים ומשקלים מהפונקציה: