Sei sulla pagina 1di 3

Root Finding:

x

R

E

MAX

 

f

(

x

U

)(

x

U

x

L

)

x

U

f

(

x

U

)

f

(

x

L

 

)

x

i

x

0

2

N

N log

2

x

0

E

MAX

1

x

i

f

(

x

i

)(

x

i

1

x

i

)

f

(

x

i

1

)

f

(

x

i

)

x

i

0

/

E

MAX

)

x

i

1

log 2

1

log( x

x

i

x

 

f

(

x

i

)

 
 

i

f

(

x

i

)

 

x

i

f

(

x

i

)

 

f

(

x

i

x

i

)

f

(

x

i

)

N = estimate number (first is estimate 1), estimate N involves N-1 function evaluations/wall movements

Finding a Minimum:

X

2

X

U

d

, X

1

X

L

d

,

d

(

1)(

X

U

X

L

),

1  5
1
5

2

1.6180339887 E

MAX

x

0 (

1)

N

2

max error assumes midpoint of interval chosen as the final answer, N = number of wall movements

x

x

2

1

x

2

x

1

2

f

(

x

2

)

f

(

x

3

)

x

2

x

3

2

f

(

x

2

)

f

(

x

1

)

2

x

2

x

1

f

(

x

2

)

f

(

x

3

)

x

2

x

3

f

(

x

2

)

f

(

x

1

)

 

Simultaneous Equations:

x 1 = low, x 2 = interior, x 3 = high

row

Ax

Ax

row

b

(

element

_

b

 

Ld

LU

b

 

below

b

_

pivot

and

Ux

Pb

/

LUx

b

P

1

LUx

pivot

d

Ld

)*

Pb

pivot

d

and

_

L

Ux

\

row

,

x

b

d

Iterative methods:

x

k

1

Cx

k

d

c

ii

0

c

ij



a

ij

/ a

ii

d

i

Lagrange Polynomial:

p

(

x

)

L

1

(

x

)

y

1

L

2

(

x

)

y

2

L

3

(

x

)

y

3

L

N

(

x

)

y

N

L

(

x

)

(

x

x

1

)(

x

x

2

)

(

x

x

k

1

)(

x

x

k

1

)

(

x

x

N

)

 

k

(

x

k

x

1

)(

x

k

x

2

)

(

x

k

x

k

1

)(

x

k

x

k

1

)

(

x

k

x

N

)

U

\

d

d

b / a

i

ii

L

\ (

P

*

b

),

x

U

\

d

Numerator of L k (x) is product of all (x x i ) except for (x x k ) Denominator of L k (x) is product of all (x k x i ) except for (x k x k )

Newton's Polynomial:

p

(

a 1

x

Dy

i

)

a

1

a

2

(

x

x

1

y

1

y

i

a

1

2

y

Dy

i

x

i

1

x

i

1

D

2

)

a

y

a

3

(

x

x

1

)(

x

x

2

)

a

N (

x

x

1

)

(

x

3

i

D

2

y

1

Dy

i

1

a

Dy

i

x

i

2

x

i

N

D

k

D

y

i

N

1

y

D

1

k

1

y

i

1

D

k

1

y

i

x

i

k

x

i

x

N

1

)

Regression:         b  n  x y i i 

Regression:

 
   

b

n

x y

i

i

 

x

i

y

i

b

 

2

 

x

i

y

i

 

x

i

x y

i

i

Straight line fit:

2

S

t

S

r

y

mx

 

m

2

n

x

i

2

x

(

i

2

2

 

n

x

i

2

x

i

2

r

S

t

S

t

(

y

i

y

)

S

r

(

y

i

f

x

i

))

For a straight line fit only:

r

 

n

x y

i

i

 

x

i

y

i

n  x i 2    x i  2 n  y

n

x

i

2

x

i

2

n  x i 2    x i  2 n  y i

n

y

i

2

y

i

2

 

For

For

y

y

For y

e

x

x

x



x



x

y



log( )

x

ln(

y

y



x

x 

1

y



)

log(

y

1

)

e

b

,

m

b

10 ,

1/

b

m

/

b

m

 

x

 

x

y

,

General least squares :

 

y

a z

1

1

(

x

)

a

2

z

2

(

x

)

a z

3

3

(

x

)

a

m

z

m

(

x

)

Basic solution :

z

ij

z

j

(

x

i

)

Z

T

Za

Z

T

y

QR decomposition :

Z

QR

Ra

Q

T

y

 

Integration:

 

I

h

2

f

(

x

0

)

f

(

x

1

)

 

I

h

2

f

(

x

0

)

2

f

(

x

1

)

2

f

(

x

2

)

2

f

(

x

3

)

2

f

(

x

N

1

)

f

(

I

h

3

f

(

x

0

)

4

f

(

x

1

)

f

(

x

2

)

I

h

3

f

(

x

0

)

4

f

(

x

1

)

2

f

(

x

2

)

4

f

(

x

3

)

2

f

(

x

4

)

I

I

3

h

8

f

(

x

0

)

3

f

(

x

1

)

h

3

f

(

x

2

)

f

(

x

3

)

h 1 I

I

4

k

1

j

1,

k

1

I

,

j k

1

I  I 1, k 2, k  1   I 1, k
I
 I
1,
k
2,
k 
1
I 1, k
 
 

j

,1

estimate using

 

j

h

j

2 j 1

j , k

   

4

k 1

1

 

 

y

mx

x

N

)

4

f

(

x

N

1

)

f

(

x

N

)

n

c

0

x

0

c

1

x

1

c

2

x

2

c

3

x

3

2

1

-0.57735

1

0.57735

       

3

5/9

-0.77459

8/9

0

5/9

0.77459

   

4

0.347855

-0.861136

0.652145

-0.339981

0.652145

0.339981

0.347855

0.861136

Directly usable only for -1 to 1.

Differentiation:

For a to b use

b

a

f

(

x

)

dx    b

a

2

n

1

i

0

c

i

f   b

a

2

b

a

2

x

i

   

 

First Derivative

       

Formula

     

Error

 

Forward (2 point)

       

f x

(

i

1

)

f

(

x

i

h

) /

     

O(h)

 

Forward (3 point)

       

f

(

x

i

2

)

4

f

(

x

i

1

)

3

f

(

x

i

) / 2

h

     

O(h 2 )

 

Backwards (2 point)

     

f x

(

i

)

f

(

x

i 1

h

) /

     

O(h)

 

Backwards (3 point)

     

f

3

(

x

i

)

4

f

(

x

i

1

)

f

(

x

i

2

) / 2

h

   

O(h 2 )

 

Central (2 point)

       

f x

(

i

1

)

f

(

x

i

1

) / 2

h

     

O(h 2 )

 

Central (4 point)

       

f

(

x

i

2

)

8

f

(

x

i

1

)

8

f

(

x

i

1

)

f

(

x

i

2

) /12

h

     

O(h 4 )

 

h

4

k

1

D

j

1,

k

1

D

j k

1

D  D 1, k 2, k  1   D 1, k
D
D
1,
k
2,
k 
1
D
1, k
 

D

 

estimate using

h

j

 

h

1

D

   

,

j

,1

j

2

j 1

,

j k

 

4

k

1

1

 
     

 

ODE's:

   

dy

f

(

t

y

)

y

 

y

h

Euler :

f

(

t

 

y

)

Midpoint :

f

(

t

 

y

)

dt

 

,

 

i

1

i

i

,

i

 

i

1/2

,

i

1/2

Heun :

0

 

 

f

(

t

 

)

h

 

j 1

i

y

 

f

(

t

i

,

y

i

)

f

(

t

i 1

,

y

j 1

i

1

)

h

 

y

i

1

y

 

,

y

 

y

 
 

i

i

i

i

2

no iteration

 

y

i

1

y

1 with iteration

i 1

y

i

1

y

m

i

1

m  1 y m y  i  1 i  1 m y
m  1
y
m y
i  1
i
 1
m
y
i
 1

 

A

 

d

2

y

2

B

dy

 

Cy

D

 

 

dy

y ,

dy

D

By 

Cy

dt

dt

dt

dt

   

A