Sei sulla pagina 1di 8

FORMULA SHEET FOR NUMERICAL METHODS FOR ENGINEERS

COEB223 / MATB324

Part 1: Modeling, Computers and Error Analysis


Error Definitions
  




True error:
True percent relative error:
 





 100 %



Approximate percent relative error:


 



  


 100 %




Stopping criterion:

Terminate computation when a < s where s is the desired percent relative error

Taylor Series
Taylor series expansion
  !" #    # $  %&'# ( $
where remainder
10 

)) # , ))) # .
 0#  # 0
( $
( $ /$
( $ 10
2!
3!
!

2345#6#
0!"#!

(0!"

or

10  7(0!" #

Error propagation

For n independent variables x1, x2, , xn having errors 9", 9,, , 90 , the error in the
function f can be estimated via

<
<
<
  ;
; 9" $ ;
; 9, $ / $ ;
; 90
<,
<0
<"

Page 1 of 8

COEB223/MATB324 Semester 1 2011/12

Part 2: Roots of Equations


Method

= 

Bisection

Formulation

> $ ?
2

=  ?

False Position

 !"  

Secant

If  > #   = # A 0, set >  =

? #> ? #
 > # ? #

 !"  

Newton Raphson

If  > #   = # < 0, set ?  =


If  > #   = # < 0, set ?  =
If  > #   = # A 0, set >  =

  #
) #

  # B"  #
  B" #  #

Part 3: Linear Algebraic Equations


Gauss Elimination

""

C ,"

."

",

,,

.,

".

,.

..

|
|
|

""
E"
E, F G H 0
E.
0

",

),,
0

".

),.

))..

|
|
|

E))..

))..
E"
E)
),. .
E), I G .  ,

),,
E)).
E"
", ,
". .
. 

""
. 

LU decomposition
Decomposition

""
C
,"

."

",

,,

.,

".
1

,. F G C ,"

..
."

0
1

.,

Back Substitution

""
E"
0 K"
0F JK, L  JE, L G C 0
1 K.
0
E.

",
),,
0

". "
"
K"
),. F J, L  JK, L G J, L
.
)).. .
K.

Forward Substitution

Page 2 of 8

COEB223/MATB324 Semester 1 2011/12

Gauss-Seidel method

E"
", ,
". . R


""
P S 
  T 
N
NB" P  N  NB"
E


,
,"
,.
N
"
.
M 
U
U 100% < V
N
,

,,

Q
N
N
P 
 )
E.
." "
., ,
N
P
. 

..
O
NB"

N
"

NB"

 0WX  Y 0WX $ 1 Y# Z>[

With relaxation,

Part 4: Curve Fitting


Method
Linear
Regression

T 
\ $
" 

where
]= 

" 

^ ",
_"

Formulation

Errors

 ^T
\
"  #,
_"

 T  T
  ,   #,

\  T
" 
Polynomial
Regression

]=  ^T
\
" 
,  , #,
_"

by differentiating Sr with respect to each coefficients


and setting the partial derivatives equal to zero, we
have:
^

^ ,
^ .

] ]=
]

]  ^T Td#,

T 
\ $
"  $
,  ,

g 
f
f^ 
f
f
,
e^ 

, 

where:

For a 2nd order polynomial fit,

where

]=
]a/&  c
 2

^  ,k
j
\
.j

^  J "L 
j
,
hj
^ i

n^ T R
P
P
^ T
m
Q
P^  , T P
l
O

Page 3 of 8

]=
]a/&  c
  $ 1#
, 

] ]=
]

where:

]  ^T Td#,

COEB223/MATB324 Semester 1 2011/12

Multiple
Linear
Regression

T 
\ $
" " $ / $
o o

]=
]a/&  c
  $ 1#

T 
\ $
" " $
, ,

For a two-variable linear fit,

where

, 

]=  ^T
\
" "
, , #,

where:

_"

by differentiating Sr with respect to each coefficients


and setting the partial derivatives equal to zero, we
have:
g 
f
f^ "
f
f
e ^ ,
Newtons
divided
difference
interpolating
polynomial

^ "

^ ",

^ " ,

^ , k
j
\
^ " , j J
" L 
j
,
, j
^ , i

.  #  E\ $ E"  \ # $ E,  \ # " #


$ E.  \ # " # , #

E\   \ #

E"   p" , \ q

E,   p, , " , \ q

E.   p. , , , " , \ q

Lagrange
interpolating
polynomial

0  #  ^ t  # #
where,

_\
0

t  #  u
N_\
Nv

 N
 N

Page 4 of 8

]  ^T Td#,

n^ T
R
P
P
^ " T
m
Q
P^  T P
,
l
O

For third order:

where

] ]=
]

1,
  \ # " #
 .# r#
, #
6
or

1,
  \ # " #
, #p3 , 2 , 1 , 0 q

COEB223/MATB324 Semester 1 2011/12

Part 6: Numerical Differentiation and Integration


A. Numerical Differentiation
Method
Forward finitedivided difference

Formulation
 %  # 
 %  # 

Backward finitedivided difference

 !, # $ 4 !" # 3 #


2(

  #  B" #
(

First Derivative:
 %  # 
 %  # 

Centred finitedivided difference

  !" #  #
(

First Derivative:

3 # 4 B" # $  B, #


2(

  !" #  B" #


 #
2(

First Derivative
%

 %  # 

 !, # $ 8 !" # 8 B" # $  B, #


12(

B. Numerical Integration
Method
Trapezoidal rule

Multiple-application
trapezoidal rule

y z E
#

 
# $  E #
2

Formulation

E
#
{\ # $ 2 ^  # $  0 #|
yz
2
0B"
_"

Page 5 of 8

Errors
7(#
7(, #
7(#
7(, #
7(, #
7(h #

COEB223/MATB324 Semester 1 2011/12

Simpsons 1/3 rule

Multiple-application
Simpsons 1/3 rule

Simpsons 3/8 rule

Gauss Quadrature
Gauss-Legendre

y z E
#

\ # $ 4" # $ , #


6

E
#
yz
}\ # $ 4 ^  # $ 2
3
0B"

_",.,~,

y z E
#

0B,

N_,,h,,

\ # $ 3" # $ 3, # $ . #


8

y z S\  \ # $ S" " # $ / $ S0B"  0B" #


S\  1.0000000

For two-point Gauss-Legendre:

S"  1.0000000

\  0.577350269
"  0.577350269
S\  0.5555556

For three-point Gauss-Legendre:

S"  0.8888889
S,  0.5555556

\  0.774596669
"  0.0

,  0.774596669

Change of variables:



Page 6 of 8

E $
# $ E
# [
2
E

K 
K[
2

N $ 0 #

COEB223/MATB324 Semester 1 2011/12

Part 7: Ordinary Differential Equations


Method
Eulers First-Order RK

Heuns Second Order RK

T !"  T $ " (

Formulation

1
1
T !"  T $ " $ , (
2
2
"    , T #

,   $ (, T $ " (#

Midpoint Second Order RK

Ralstons Second Order RK

T !"  T $ , (

"    , T #
1
1
,    $ (, T $ " (
2
2

1
2
T !"  T $ " $ , (
3
3
"    , T #

3
3
,    $ (, T $ " (
4
4

Classical Fourth Order RK

1
 $ 2, $ 2. $ h #(
6 "
"    , T #

T !"  T $

1
1
,    $ (, T $ " (
2
2
1
1
.    $ (, T $ , (
2
2
h   $ (, T $ . (#

Page 7 of 8

COEB223/MATB324 Semester 1 2011/12

Part 8: Partial Differential Equations


Method
Elliptic PDEs
Liebmanns Method

Parabolic PDEs (one


dimensional)
Explicit Method

Simple Implicit Method

Crank-Nicolson Method

Formulation
,N 

!",N $ B",N $ ,N!" $ ,NB"


4

>!"  > $ Y >!" 2 > $ >B"


Y


 #,

>!"
>
Y >!"
Y >!"
B" $ 1 $ 2Y #
!" 

Y


 #,

>!"
Y >!"
Y >!"
B" $ 21 $ Y #
!"
 Y >B" $ 21 Y# > $ Y >!"

Y


 #,

Page 8 of 8

Potrebbero piacerti anche