Professional Documents
Culture Documents
Steps:
1. Know the function
2. Know the Xi, Xi+1, and h = Xi+1 - Xi
3. Get the nth order derivative (1st column)
4. Substitute Xi to the derivatives (2nd column)
5. Complete the formula
NUMMETS Page 1
Bisection Method
Sunday, 29 November 2020 10:04 PM
Algorithm:
1. Determine xl and xu
2. Check if f(xl) * f(xu) < 0
3. Find xm = (xl + xu) / 2
4. If f(xl) * f(xm) < 0, xl = xl xu = xm
f(xl) * f(xm) > 0, xl = xm xu = xu
f(xl) * f(xm) = 0, stop
5. Find new xm
Find absolute relative approximate error
|ɛa| = abs(( xm new - xm old)/xm new) * 100
6. Complete the table and check stopping criteria
# xl xu xm f(xl) f(xu) f(xm) |ɛa|
1 N/A
2
NUMMETS Page 2
False Position Method
Sunday, 29 November 2020 10:42 PM
Algorithm:
1. Determine xl and xu
2. Check if f(xl) * f(xu) < 0
3. Find xr = (xu * f(xl) - xl * f(xu)) / f(xl) - f(xu)
4. If f(xl) * f(xr) < 0, xl = xl xu = xr
f(xl) * f(xr) > 0, xl = xr xu = xu
f(xl) * f(xr) = 0, stop
5. Find new xr
Find absolute relative approximate error
|ɛa| = abs(( xr new - xr old)/xr new) * 100
6. Complete the table and check stopping criteria
# xl xu xr f(xl) f(xu) f(xr) |ɛa|
1 N/A
2
NUMMETS Page 3
Newton-Raphson Method
Sunday, 29 November 2020 11:28 PM
Algorithm:
1. Evaluate f(x) and f'(x)
2. Solve xi+1 = xi - (f(x) / f'(x))
3. Find absolute relative approximate error
|ɛa| = abs(( xi+1 - xi)/xi+1) * 100
4. Complete the table
# x f(x) f'(x) f(xi) |ɛa|
0 xi - - - -
1 xi+1
Suggested:
# x f(x) f'(x) xi+1 |ɛa|
1
2
NUMMETS Page 4
Secant Method
Sunday, 29 November 2020 11:47 PM
Algorithm:
1. Solve xi+1 = xi - ( (f(xi) (xi - xi-1) ) / ( f(xi) - f(x-1) )
2. Find absolute relative approximate error
|ɛa| = abs(( xi+1 - xi)/xi+1) * 100
3. Complete the table
# xi-1 xi xi+1 |ɛa| f(xi+1)
1
2
NUMMETS Page 5
Müller's Method
Monday, 30 November 2020 1:02 AM
Steps:
1. Determine function and x(0), x(1), and x(2) (first column)
2. Solve f(x0), f(x1), and f(x2) (second column)
3. C = f(x2)
4. H0 = x1 - x0
5. H1 = x2 - x1
6. ∆0 = (f(x1) - f(x0)) / x1 - x0
7. ∆1 = (f(x2) - f(x1)) / x2 - x1
8. A = (∆1 - ∆0) / h1 + h0
9. B = (A * h1) + ∆1
10. X3 = x2 + (-2c / (b ± sqr((b^2) - 4ac)))
NUMMETS Page 6
Fixed Point Iteration
Monday, 7 December 2020 9:47 AM
Steps:
1. Solve for x as g(x)
2. xi+1 = g(xi)
3. xr - xi+1 = g(xr) - g(xi)
4. Solve for εa (xi)
|ɛa| = abs((new-old)/new) * 100
5. Solve for εt [if true value is given]
|ɛt| = abs((new-true)/new) * 100
6. If more than 1 g(x), use them all
7. Complete the table and check stopping criteria
i Xi g(Xi) ɛa ɛt
1 - -
2
3
4
5 -
NUMMETS Page 7
Bairstow Method
Saturday, 26 December 2020 10:27 PM
NUMMETS Page 8
Naïve Gaussian Method
Saturday, 26 December 2020 10:28 PM
Steps:
1. Determine number of steps: N-1
2. Show two forms
[A][X] = [C]
[A : C]
NUMMETS Page 9
Gauss Elimination with Partial Pivoting
Saturday, 26 December 2020 10:38 PM
Steps:
1. Determine number of steps: N-1
2. Show two forms
[A][X] = [C]
[A : C]
NUMMETS Page 10
Determinant of a Square Matrix
Sunday, 27 December 2020 10:06 PM
Steps:
1. Perform forward elimination with partial pivoting
2. After solving for the upper triangular matrix, solve for the determinant by multiplying the
values in its hypotenuse
B11 x B22 x B33 = det(U) = det(A)
NUMMETS Page 11
LU Decomposition
Sunday, 27 December 2020 10:09 PM
Steps:
1. Show equations in [A][X] = [C] format
2. Solve for upper triangular matrix using forward elimination (without partial pivoting)
3. Solve for lower triangular matrix using the multipliers
L21 =
L31 =
L32 =
[A] = [L][U] =
[Z] = =
[A] = =
NUMMETS Page 12
For 3rd column, use [U] = [Z]
[A] -1 =
NUMMETS Page 13
Gauss-Seidel Method
Monday, 28 December 2020 9:54 PM
Steps:
1. Show equations in [A][X] = [C] format
2. Make sure that A is a diagonally dominant matrix (may use partial pivoting [absolute values])
3. Assume initial guesses in the format
NUMMETS Page 14
Linear Regression
Monday, 28 December 2020 10:14 PM
Steps:
1. Write equation in y = a0 + a1 x
2. Know n
3. Complete the table
i x y x2 xy
1
2
3
3
∑
i=1
NUMMETS Page 15
Polynomial Regression
Tuesday, 29 December 2020 11:11 PM
Steps:
1. Write equation in y = a0 + a1 x + a2 x2
2. Know n
3. Complete the table
i x x2 x3 x4 y xy xy2
1
2
3
3
∑
i=1
NUMMETS Page 16
Exponential Regression
Tuesday, 29 December 2020 11:11 PM
Steps:
1. Write equation = Ae^λ , ln( ) = ln(A) + λ , z = ln , a0 = ln(A), a1 = λ, and z = a0 + a1 x
2. Know n
3. Complete the table
i x y x2 xy
1
2
3
3
∑
i=1
NUMMETS Page 17
Trapezoidal Rule of Integration
Thursday, 7 January 2021 4:14 PM
Steps:
1. Write integral and intervals
2. Solve for I
3. Solve for I
Table
n Value Et |ɛt|% *|ɛa|%
1 -
2
3
NUMMETS Page 18
Simpson's 1/3rd Rule of Integration
Thursday, 7 January 2021 4:40 PM
Steps:
1. Write integral and intervals
2. Solve for x
Find
f(t0) = f(x0)
f(t1) = f(t0 + h)
f(t2) = f(t1 + h)
f(tn) = f(xn)
3. Solve for x
Table
n Value Et |ɛt|%
2
4
6
NUMMETS Page 19
Richardson's Extrapolation Formula for Trapezoidal Rule
Thursday, 14 January 2021 11:15 AM
Steps:
1. Construct the table
n Trapezoidal |ɛt|% for Richardson's |ɛt|% for Richardson's
Rule Trapezoidal Rule Extrapolation Extrapolation
1 - -
2
4
8
NUMMETS Page 20
Romberg Rule of Integration
Thursday, 14 January 2021 11:25 AM
Steps:
1. Construct the table
n Trapezoidal Rule
1 I1,1
2 I1,2
4 I1,3
8 I1,4
NUMMETS Page 21
Gauss Quadrature Rule of Integration
Thursday, 14 January 2021 11:36 AM
Steps:
1. Change the limits of integration from [a, b] to [-1, 1] and solve using the formula given
One-point:
N-point:
2. Get weighting factors and function argument values from the table below
Points Weighting Factors Function Arguments
2 C1 = 1 X1 = -0.57735
C2 = 1 X2 = 0.57735
3 C1 = 0.55555 X1 = -0.77459
C2 = 0.88888 X2 = 0
C3 = 0.55555 X3 = 0.77459
4 C1 = 0.34785 X1 = -0.86113
C2 = 0.65214 X2 = -0.33998
C3 = 0.65214 X3 = 0.33998
C4 = 0.34785 X4 = 0.86113
5 C1 = 0.23692 X1 = -0.90617
C2 = 0.47862 X2 = -0.53846
C3 = 0.56888 X3 = 0
C4 = 0.47862 X4 = 0.53846
C5 = 0.23692 X5 = 0.90617
6 C1 = 0.17132 X1 = -0.93246
C2 = 0.36076 X2 = -0.66120
C3 = 0.46791 X3 = -0.23861
C4 = 0.46791 X4 = 0.23861
C5 = 0.36076 X5 = 0.66120
C6 = 0.17132 X6 = 0.93246
NUMMETS Page 22
3. Solve using the Gauss quadrature formula
NUMMETS Page 23
Direct Method
Friday, 22 January 2021 9:54 AM
Linear
Steps:
1. Write v(t) = ao + a1t and t = 16
2. Get values closest to guess
t0 = 15, v(t0) = 362.78
t1 = 20, v(t1) = 517.35
3. Solve
v(15) = ao + a1(15) = 362.78
v(20) = a1 + a1(20) = 517.35
ao = -100.93
a1 = 30.914
v(16) = 393.694
Quadratic
Steps:
1. Write v(t) = ao + a1t + a2t2 and t = 16
2. Get values closest to guess
t0 = 10, v(t0) = 227.04
t1 = 15, v(t1) = 362.78
t2 = 20, v(t2) = 517.35
3. Solve
v(10) = ao + a1(10) + a2(10)2= 227.04
v(15) = ao + a1(15) + a2(15)2 = 362.78
v(20) = a1 + a1(20) + a2(20)2 + + a2(10)3= 517.35
1 1 22
1 22 2
2 1
a0 = 12.05
a1 = 17.733
a2 = 0.3766
v(16) = 392.19
Quadratic
NUMMETS Page 24
Steps:
1. Write v(t) = ao + a1t + a2t2 + a3t3 and t = 16
2. Get values closest to guess
t0 = 10, v(t0) = 227.04
t1 = 15, v(t1) = 362.78
t2 = 20, v(t2) = 517.35
t3 = 22.5, v(t3) = 602.97
3. Solve
v(10) = ao + a1(10) + a2(10)2 + a3(10)3 = 227.04
v(15) = ao + a1(15) + a2(15)2 + a3(15)3 = 362.78
v(20) = a1 + a1(20) + a2(20)2 + a3(20)3 = 517.35
v(22.5) = a1 + a1(22.5) + a2(22.5)2 + a3(22.5)3 = 602.97
a0 = -4.254
a1 = 21.266
a2 = 0.13204
a3 = 0.0054347
v(16) = 392.06
NUMMETS Page 25
Newton's Method
Friday, 22 January 2021 10:08 AM
Linear
Steps:
1. Get values closest to guess and t
t0 = 15, v(t0) = 362.78
t1 = 20, v(t1) = 517.35
t= 16
2. Solve
f1(t) = bo + b1 (t - t0)
f1(t) = f(t0) + (t - t0)
f1(16) = 393.694
Quadratic
Steps:
1. Get values closest to guess and t
t0 = 10, v(t0) = 227.04
t1 = 15, v(t1) = 362.78
t2 = 20, v(t2) = 517.35
t = 16
2. Solve
f2(t) = bo + b1 (t - t0) + b2 (t - t0)(t - t1)
f2(16) = 392.1876
Cubic
Steps:
1. Get values closest to guess and t
t0 = 10, v(t0) = 227.04
t1 = 15, v(t1) = 362.78
t2 = 20, v(t2) = 517.35
t3 = 22.5, v(t3) = 602.97
t = 16
2. Solve
f3(t) = bo + b1 (t - t0) + b2 (t - t0)(t - t1) + b3 (t - t0)(t - t1)(t - t2)
NUMMETS Page 26
f3(t) = 227.04 + 27.148 (t - 10) + 0.3766 (t - 10) (t - 15) + 5.4347 x 10-3 (t - 10) (t - 15) (t - 20)
f3(16) = 392.06
NUMMETS Page 27
Lagrange Method
Friday, 22 January 2021 10:22 AM
Linear
Steps:
1. Get values closest to guess and t
t0 = 15, v(t0) = 362.78
t1 = 20, v(t1) = 517.35
t= 16
2. Solve
v(t) = v(t0) + v(t1)
v(16) =
Quadratic
Steps:
1. Get values closest to guess and t
t0 = 10, v(t0) = 227.04
t1 = 15, v(t1) = 362.78
t2 = 20, v(t2) = 517.35
t = 16
2. Solve
v(t) = v(t0) + v(t1) + v(t2)
v(16) =
Cubic
NUMMETS Page 28
Spline Method
Friday, 22 January 2021 10:36 AM
Linear
Steps:
1. Get values closest to guess and t
t0 = 15, v(t0) = 362.78
t1 = 20, v(t1) = 517.35
t= 16
2. Solve
v(t) = v(t0) + (t - t0)
v(16) =
NUMMETS Page 29
Euler's Method
Friday, 22 January 2021 10:38 AM
Steps:
1. Write given equation in dy/dx, y(x) = value, and step size, h
2. Transform to f(x,y)
3. Start iteration
y i + 1 = y i + f(x i, y i) h
x= x+h
y = y i+1
NUMMETS Page 30
Heun's Method
Sunday, 24 January 2021 8:25 PM
Steps:
1. Write given equation in dy/dx, y(x) = value, and step size, h
2. Transform to f(x,y)
3. Start iteration
k1 = f(xi, yi)
k2 = f(xi + h, yi + k1 h)
x= x+h
y = y i+1
NUMMETS Page 31
Midpoint Method
Sunday, 24 January 2021 8:28 PM
Steps:
1. Write given equation in dy/dx, y(x) = value, and step size, h
2. Transform to f(x,y)
3. Start iteration
k1 = f(xi, yi)
y i + 1 = y i + k2 h
x= x+h
y = y i+1
NUMMETS Page 32
Ralston Method
Sunday, 24 January 2021 8:31 PM
Steps:
1. Write given equation in dy/dx, y(x) = value, and step size, h
2. Transform to f(x,y)
3. Start iteration
k1 = f(xi, yi)
x= x+h
y = y i+1
NUMMETS Page 33