You are on page 1of 17

Numerical Methods for CE Problems

Formula: Quotient Rule

Forms for the Equation of a Line


Slope-Intercept

Power Rule
Point-Slope

Standard Form

Intercept Form

Vertical

Horizontal

Limits
Notation of a Limit

Sum Rule

Constant Multiple Rule

Product Rule
Numerical Methods for CE Problems

Derivatives Derivative of Exponential


General Derivative
[Constant]

[Power Rule]

[Power Rule for Functions]


Derivative of Trigonometric

[Product Rule]

[Quotient Rule]

Derivative of Hyperbolic

Derivative of Logarithm
Numerical Methods for CE Problems

Derivative of Inverse Trigonometric Integral


Indefinite Integral
[Constant Rule]

[Constant Multiple Rule]

[Sum/Difference Rule]

[Power Rule]

Derivative of Inverse Hyperbolic


[Log Rule]

[Exponent Rule]

[Trig Rules]
Numerical Methods for CE Problems

Integral of Inverse Trigonometric Volumes of Solid of Revolution


Disc Method
[Axis of rotation is the x-axis]

Integral of Hyperbolic

Given by the curve 𝑦 = 𝑓(𝑥) between 𝑥 = 𝑎


and 𝑥 = 𝑏
[Axis of rotation is the y-axis]

Integral of Inverse Hyperbolic

Given by the curve 𝑥 = 𝑔(𝑦) between 𝑦 = 𝑐


and 𝑦 = 𝑑
Numerical Methods for CE Problems

Washer Method Cylindrical / Shell Method


[Axis of rotation is the x-axis] [Axis of rotation is the y-axis but bounded
below by the x-axis]

Upper Boundary: 𝑦 = 𝑓(𝑥)


Lower Boundary: 𝑦 = 𝑔(𝑥)
Between (L-R): 𝑥 = 𝑎 to 𝑥 = 𝑏
[Axis of rotation is the y-axis] Curve: 𝑦 = 𝑓(𝑥)
Between (L-R): 𝑥 = 𝑎 to 𝑥 = 𝑏
[Axis of rotation is the x-axis but bounded
to the left by the y-axis]

Right Boundary: 𝑥 = 𝑓(𝑦)


Left Boundary: 𝑥 = 𝑔(𝑦)
Between (U-D): 𝑦 = 𝑑 to 𝑦 = 𝑐

Curve: 𝑥 = 𝑓(𝑦)
Between (U-D): 𝑦 = 𝑑 to 𝑦 = 𝑐
Numerical Methods for CE Problems

Pappus Theorem Axis of rotation is the y-axis


[2 Curves] Horizontal Strips
• Find the points of intersection 𝑑
𝑉 = 𝜋 ∫ (𝑥12 − 𝑥22 )𝑑𝑦
• Assume 2 values for each curve 𝑐
between the points of intersection to Vertical Strips
𝑏
plot the figure
𝑉 = 2𝜋 ∫ 𝑥(𝑦2 − 𝑦1 )𝑑𝑥
𝑎
𝑉 = 𝐴 × 2𝜋𝑧
Where: Time Rates
V = volume • Given (in terms of d/dt)
A = area • Find the Required (in terms of d/dt)
z = perpendicular distance of the centroid of • Find the Equation where the
area from the axis of revolution numerators of derivatives are
related
Analyzation: • Substitute initial values
• Differentiate
• Substitute final values (with d/dt)
• Solve
Example:
Numerical Methods for CE Problems

Series and Sequence Root Test


Arithmetic Sequence 𝐿 = lim | 𝑛√𝑎𝑛 |
𝑛→∞
𝑎𝑛 = 𝑎1 + (𝑛 − 1)𝑑 ↓
Sum (Partial Sum) 1
𝑎1 + 𝑎𝑛 𝐿 = lim |𝑎𝑛 𝑛 |
𝑛→∞
𝑆𝑛 = ( )𝑛
2 • Raise it to 1/n
𝑛
𝑆𝑛 = [2𝑎1 + (𝑛 − 1)𝑑] • 𝐿 < 1, 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒𝑛𝑡
2
• 𝐿 > 1, 𝑑𝑖𝑣𝑒𝑟𝑔𝑒𝑛𝑡
• 𝐿 = 1, 𝑖𝑛𝑐𝑜𝑛𝑐𝑙𝑢𝑠𝑖𝑣𝑒
Geometric Sequence
𝑎𝑛 = 𝑎1 𝑟 𝑛−1
Interval and Radius of Convergence
Sum (Partial Sum)
𝑎1 (1 − 𝑟 𝑛 ) In Ratio Test:
𝑆𝑛 = → 𝑓𝑖𝑛𝑖𝑡𝑒 𝑠𝑒𝑟𝑖𝑒𝑠 + If answer is 0,
1−𝑟
𝑎1 R=∞
𝑆𝑛 = → 𝑖𝑛𝑓𝑖𝑛𝑖𝑡𝑒 𝑠𝑒𝑟𝑖𝑒𝑠
1−𝑟 I {−∞, ∞}
+ If answer is ∞,
Power Series
∞ R=0
∑ 𝑎𝑛 𝑥 𝑛 I {c} (will converge if x = c)
𝑛=0 + If answer is exact number,
Where: c = 0 -1 < L < 1

R = when |x-c| < R
∑ 𝑎𝑛 (𝑥 − 𝑐)𝑛
R = Difference of two end points then divide
𝑛=0
Ex: Determine where it’s centered at by 2
∞ I, if divergent use ( and if convergent use [
∑ 𝑎𝑛 (𝑥 − 2)𝑛 Test Endpoints
𝑛=0
𝑐=2
∞ Ex:
(3𝑥 − 2)𝑛
∑ 1
𝑛 𝐿 = (𝑥 + 3)
𝑛=0 4
2 1
𝑐= [−1 < (𝑥 + 3) < 1] 4
3 4
−4 < 𝑥 + 3 < 4
Ratio Test • Minus 3 all of them
𝑎𝑛+1 −7 < 𝑥 < 1
𝐿 = lim | |
𝑛→∞ 𝑎𝑛 Test Endpoints
1 𝐿 = lim 𝑎𝑛
𝑎𝑛+1 × 𝑛→∞
𝑎𝑛
Where x = -7 and 1
• Replace all n into n+1
R=4
• 𝐿 < 1, 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒𝑛𝑡
R = 1-(-7) = 4
• 𝐿 > 1, 𝑑𝑖𝑣𝑒𝑟𝑔𝑒𝑛𝑡
• 𝐿 = 1, 𝑖𝑛𝑐𝑜𝑛𝑐𝑙𝑢𝑠𝑖𝑣𝑒 I (-7,1}
Numerical Methods for CE Problems

Power Series and Functions Gauss Jordan Elimination Method


Infinite Sum of Geometric Progression + Convert the 3 equations into augmented

𝑎 matrix with the numerical coefficients only
∑ 𝑎𝑟 𝑛 =
1−𝑟
𝑛=0
1
𝑓(𝑥) =
1−𝑥
|𝑟| < 1, 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒
|𝑟| > 1, 𝑑𝑖𝑣𝑒𝑟𝑔𝑒

+ 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

+ Row 3 – Row 2 + Isolate x, y, and z formulas

+ Iteration – put values in the formulas


[1st Iteration]
+ Iterate the x (y = 0 and z = 0)
+ Iterate the y (x = computed and z = 0)
+ Iterate the z (x = computed and y =
computed)
[2nd Iteration]
+ Do the same process with the new values
+ Until the answer is close to whole number

LU Decomposition Method
+Then find the terms a1, a2, and a3

+ Compute for L and U


+ Compute for Z

+ Compute for X

Gauss-Seidel Method
+ The diagonal should be dominant
(arrange them if not)
Numerical Methods for CE Problems

+ Get U by using Gaussian Jordan + Cholesky


Elimination Method
+The values in L are the multiplier for each
row

+ Represent

Cholesky Method
+ Check if the matrix is symmetric + Using the formulas, compute for [U]

+ Solve for [y]

+ Check if the matrix is positive definite + Solve for [x]


Numerical Methods for CE Problems

Systems of Linear Equation Upper Triangular Method


Determinants of Matrix 1 0 −1
[𝐴] = [3 4 5]
Basket Method
0 −6 −7
Example: • Row 2 – Row 1
1 0 −1 1 0 3 4 5
[𝐴] = [3 4 5 ]3 4 −1 0 −1(3)
0 −6 −7 0 −6 3 0 −3
|𝐴| = [(1 ∗ 4 ∗ −7) + (0 ∗ 5 ∗ 0) [0 4 8]
+ (−1 ∗ 3 ∗ −6)] Became:
− [(0 ∗ 4 ∗ −1) + (−6 ∗ 5 ∗ 1) 1 0 −1
+ (−7 ∗ 3 ∗ 0)] [𝐴] = [0 4 8]
|𝐴| = 20 0 −6 −7
• Row 3 – Row 2
Co-factor Expansion 0 −6 −7 6
1 0 −1 −0 4 8 (− )
4
[𝐴] = [3 4 5] 0 −6 −12
0 −6 −7 [0 0 5]
• Use Row 1 Became:
Sign Convention 1 0 −1
[𝐴] = [0 4 8 ]
+𝑀11 −𝑀12 +𝑀13
−𝑀 0 0 5
[ 21 +𝑀22 −𝑀23 ]
+𝑀31 −𝑀32 +𝑀33
|𝐴| = 1 ∗ 4 ∗ 5 = 20
4 5 (1)
𝑀11 = [ ]
−6 −7 Cramer’s Rule
𝑀11 = [(4 ∗ −7) − (−6 ∗ 5)][1] = 2(+) Example:
3 5 (0)
𝑀12 = [ ] 25𝑥 + 5𝑦 + 𝑧 = 106.8
0 −7
𝑀12 = [(3 ∗ −7) − (0 ∗ 5)][0] = 0(−) 64𝑥 + 8𝑦 + 𝑧 = 177.2
3 4 (0) 144𝑥 + 12𝑦 + 𝑧 = 279.2
𝑀13 = [ ] Matrix Form
0 −6
𝑀12 = [(3 ∗ −6) − (0 ∗ 4)][−1] = 18(+) 25 5 1 106.8
[ 64 8 1] = [177.2]
|𝐴| = 2 + 0 + 18 = 20 144 12 1 279.2

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

-0.04 tolerance is enough


Therefore, 1.60 is the answer

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

Check for Absolute Error:


𝑛𝑒𝑤 𝑜𝑙𝑑
𝑋𝑚 − 𝑋𝑚
|∈𝑎 | = | 𝑛𝑒𝑤 | ∗ 100
𝑋𝑚
Stop Iteration if difference between
XU – XL < 0.01
Numerical Methods for CE Problems

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

0.0934 tolerance is enough


Therefore, 1.859375 is the answer

False Position Method

𝑓(𝑋𝐿 )
𝑋𝑛 = 𝑋𝐿 + (𝑋𝑈 − 𝑋𝐿 ) ( )
𝑓(𝑋𝐿 ) − 𝑓(𝑋𝑈 )

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

-0.00087 tolerance is enough


Therefore, 0.5677 is the answer
Numerical Methods for CE Problems

Newton’s Raphson Method


𝑓(𝑥𝑜𝑙𝑑 )
𝑥𝑛𝑒𝑤 − 𝑥𝑜𝑙𝑑 −
𝑓′(𝑥𝑜𝑙𝑑 )

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

Find the velocity at t = 16s


𝑣(𝑡) = 𝑎0 + 𝑎1 𝑡
@ Point 15:
362.78 = 𝑎0 + 𝑎1 (15)
@ Point 20:
517.35 = 𝑎0 + 𝑎1 (20)
• 2 equations, 2 unknowns
𝑎0 = −100.93
𝑎1 = 30.914
𝑣(16) = −100.93 + 30.914(16) = 393.694

Using Quadratic Interpolation


𝑣(𝑡) = 𝑎0 + 𝑎1 𝑡 + 𝑎2 𝑡 2
• Points 10, 15 and 20

Newton’s Divided Difference


𝑦 = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + ⋯

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

𝑣(16) = 227.04 + 27.148(16 − 10) + 0.3766(16 − 10)(16 − 15)


+ 0.005432(16 − 10)(16 − 15)(16 − 20) = 392.0572

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 )

You might also like