Numerical Methods Formula
Numerical Methods Formula
Numerical Methods Formula
Power Rule
Point-Slope
Standard Form
Intercept Form
Vertical
Horizontal
Limits
Notation of a Limit
Sum Rule
Product Rule
Numerical Methods for CE Problems
[Power Rule]
[Product Rule]
[Quotient Rule]
Derivative of Hyperbolic
Derivative of Logarithm
Numerical Methods for CE Problems
[Sum/Difference Rule]
[Power Rule]
[Exponent Rule]
[Trig Rules]
Numerical Methods for CE Problems
Integral of Hyperbolic
Curve: 𝑥 = 𝑓(𝑦)
Between (U-D): 𝑦 = 𝑑 to 𝑦 = 𝑐
Numerical Methods for CE Problems
+ Row 2 – Row 1
Taylor Series
∞
(𝑥 − 𝑎)𝑛
𝑓(𝑥) = ∑ 𝑓 (𝑛) (𝑎)
𝑛!
𝑛=0
(𝑥 − 𝑎)
𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎)
1!
(𝑥 − 𝑎)2
+ 𝑓 ′′ (𝑎)
2!
(𝑥 − 𝑎)3
+ 𝑓 ′′′ (𝑎) +⋯
3!
• Derivative the function
• Apply the given a
• Use the formula
Maclaurin Series
• Taylor Series where a = 0
∞
𝑓 𝑛 (0) 𝑛 + Row 3 – Row 1
𝑓(𝑥) = ∑ 𝑥
𝑛!
𝑛=0
𝑓 ′ (0) 𝑓 ′ ′(0) 2 𝑓 ′ ′′(0) 3
𝑓(𝑥) = 𝑓(0) + 𝑥+ 𝑥 + 𝑥
1! 2! 3!
+⋯
• Derivative the function
• Apply the given a
• Use the formula
Sauce: https://youtu.be/LDBnS4c7YbA
Numerical Methods for CE Problems
LU Decomposition Method
+Then find the terms a1, a2, and a3
+ Compute for X
Gauss-Seidel Method
+ The diagonal should be dominant
(arrange them if not)
Numerical Methods for CE Problems
+ Represent
Cholesky Method
+ Check if the matrix is symmetric + Using the formulas, compute for [U]
25 5 1
[𝐴] = [ 64 8 1]
144 12 1
|𝐴| = −84
106.8 5 1
[𝐴𝑥] = [177.2 8 1]
279.2 12 1
|𝐴𝑥| = −24.4
−24.4
𝑥= = 0.2905
−84
Numerical Methods for CE Problems
25 106.8 1 𝐴𝑑𝑗[𝐴]
[𝐴𝑦] = [ 64 177.2 1] = [𝐴]−1
|𝐴|
144 279.2 1
|𝐴𝑦| = −1654
0.47619 −0.083 0.0357
−1654
𝑥= = 19.6905 [𝐴]−1 = [−0.95238 1.416 −0.4643]
−84 4.5714 −5 1.4286
25 5 106.8
[𝑋] = [𝐶][𝐴]−1
[𝐴𝑧] = [ 64 8 177.2] 𝑥
144 12 279.2 [𝑦 ]
|𝐴𝑧| = −91.2 𝑧
−91.2 106.8 0.47619 −0.083 0.0357
𝑥= = 1.0857
−84 = [177.2] [−0.95238 1.416 −0.4643]
279.2 4.5714 −5 1.4286
Matrix Method 𝑥 = (0.47619)(106.8) + (−0.083)(177.2)
+ (0.0357)(279.2)
Example:
𝑥 = 0.2904
25𝑥 + 5𝑦 + 𝑧 = 106.8
𝑦 = 19.6905
64𝑥 + 8𝑦 + 𝑧 = 177.2
𝑧 = 1.0857
144𝑥 + 12𝑦 + 𝑧 = 279.2
25 5 1
[𝐴] = [ 64 8 1]
144 12 1
Sign Convention
+𝑀11 −𝑀12 +𝑀13
[−𝑀21 +𝑀22 −𝑀23 ]
+𝑀31 −𝑀32 +𝑀33
8 1
𝑀11 = [ ]
12 1
𝑀11 = [(8 ∗ 1) − (12 ∗ 1)] = −4(+)
𝑀12 = −80(−)
𝑀13 = −384(+)
𝑀21 = −7(−)
𝑀22 = −119(+)
𝑀23 = −420(−)
𝑀31 = −3(+)
𝑀32 = −39(−)
𝑀33 = −120(+)
Cofactor
−4 80 −384
[ 7 −119 420 ]
−3 39 −120
Adjoint
−4 7 −3
[ 80 −119 39 ]
−384 420 −120
Numerical Methods for CE Problems
Non-Linear Equations
Linear – 1st Degree
Non-Linear – 2nd Degree or more
Incremental Search
Example:
𝑥2 − 𝑥 − 1 = 0
𝑥0 = 1.5 (𝐴𝑠𝑠𝑢𝑚𝑒)
∆= 0.05 (𝐴𝑠𝑠𝑢𝑚𝑒)
No. x f(x)
1 1.5 -0.25
2 1.55 -0.1475
3 1.60 -0.04
4 1.65 0.0725
Bisection Method
1. Assume Value of XL and XU such that f(XL)f(XU)<0 or in other words f(x) changes sign.
2. Estimate Midpoint of Root Xm
𝑋𝐿 + 𝑋𝑈
𝑋𝑚 =
2
3. Satisfy the following conditions:
a. If f(XL)f(Xm) < 0, the roots are located between XL and Xm
𝑋𝐿 = 𝑋𝐿 ; 𝑋𝑈 = 𝑋𝑚
b. If f(XL)f(Xm) > 0, the root is between Xm and XU
𝑋𝐿 = 𝑋𝑚 ; 𝑋𝑈 = 𝑋𝑈
c. If f(XL)f(Xm) = 0, the root is Xm, stop the algorithm
Example:
𝑥 4 − 𝑥 − 10 = 0
• 5 Iterations
• XL = 1.5
• XU = 2.0
• Condition: e = 0.0001
XL XU f(XL) f(XU) Xm f(Xm)
1.5 2.0 -6.4375 4 1.75 -2.3711
1.75 2.0 -2.3711 4 1.875 0.4846
1.75 1.875 -2.3711 0.4846 1.8125 -1.0202
1.8125 1.875 -1.0202 0.4846 1.84375 -0.2877
1.84375 1.875 -0.2877 0.4846 1.859375 0.0934
𝑓(𝑋𝐿 )
𝑋𝑛 = 𝑋𝐿 + (𝑋𝑈 − 𝑋𝐿 ) ( )
𝑓(𝑋𝐿 ) − 𝑓(𝑋𝑈 )
Conditions:
• f(XL)f(XU) < 0, root lies between XL and Xn
𝑋𝐿 = 𝑋𝐿 ; 𝑋𝑈 = 𝑋𝑛
• f(XL)f(XU) > 0, root is between XU and Xn
𝑋𝐿 = 𝑋𝑛 ; 𝑋𝑈 = 𝑋𝑈
• f(XL)f(XU) = 0, Xn = root
Example:
𝑒 −𝑥 − 𝑥 = 0
i XL XU f(XL) f(XU) Xn f(Xn)
1 0 1 1 -0.6321 0.6127 -0.4581
2 0 0.6127 1 -0.0708 0.5722 -0.0079
3 0 0.5722 1 -0.0079 0.5677 -0.00087
Example:
𝑥2 − 𝑥 − 1 = 0
• Assumption: xold = 1
𝑓(𝑥𝑜𝑙𝑑 ) = 𝑥 2 − 𝑥 − 1
𝑓 ′ (𝑥𝑜𝑙𝑑 ) = 2𝑥 − 1
𝑓(𝑥𝑜𝑙𝑑 ) = −1
𝑓 ′ (𝑥𝑜𝑙𝑑 ) = 1
−1
𝑥𝑛𝑒𝑤 = 𝑥1 = 1 − =2
1
𝑓(𝑥1 ) = 1
𝑓 ′ (𝑥1 ) = 3
1
𝑥𝑛𝑒𝑤 = 𝑥2 = 2 − = 1.6667
3
𝑓(𝑥2 ) = 0.1112
𝑓 ′ (𝑥2 ) = 2.3334
0.1112
𝑥𝑛𝑒𝑤 = 𝑥3 = 1.6667 − = 1.619
2.3334
𝑓(𝑥3 ) = 0.002161
Stop, 0.002161 tolerance is enough
Therefore, 1.619 is the answer
Secant Method
𝑓(𝑥𝑎 )(𝑥𝑎 − 𝑥𝑏 )
𝑥𝑛𝑒𝑤 = 𝑥𝑎 −
𝑓(𝑥𝑎 ) − 𝑓(𝑥𝑏 )
Example:
𝑥2 − 𝑥 − 1
i xa xb (xnew) f(xa) f(xb)
1 3 2 5 1
2 2 (from xb) 1.75 1 0.3125
3 1.75 1.6363 0.3125 0.0411
4 1.6363 1.619 0.0411 0.00238
(5)(3 − 2)
𝑥𝑛𝑒𝑤 = 3 − = 1.75
(5 − 1)
0.00238 tolerance is enough
Therefore, 1.619 is the answer
Numerical Methods for CE Problems
Interpolation
Direct Interpolation
𝑦 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + ⋯ 𝑎𝑛 𝑥 𝑛
Example:
x y
t(s) v(t)
0 0
10 277.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Coefficients
𝑎0 = 𝑓(𝑥0 ) = 𝑦0
𝑦1 − 𝑦0
𝑎1 = ∇𝑦0 =
𝑥1 − 𝑥0
𝑦1 − 𝑦0
𝑎2 = ∇2 𝑦0 =
𝑥2 − 𝑥0
𝑦1 − 𝑦0
𝑎𝑛 = ∇n 𝑦0 =
𝑥𝑛 − 𝑥0
Numerical Methods for CE Problems
x y ∇𝑦 ∇2 𝑦 ∇3 𝑦
x0 10 227.04 - - -
x1 15 362.78 27.148 - -
x2 20 517.35 30.914 0.3766 -
x3 22.5 602.97 34.248 0.4445 0.005432
362.78 − 227.04
∇𝑦 = = 27.148
15 − 10
517.35 − 362.78
∇𝑦 = = 30.914
20 − 15
602.87 − 517.35
∇𝑦 = = 34.248
22.5 − 20
30.914 − 27.148
∇2 𝑦 = = 0.3766
20 − 10
34.248 − 30.914
∇2 𝑦 = = 0.4445
22.5 − 15
0.4445 − 0.3766
∇3 𝑦 = = 0.005432
22.5 − 10
Lagrange Interpolation
x = 16 f(x)
x0 = 10 f(x0) = 227.04
x1 = 15 f(x1) = 362.78
x2 = 20 f(x2) = 517.35
x3 = 22.5 f(x3) = 602.97
Linear
(𝑥 − 𝑥1 ) (𝑥 − 𝑥0 )
𝑓(𝑥0 ) + 𝑓(𝑥1 )
(𝑥0 − 𝑥1 ) (𝑥1 − 𝑥0 )
Quadratic
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )
𝑓(𝑥0 ) + 𝑓(𝑥1 ) + 𝑓(𝑥2 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )
Cubic
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
𝑓(𝑥0 ) + 𝑓(𝑥1 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 )
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑓(𝑥2 ) + 𝑓(𝑥3 )
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )