KMU255Programming_8thClass_IterationJacobiParachutist

KMU255Programming_8thClass_IterationJacobiParachutist - KMU...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
KMU 255 Computer Programming Hacettepe University Department of Chemical Engineering Fall Semester Iterating methods Selis Önel, PhD
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Review of iteration Various iterative techniques to solve equations Jacobi iteration Least squares method What are we going to learn today?
Background image of page 2
1. Initial guess values are used to calculate new guess values 2. New estimates of x are calculated 3. Iteration continues until convergence is satisfied, i.e. f(x) < ε ε : convergence criteria (tolerance) 3 Selis Önel, PhD A x = y Solution by Iteration: Convergence Start Read x0 ( ) 0 f x x x  x End x x0=x
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Jacobi (Simple) Iteration (1) a 1,1 x 1 + a 1,2 x 2 + …+ a 1,n x n = y 1 (2) a 2,1 x 1 + a 2,2 x 2 + …+ a 2,n x n = y 2 .. (n) a n,1 x 1 + a n,2 x 2 + …+ a n,n x n = y n , , , 11 , 1 , , , where 1,2,. .., . Extracting yields 1 Solving for gives: 1 Consequently, the iterative scheme should be nn i j j i i i i i i j j i jj ji n i i i i j j j ii i a x y i n x a x a x y x x y a x a x a       , 1 n i i j j j y a x Selis Önel, PhD 4
Background image of page 4
Jacobi (Simple) Iteration Cycle 1. Choose a starting vector x0 (Initial guesses) 2. If a good guess for solution is not available, choose x randomly 3. Use with x j =x0 to recompute each value of x 4. Check if |x-x0|<ε (tolerance), if so x=x0 5. If |x-x0|>ε, assign new values to x0 6. Repeat this cycle until changes in x between successive iteration cycles become sufficiently small, i.e, |x-x0|<ε , 1 , 1 n i i i j j j ii ji x y a x a     5 Selis Önel, PhD
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

KMU255Programming_8thClass_IterationJacobiParachutist - KMU...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online