Final 8 X 2
Final 8 X 2
em 4.9: Gauss–Jordan Elimination Method 1 0 0.8 −1.1 5 ← −(0.8)[0 0 1 1.75 −2.5] 8.1.2 Two-point backward difference formula for first derivative
0 1 −0.4 1.8 −1 ← −(−0.4)[0 0 1 1.75 −2.5]
Solve the following system of equations using the Gauss elimination method. Solve the following system of equations using the Gauss–Jordan elimination ൦ ൪ = f ᇱᇱ (x ୧ ) ଶ f ᇱᇱᇱ (x୧ ) ଷ f (ସ) (x ୧ ) ସ
0 0 1 1.75 −2.5 ← f(x୧ିଵ ) = f(x୧ ) − f ᇱ (x୧ )h + h − h + h +⋯
method. 2! 3! 4!
Given system of equations: 0 0 8.2 −10.4 29 ← −(8.2)[0 0 1 1.75 −2.5]
f ᇱᇱ (ξ) ଶ
2x₁ + x₂ − x₃ + 2x₄ = 0 Given system of equations: 1 0 0 −2.5 7 f(x୧ିଵ ) = f(x୧ ) − f ᇱ (x୧ )h + h
x₁ − 2x₂ + x₃ − 4x₄ = 3 4x₁ + 3x₂ + 2x₃ + x₄ = 17 0 1 0 2.5 −2 2!
൦ ൪ f(x୧ ) − f(x୧ିଵ ) f ᇱᇱ (ξ)
3x₁ − x₂ − 2x₃ − x₄ = −3 2x₁ − x₂ + 2x₃ − 4x₄ = 11 0 0 1 1.75 −2.5 → f ᇱ (x୧ ) = + h
−x₁ + 2x₂ + x₃ − 2x₄ = 13 x₁ + 2x₂ − 2x₃ − x₄ = 8 0 0 0 −24.75 49.5 h 2!
f ᇱᇱ (ξ)
−2x₁ + 4x₂ + 5x₃ − x₄ = 15 Normalize row 4 by dividing by -24.75 and eliminate above: truncation error = h = O(h)
The system of equations in matrix form is: 2!
First, form the augmented matrix: f(x୧ ) − f(x୧ିଵ )
2 1 −1 2 xଵ 0 1 0 0 −2.5 7 ← −(−2.5)[0 0 0 1 −2] → f ᇱ (x୧ ) = + O(h)
1 −2 1 −4 xଶ 3 0 1 0 2.5 −2 ← −(2.5)[0 0 0 1 −2] h
൦ ൪൦ ൪ = ൦ ൪ 4 3 2 1 17 ൦ ൪ =
3 −1 −2 −1 xଷ −3 2 −1 2 −4 11 0 0 1 1.75 −2.5 ← −(1.75)[0 0 0 1 −2] 8.1.3 Two-point central difference formula for first derivative
൦ ൪
−1 2 1 −2 xସ 13 1 2 −2 −1 8 0 0 0 1 −2 ←
ୟ ଵ ୟ ଷ ୟ ିଵ
1 0 0 0 2 f ᇱᇱ (x୧ ) ଶ f ᇱᇱᇱ (ξଵ ) ଷ
With mଶଵ = ୟమభ = ଶ = 0.5, mଷଵ = ୟయభ = ଶ = 1.5, mସଵ = ୟరభ = ଶ = −0.5, the −2 4 5 −1 15 f(x୧ାଵ ) = f(x୧ ) + f ᇱ (x୧ )h + h + h
భభ భభ భభ 0 1 0 0 3 2! 3!
first pass with Gaussian elimition yields: The pivot element aଵଵ = 4. Normalize row 1 by dividing by 4. ൦
0 0 1 0 1
൪ f ᇱᇱ (x୧ ) ଶ f ᇱᇱᇱ (ξଶ ) ଷ
f(x୧ିଵ ) = f(x୧ ) − f ᇱ (x୧ )h + h − h
2 1 −1 2 xଵ 0 1 0.75 0.5 0.25 4.25 ← 0 0 0 1 −2 2! 3!
2 −1 2 −4 11 ← −(2)[1 0.75 0.5 0.25 4.25] f ᇱᇱᇱ (ξଵ ) ଷ f ᇱᇱᇱ (ξଶ ) ଷ
0 −2.5 1.5 −5 xଶ 3 ൦ ൪ = Final solution: x₁ = 2, x₂ = 3, x₃ = 1, x₄ = −2 f(x୧ାଵ ) − f(x୧ିଵ ) = 2f ᇱ (x ୧ )h + h + h
൦ ൪൦ ൪ = ൦ ൪ 1 2 −2 −1 8 ← −(1)[1 0.75 0.5 0.25 4.25] 3! 3!
0 −2.5 −0.5 −4 xଷ −3
−2 4 5 −1 15 ← −(−2)[1 0.75 0.5 0.25 4.25] f(x୧ାଵ ) − f(x୧ିଵ ) f ᇱᇱᇱ (ξଵ ) f ᇱᇱᇱ (ξଶ ) ଶ
0 2.5 0.5 −1 xସ 13 Chapter 8: ᇱ (x )
→f ୧ = −ቆ + ቇh
ᇲ ᇲ
1 0.75 0.5 0.25 4.25 2h 2.3! 2.3!
ୟయమ ିଶ.ହ ୟరమ ଶ.ହ 8.1 Finite Difference Formulas of First Derivative
Next, with mଷଶ = = = 1, mସଶ = = = −1, the second pass with 0 −2.5 1 −4.5 2.5 f(x୧ାଵ ) − f(x୧ିଵ )
ୟᇲమమ ିଶ.ହ ୟᇲమమ ିଶ.ହ ൦ ൪ → f ᇱ (x୧ ) = + O(hଶ )
0 1,25 −2.5 −1.25 3.75 8.1.1 Two-point forward difference formula for first derivative 2h
Gaussian elimination yields:
0 5.5 6 −0.5 23.5 f ᇱᇱᇱ (ξଵ ) f ᇱᇱᇱ (ξଶ ) ଶ
2 1 −1 2 xଵ 0 f ᇱᇱ (x ୧ ) ଶ f ᇱᇱᇱ (x୧ ) ଷ f (ସ) (x ୧ ) ସ truncation error = − ቆ + ቇ h = O(hଶ )
Normalize row 2 by dividing by -2.5 and eliminate above/below: f(x୧ାଵ ) = f(x୧ ) + f ᇱ (x୧ )h + h + h + h +⋯ 2.3! 2.3!
0 −2.5 1.5 −5 xଶ 3 2! 3! 4!
൦ ൪൦ ൪ = ൦ ൪
0 0 −2 1 xଷ −6 1 0.75 0.5 0.25 4.25 ← −(0.75)[0 1 −0.4 1.8 −1] where h = x୧ାଵ − x୧ 8.1.4 Three-point forward and backward difference formulas for first derivative
0 0 2 −6 xସ 16 0 1 −0.4 1.8 −1 ←
൦ ൪ = Note: above is also Taylor series formula of f(x୧ାଵ ). Forward:
ᇲᇲ
ୟరయ ଶ 0 1,25 −2.5 −1.25 3.75 ← −(1.25)[0 1 −0.4 1.8 −1]
Next, with mସଷ = ୟᇲᇲ
= = −1, the third pass with Gaussian elimination 0 5.5 6 −0.5 23.5 ← −(5.5)[0 1 −0.4 1.8 −1] f ᇱᇱ (x୧ ) ଶ f ᇱᇱᇱ (ξଵ ) ଷ
యయ ିଶ Rewritten as:
yields: 1 0 0.8 −1.1 5 f(x୧ାଵ ) = f(x୧ ) + f ᇱ (x୧ )h + h + h
f ᇱᇱ (ξ) ଶ 2! 3!
0 1 −0.4 1.8 −1 f(x୧ାଵ ) = f(x୧ ) + f ᇱ (x୧ )h + h f ᇱᇱ (x୧ ) f ᇱᇱᇱ (ξଶ )
2 1 −1 2 xଵ 0 ൦
0 0 −2 −3.5 5
൪ 2! f(x୧ାଶ ) = f(x୧ ) + f ᇱ (x୧ )2h + (2h)ଶ + (2h)ଷ
0 −2.5 1.5 −5 xଶ 3 where ξ is a value of x between x୧ and x୧ାଵ 2! 3!
൦ ൪ ൦x ൪ = ൦ ൪ 0 0 8.2 −10.4 29 ᇱᇱ ᇱ
f ᇱᇱᇱ (ξଵ ) ଷ f ᇱᇱᇱ (ξଶ )
0 0 −2 1 ଷ −6 f(x୧ାଵ ) − f(x ୧ ) f (ξ) 4f(x୧ାଵ ) − f(x ୧ାଶ ) = 3f(x୧ ) + 2f (x୧ )h + 4 h − (2h)ଷ
0 0 0 −5 xସ 10 Normalize row 3 by dividing by -2 and eliminate above/below: → f ᇱ (x୧ ) = − h 3! 3!
h 2! 4f(x୧ାଵ ) − f(x ୧ାଶ ) = 3f(x୧ ) + 2f ᇱ (x୧ )h − 2hO(hଶ )
ଵ ିିଵ(ିଶ) f ᇱᇱ (ξ) −3f(x୧ ) + 4f(x୧ାଵ ) − f(x୧ାଶ )
Using back substitution, xସ = ିହ = −2, x ଷ = = 2, xଶ = truncation error = − h = O(h) f ᇱ (x୧ ) = + O(hଶ )
ଷି(ିହ)(ିଶ)ି(ଵ.ହ)(ଶ)
ିଶ
ି(ଶ)(ିଶ)ି(ିଵ)(ଶ)ି(ଵ)(ସ)
2! 2h
= 4, xଵ = = 1. Thus, the solution is f(x୧ାଵ ) − f(x ୧ )
ିଶ.ହ ଶ → f ᇱ (x୧ ) = + O(h) Similar, three point backward
[xଵ xଶ xଷ xସ ] = [1 4 2 −2] h