Uploaded by Dheeraj s_r

L1 (08 Oct 2020)

advertisement
MAT 5161
Computational Methods
Solution of linear and nonlinear system of equations: .
(8 hours)
Direct methods:
Gauss Jordon method, Crouts (LU decomposition) method, Cholesky Decomposition method
and Thomas Algorithm for tridiagonal systems.
Indirect Methods(Iterative methods):
Gauss Seidal and successive over relaxation, Newton Raphson method (system of non-linear
equations), Birgevieta method, Bairstow’s methods.
Numerical Solution of Ordinary Differential Equations:
(8 hours)
Initial Value Problems: Single step methods, Runge-Kutta method, Runge Kutta method for
simultaneous differential equations, Runge Kutta method for higher order differential
equations, Shooting method.
Multi step methods: Adam Bashforth’s predictor corrector method, Milne’s predictor and
corrector method.
Boundary Value Problems :
(10 hours)
Finite difference method (IVP)
Numerical Solution of Partial Differential Equations- Elliptic P.D.E., Parabolic P.D.E., Hyperbolic
P.D.E by explicit finite difference method , ADE and ADI method.
Fourier Integrals, Fourier transforms and properties
(8 hours)
Laplace transforms of elementary functions – inverse Laplace transforms
Mathematical Modelling:
(8 hours)
(10 hours)
MM with ordinary/partial/higher order differential equations: Models in arms race,
compartment models, heat flow problems and vibration of strings. Modelling through
graphs.
Solution of linear system of equations:
Consider the System of linear equations
๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + ๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + โ‹ฏ + ๐’‚๐Ÿ๐’ ๐’™๐’ = ๐’ƒ๐Ÿ
๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + ๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + โ‹ฏ + ๐’‚๐Ÿ๐’ ๐’™๐’ = ๐’ƒ๐Ÿ
โ‹ฎ
๐’‚๐’Ž๐Ÿ ๐’™๐Ÿ + ๐’‚๐’Ž๐Ÿ ๐’™๐Ÿ + โ‹ฏ ๐’‚๐’Ž๐’ ๐’™๐’ = ๐’ƒ๐’Ž
Gauss Jordon method:
๏ƒ˜ In this method, we are reducing the system to a diagonal matrix
Apply Gauss-Jordon method to solve the equations
๐’™+๐’š+๐’›=๐Ÿ—
๐Ÿ๐’™ − ๐Ÿ‘๐’š + ๐Ÿ’๐’› = ๐Ÿ๐Ÿ‘
๐Ÿ‘๐’™ + ๐Ÿ’๐’š + ๐Ÿ“๐’› = ๐Ÿ’๐ŸŽ
Solution: We can rewrite the given equations as
๐Ÿ
๐Ÿ
๐Ÿ‘
๐‘น๐Ÿ → ๐‘น๐Ÿ − ๐Ÿ๐‘น๐Ÿ ;
๐‘น๐Ÿ‘ → ๐‘น๐Ÿ‘ − ๐Ÿ‘๐‘น๐Ÿ
๐Ÿ ๐Ÿ ๐’™
๐Ÿ—
−๐Ÿ‘ ๐Ÿ’ ๐’š = ๐Ÿ๐Ÿ‘
๐Ÿ’ ๐Ÿ“ ๐’›
๐Ÿ’๐ŸŽ
๐Ÿ ๐Ÿ
๐ŸŽ −๐Ÿ“
๐ŸŽ ๐Ÿ
๐Ÿ ๐’™
๐Ÿ—
๐Ÿ ๐’š = −๐Ÿ“
๐Ÿ ๐’›
๐Ÿ๐Ÿ‘
๐‘น๐Ÿ‘ → ๐‘น๐Ÿ‘ +
๐‘น๐Ÿ →
๐Ÿ
๐ŸŽ
๐ŸŽ
๐‘น๐Ÿ
๐Ÿ“
๐‘น๐Ÿ
;
−๐Ÿ“
๐‘น๐Ÿ‘ →
๐Ÿ
−๐Ÿ“
๐ŸŽ
๐Ÿ
๐Ÿ
๐Ÿ๐Ÿ
๐Ÿ“
๐Ÿ ๐Ÿ
๐ŸŽ ๐Ÿ
๐‘น๐Ÿ‘
๐Ÿ๐Ÿ
๐ŸŽ ๐ŸŽ
๐Ÿ
๐Ÿ“
๐‘น๐Ÿ → ๐‘น๐Ÿ + ๐‘น๐Ÿ‘
๐‘น๐Ÿ → ๐‘น๐Ÿ − ๐‘น๐Ÿ − ๐‘น๐Ÿ‘
๐Ÿ
๐ŸŽ
๐ŸŽ
๐’™
๐Ÿ—
๐’š = −๐Ÿ“
๐’›
๐Ÿ๐Ÿ
๐Ÿ ๐’™
๐Ÿ—
๐Ÿ
๐’š = ๐Ÿ
−
๐Ÿ“
๐Ÿ“
๐Ÿ ๐’›
๐Ÿ
๐Ÿ
๐ŸŽ
๐Ÿ ๐’™
๐Ÿ—
๐ŸŽ ๐’š = ๐Ÿ‘
๐Ÿ ๐’›
๐Ÿ“
๐Ÿ
๐ŸŽ
๐ŸŽ
๐ŸŽ
๐Ÿ
๐ŸŽ
๐ŸŽ ๐’™
๐Ÿ
๐ŸŽ ๐’š = ๐Ÿ‘
๐Ÿ ๐’›
๐Ÿ“
๐Ÿ ๐Ÿ
๐ŸŽ −๐Ÿ“
๐ŸŽ ๐Ÿ
๐Ÿ ๐’™
๐Ÿ—
๐Ÿ ๐’š = −๐Ÿ“
๐Ÿ ๐’›
๐Ÿ๐Ÿ‘
Apply Gauss-Jordon method to solve the equations
๐’™ + ๐Ÿ‘๐’š + ๐Ÿ‘๐’› = ๐Ÿ๐Ÿ”
๐’™ + ๐Ÿ’๐’š + ๐Ÿ‘๐’› = ๐Ÿ๐Ÿ–
๐’™ + ๐Ÿ‘๐’š + ๐Ÿ’๐’› = ๐Ÿ๐Ÿ—
LU Decomposition (Factorization method):
This method is based on the Fact that a square matrix A can be factorized into the form LU,
where L is unit lower triangular matrix and U is upper triangular, if all the principle minors of
A are non-singular.
i.e., ๐‘Ž11 ≠ 0,
๐‘Ž11
๐‘Ž21
๐‘Ž11
๐‘Ž12
๐‘Ž21
≠
0,
๐‘Ž22
๐‘Ž31
๐‘Ž12 ๐‘Ž13
๐‘Ž22 ๐‘Ž23 ≠ 0, etc
๐‘Ž32 ๐‘Ž33
Also, such a factorization if exists, is unique.
๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + ๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + โ‹ฏ + ๐’‚๐Ÿ๐’ ๐’™๐’ = ๐’ƒ๐Ÿ
๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + ๐’‚๐Ÿ๐Ÿ ๐’™๐Ÿ + โ‹ฏ + ๐’‚๐Ÿ๐’ ๐’™๐’ = ๐’ƒ๐Ÿ
โ‹ฎ
๐’‚๐’๐Ÿ ๐’™๐Ÿ + ๐’‚๐’๐Ÿ ๐’™๐Ÿ + โ‹ฏ ๐’‚๐’๐’ ๐’™๐’ = ๐’ƒ๐’
Which can be written, ๐‘จ๐‘ฟ = ๐‘ฉ
Let ๐‘จ = ๐‘ณ๐‘ผ
Eq (1) → ๐‘ณ๐‘ผ๐‘ฟ = ๐‘ฉ
๐’‚๐Ÿ๐Ÿ
_____ (1) where ๐‘จ = ๐’‚๐Ÿ๐Ÿ
โ‹ฎ
๐’‚๐’๐Ÿ
๐’‚๐Ÿ๐Ÿ …
๐’‚๐Ÿ๐Ÿ …
๐’‚๐’๐Ÿ …
๐’™๐Ÿ
๐’ƒ๐Ÿ
๐’‚๐Ÿ๐’
๐’‚๐Ÿ๐’ , ๐‘ฟ = ๐’™๐Ÿ , ๐‘ฉ = ๐’ƒ๐Ÿ
โ‹ฎ
โ‹ฎ
๐’‚๐’๐’
๐’™๐’
๐’ƒ๐’
Take ๐‘ˆ๐‘‹ = ๐‘Œ____ (2)
Eq (2) → ๐‘ณ๐’€ = ๐‘ฉ ____ (3)
Using (3), find ๐‘ฆ1 , ๐‘ฆ2 , … , ๐‘ฆ๐‘› by forward substitution.
Then using relation (2) ๐‘ˆ๐‘‹ = ๐‘Œ, find ๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› .
Solve the equations ๐Ÿ๐’™๐Ÿ + ๐Ÿ‘๐’™๐Ÿ + ๐’™๐Ÿ‘ = ๐Ÿ—
๐’™๐Ÿ + ๐Ÿ๐’™๐Ÿ + ๐Ÿ‘๐’™๐Ÿ‘ = ๐Ÿ”
๐Ÿ‘๐’™๐Ÿ + ๐’™๐Ÿ + ๐Ÿ๐’™๐Ÿ‘ = ๐Ÿ– by LU decomposition
Ans:
๐‘ณ๐‘ผ = ๐‘จ
1
๐‘™21
๐‘™31
๐‘ข11
0
1
๐‘™32
0 ๐‘ข11
0 0
1 0
๐‘ข12
๐‘ข22
0
๐‘ข13
2
๐‘ข23 = 1
๐‘ข33
3
๐‘ข12
๐‘ข13
๐‘™21 ๐‘ข11
๐‘™21 ๐‘ข12 + ๐‘ข22
๐‘™21 ๐‘ข13 + ๐‘ข23
๐‘™31 ๐‘ข11
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33
3 1
2 3
1 2
2
= 1
3
3 1
2 3
1 2
๐‘ข11
๐‘ข12
๐‘ข13
๐‘™21 ๐‘ข11
๐‘™21 ๐‘ข12 + ๐‘ข22
๐‘™21 ๐‘ข13 + ๐‘ข23
๐‘™31 ๐‘ข11
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22
๐‘ข11 = 2
๐‘ข12 = 3
๐‘ข13 = 1
1
(3) + ๐‘ข22 = 2
2
1
๐‘ข22 =
2
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22 = 1
2
2
3
2
3 + ๐‘™32
3 1
2 3
1 2
๐‘™21 ๐‘ข13 + ๐‘ข23 = 3
๐‘™21 ๐‘ข12 + ๐‘ข22 = 2
๐‘™21 ๐‘ข11 = 1 โŸน ๐‘™21 2 = 1
1
โŸน ๐‘™21 =
๐‘™31 ๐‘ข11 = 3 โŸน ๐‘™31 2 = 3
3
โŸน ๐‘™31 =
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33
2
= 1
3
1
(1) + ๐‘ข23 = 3
2
5
๐‘ข22 =
2
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33 = 2
๐‘ข33 = 18
1
9
= 1 โŸน ๐‘™32 = 1 −
2 = −7
2
2
๐ฟ๐‘Œ = ๐ต
1
0 0 ๐‘ฆ1
9
1Τ
1 0 ๐‘ฆ2 = 6
2
3Τ
๐‘ฆ3
8
2 −7 1
Solving
๐‘ฆ1 = 9
1
๐‘ฆ1 + ๐‘ฆ2 = 6
2
1
(9) + ๐‘ฆ2 = 6
2
3
โŸน ๐‘ฆ2 =
2
๐‘ˆ๐‘‹ = ๐‘Œ
2 3
1
0
2
0 0
1 ๐‘ฅ
9
5 ๐‘ฅ1
2 = 3/2
2 ๐‘ฅ3
5
18
3
๐‘ฆ1 − 7๐‘ฆ2 + ๐‘ฆ3 = 8
2
โŸน ๐‘ฆ3 = 5
๐’™๐Ÿ
๐‘ฟ = ๐’™๐Ÿ
๐’™๐Ÿ‘
5
18๐‘ฅ3 = 5 โŸน ๐‘ฅ3 =
18
1
5
3
29
๐‘ฅ2 + ๐‘ฅ3 =
โŸน ๐‘ฅ2 =
2
2
2
18
35
2๐‘ฅ1 + 3๐‘ฅ2 + ๐‘ฅ3 = 9 โŸน ๐‘ฅ3 =
18
๐Ÿ‘๐Ÿ“เต—
๐Ÿ๐Ÿ–
= ๐Ÿ๐Ÿ—เต—๐Ÿ๐Ÿ–
๐Ÿ“เต—
๐Ÿ๐Ÿ–
Crout’s Method:
๐ด๐‘‹ = ๐ต
→ ๐‘‹ = ๐ด−1 ๐ต
๐ฟ๐‘ˆ ๐‘‹ = ๐ต
To find ๐ด−1 , we first find L and U using LU = A
๐‘™11
Where ๐ฟ = ๐‘™21
๐‘™31
0
๐‘™22
๐‘™32
0
0
๐‘™33
1
and U= 0
0
๐‘ข12
1
0
๐‘ข13
๐‘ข23
1
After finding L and U, since ๐ฟ๐ฟ−1 = ๐ผ
We take ๐ฟ๐ฟ−1 = ๐ผ
Similarly, ๐‘ˆ๐‘ˆ −1 = ๐ผ
Now, find ๐‘จ−๐Ÿ = ๐‘ณ๐‘ผ
๐‘™11
๐‘™21
๐‘™31
๐‘™22
๐‘™32
๐‘™33
1
0
0
๐‘ข12
1
0
๐‘ข13
๐‘ข23
1
−๐Ÿ
0
0
0
= ๐‘ผ−๐Ÿ ๐‘ณ−๐Ÿ
And hence, we get ๐‘ฟ = ๐‘จ−๐Ÿ ๐‘ฉ
๐‘Ž๐‘›๐‘‘ ๐‘ˆ๐‘ˆ −1 = ๐ผ,
๐‘ฅ11
๐‘ฅ21
๐‘ฅ31
0
๐‘ฅ22
๐‘ฅ32
1 ๐‘ฆ12
0 1
0 0
0
1
0 = 0
๐‘ฅ33
0
๐‘ฆ13
1
๐‘ฆ23 = 0
0
1
0 0
1 0
0 1
0 0
1 0
0 1
Solve by Crout’s method ๐Ÿ๐’™๐Ÿ − ๐Ÿ๐’™๐Ÿ + ๐Ÿ’๐’™๐Ÿ‘ = ๐Ÿ
2๐’™๐Ÿ + ๐Ÿ‘๐’™๐Ÿ + ๐Ÿ๐’™๐Ÿ‘ = ๐Ÿ“
−๐’™๐Ÿ + ๐’™๐Ÿ − ๐’™๐Ÿ‘ = −๐Ÿ“
๐‘ณ๐‘ผ = ๐‘จ
1
๐‘™21
๐‘™31
0
1
๐‘™32
๐‘ข11
0
0
1
๐‘ข11
0
0
๐‘ข12
๐‘ข22
0
๐‘ข13
2 −2
๐‘ข23 = 2
3
๐‘ข33
−1 1
4
2
−1
๐‘ข12
๐‘ข13
๐‘™21 ๐‘ข11
๐‘™21 ๐‘ข12 + ๐‘ข22
๐‘™21 ๐‘ข13 + ๐‘ข23
๐‘™31 ๐‘ข11
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33
2
= 2
−1
−2 4
3
2
1 −1
๐‘ข11
๐‘ข12
๐‘ข13
๐‘™21 ๐‘ข11
๐‘™21 ๐‘ข12 + ๐‘ข22
๐‘™21 ๐‘ข13 + ๐‘ข23
๐‘™31 ๐‘ข11
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22
๐‘ข11 = 2
๐‘ข12 = −2
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33
๐‘ข13 = 4
๐‘™21 ๐‘ข12 + ๐‘ข22 = 3
๐‘™21 ๐‘ข11 = 2 โŸน ๐‘™21 = 1
2
= 2
−1
−2 4
3
2
1 −1
๐‘™21 ๐‘ข13 + ๐‘ข23 = 2
๐‘ข23 = −2
๐‘ข22 = 5
๐‘™31 ๐‘ข11 = −1 โŸน ๐‘™31 =
−1
2
๐‘™31 ๐‘ข12 + ๐‘™32 ๐‘ข22 = 1
โŸน ๐‘™32 = 0
๐‘™31 ๐‘ข13 + ๐‘™32 ๐‘ข23 + ๐‘ข33 = −1
๐‘ข33 = 1
We take ๐ฟ๐ฟ−1
1
0 0
1
1 0 and
๐ฟ=
−1/2 0 1
=๐ผ
2 −2
U= 0 5
0 0
1
0 0 1
1
1 0 ๐‘ฅ21
−1/2 0 1 ๐‘ฅ31
0
1
0 = 0
1
0
0
1
๐‘ฅ32
1 + ๐‘ฅ21 = 0 โŸน ๐‘ฅ21 = −1
−1/2 + ๐‘ฅ31 = 0 โŸน ๐‘ฅ31 = 1/2
๐ฟ−1
1
0
= −1 1
1/2 0
0
0
1
๐‘ฅ32 = 0
4
−2
1
0 0
1 0
0 1
๐‘ˆ๐‘ˆ −1 = ๐ผ
๐‘ฆ11 = 1/2
2 −2
0 5
0 0
4 ๐‘ฆ11
−2 0
0
1
๐‘ฆ12
๐‘ฆ22
0
2๐‘ฆ12 − 2๐‘ฆ22 = 0
๐‘ฆ33 =1
2๐‘ฆ12 − 2๐‘ฆ22 = 0 โŸน ๐‘ฆ12
๐‘ผ
−๐Ÿ
0 0
1 0
0 1
2๐‘ฆ13 − 2๐‘ฆ23 + 4๐‘ฆ33 = 0
5๐‘ฆ23 − 2๐‘ฆ33 = 0 โŸน ๐‘ฆ23
5๐‘ฆ22 = 1 โŸน ๐‘ฆ22 = 1/5
๐Ÿ/๐Ÿ
= ๐ŸŽ
๐ŸŽ
๐‘ฆ13
1
๐‘ฆ23 = 0
๐‘ฆ33
0
1
=
5
๐Ÿ/๐Ÿ“ −๐Ÿ–/๐Ÿ“
๐Ÿ/๐Ÿ“ ๐Ÿ/๐Ÿ“
๐ŸŽ
๐Ÿ
2
=
5
2๐‘ฆ13 − 2๐‘ฆ23 + 4๐‘ฆ33 = 0
2
2๐‘ฆ13 − 2
+ 4(1) = 0
5
โŸน ๐’š๐Ÿ๐Ÿ‘ = −
๐Ÿ–
๐Ÿ“
๐ด−1 = ๐ฟ๐‘ˆ
−1
= ๐‘ˆ −1 ๐ฟ−1
๐ด−1
0 0
1/2 1/5 −8/5 1
= 0
1/5 2/5 −1 1 0
1/2 0 1
0
0
1
−1/2 1/5 −8/5
0
1/5 2/5
=
1/2
0
1
๐‘‹ = ๐ด−1 ๐ต
−1/2 1/5 −8/5 2
0
1/5 2/5
๐‘‹=
5
1/2
0
1
−5
8
๐‘‹ = −1
−4
Download