2023CH11150 2023CH11150 [π] π₯ [π] 3 π₯ [π] π₯ [π+1] =0.5*(π₯ [π] + 3 π₯ [π] ) 0 0.1 30 15.08 1 15.05 0.199 7.6247 2 7.6247 0.393 4.009 3 4.009 0.748 2.3787 4 2.3787 1.2612 1.81997 5 1.8199 1.6484 1.73205 6 1.7341 1.72993 1.73205 7 1.73205 1.732049 1.73205 8 1.73205 1.73205 1.73205 9 1.73205 1.73205 1.73205 S1/2 35 30 25 x(i) 20 3/x(i) 15 S 1/2 10 5 0 0 -5 2 4 6 iterations 8 10 (1) et =2.718282 Terms Result πΊπ (πππ%) 1 1 πΊπ (πππ%) 63.21205588 2 2 26.42411177 50 3 2.5 8.030139707 20 4 2.666666667 1.898815688 6.25 5 2.708333333 0.365984683 1.538461538 6 2.716666667 0.059418482 0.306748466 7 2.718055556 0.008324115 0.05109862 8 2.718253968 0.00102492 0.00729927 2023CH11150 128 Smallest Positive Number 1 2023CH11150 2023CH11150 2023CH11150 2023CH11150 2023CH11150 Bisection Method Itn x^l x^r f(x)=xe^x/3 x^l=1 f^l x^(i+1)=0. 5(x^l+x^r)f^(i+1) f^r x^r=2 tol=1*10-4 f^l f^(i+1) |xlx(i+1)| Regula-Falsi Method Itn x^l x^r f(x)=x-e^x/3 x^l=1 f^l x^(i+1)=x^l-f^l*(x^r-x^l)/(f^r-f^l) f^(i+1) f^r x^r=2 tol=1*10-4 f^l f^(i+1) |xl-x(i+1)| Secant Method Itn x^(i-1) x^i f(x)=x-e^x/3 x^(i-1)=1 x^i=2 tol=1*10-4 f^(i-1) x^(i+1)=x^i-f^i*(x^ix^i-1)/(f^i-f^i-1) f^(i+1) |x(i)-x(i+1)| f^i FPI f1=Exp(x)/3 itn x(i) g(x(i)) f(2)=ln(3x) abs(x(i+1)-x(i)) itn x(i) ln(3x(i)) ABS(x(i)-x(i+1)) NR i x(i) f(i) f'(i) x(i+1) abs(x(i+1)-x(i)) NUMERICAL METHODS IN CHEMICAL ENGINEERING CLL-­β113 Solution of non-­βLinear Equations NR/Multivariable case Prof. Jaya* Sarkar Problem Areas: Newton Raphson Method f (x ) i x i+1 i =x − f "( x ) i 0.2 0.1 0 -­β0.1 0 0.5 f(x) -­β0.2 itera*on Number 1.5 2 2.5 x -­β0.3 -­β0.4 tol 1*10^-­β4 Error=|x^i+1-­β x^t| x^i f(x^i) f`(x^i) x^i+1 0 1.1 0.098611325 -­β0.001388675 72.11110792 70.59897337 1 72.11110792 -­β6.92365E+30 -­β6.92365E+30 71.11110792 69.59897337 2 71.11110792 -­β2.54707E+30 -­β2.54707E+30 70.11110792 68.59897337 3 70.11110792 -­β9.37014E+29 -­β9.37014E+29 69.11110792 67.59897337 4 69.11110792 -­β3.44708E+29 -­β3.44708E+29 68.11110792 66.59897337 5 68.11110792 -­β1.26811E+29 -­β1.26811E+29 67.11110792 65.59897337 -­β0.5 100 Errortrue(i+1) Newton Raphson Itera*on Method f(x)=x-­βe^x/ 3 f`(x)=1-­βe^x/3 1 itera*on no. 10 1 0 2 4 6 Problem Areas: Newton Raphson Method f ( x) = 0 x (i+1) = x (i ) − f ( x (i ) ) f " ( x (i ) ) if f ! ( x (i) ) = 0 Newton Raphson Method: Poor Convergence Loop and Divergence Oscilla;on around Minima or Maxima An ini;al guess near one root lands near a loca;on several roots away 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 f(i) 0.5 51.65 46.485 41.8365 37.65285 33.887565 30.4988085 27.44892765 24.70403489 22.2336314 20.01026826 18.00924143 16.20831729 14.58748556 13.128737 11.8158633 10.63427697 9.570849276 8.613764348 7.752387914 6.977149123 6.279434214 5.651490799 5.086341736 4.577707606 4.119936959 3.707943555 3.337149955 3.003436907 2.703098245 2.4328014 2.189554759 1.97068574 1.773840237 1.597031348 1.438807931 1.298711343 1.178354716 1.083349754 1.023664661 1.002316024 f`(i) -­β0.999023438 1.35115E+17 4.71117E+16 1.64268E+16 5.72768E+15 1.99712E+15 6.96352E+14 2.42803E+14 8.46601E+13 2.95192E+13 1.02927E+13 3.58884E+12 1.25135E+12 4.36319E+11 1.52135E+11 53046236849 18496079117 6449184014 2248691422 784070216.9 273388379.9 95324633.58 33237644.28 11589249.7 4040921.242 1408981.851 491281.3301 171298.9439 59727.98466 20825.59662 7261.172653 2531.55048 882.4332477 307.4217666 106.9280696 37.02141119 12.64980151 4.161315905 1.226829103 0.263505419 0.023403117 x(i+1)= 0.01953125 2.61597E+16 1.01348E+16 3.92643E+15 1.52118E+15 5.89336E+14 2.28321E+14 8.84562E+13 3.42698E+13 1.32768E+13 5.14371E+12 1.99278E+12 7.72043E+11 2.99105E+11 1.15879E+11 44894084748 17392888267 6738361278 2610579222 1011391879 391833936.9 151804496 58812172.68 22785041.39 8827392.637 3419913.618 1324945.547 513312.0965 198868.7844 77047.13161 29851.07068 11566.50899 4482.872281 1738.723478 675.8043276 264.2563358 105.1026588 43.80103747 20.55503401 12.34296217 10.21038368 Error 51.65 46.485 41.8365 37.65285 33.887565 30.4988085 27.44892765 24.70403489 22.2336314 20.01026826 18.00924143 16.20831729 14.58748556 13.128737 11.8158633 10.63427697 9.570849276 8.613764348 7.752387914 6.977149123 6.279434214 5.651490799 5.086341736 4.577707606 4.119936959 3.707943555 3.337149955 3.003436907 2.703098245 2.4328014 2.189554759 1.97068574 1.773840237 1.597031348 1.438807931 1.298711343 1.178354716 1.083349754 1.023664661 1.002316024 1.000023934 51.15 5.165 4.6485 4.18365 3.765285 3.3887565 3.04988085 2.744892765 2.470403488 2.22336314 2.001026826 1.800924143 1.620831729 1.458748556 1.3128737 1.18158633 1.063427697 0.957084927 0.861376434 0.77523879 0.69771491 0.627943415 0.565149063 0.50863413 0.457770647 0.411993403 0.370793601 0.333713047 0.300338662 0.270296845 0.24324664 0.218869019 0.196845503 0.176808889 0.158223417 0.140096589 0.120356627 0.095004962 0.059685092 0.021348637 0.00229209 f ( x ) = x10 −1 = 0 48 38 f(x) x(i) 28 18 8 -­β2 0 0.5 1 1.5 2 x 100 10 1 Error itn no 0 0.1 0.01 0.001 0.0001 0.00001 10 20 30 40 50 itn Improvements x (i+1) = x (i ) − f ( x (i ) ) f " ( x (i ) ) + β x (i+1) = x (i) − m f ( x (i) ) f " ( x (i) ) Improvements x (i+1) = x (i ) − f ( x (i ) ) f " ( x (i ) ) + β x (i+1) = x (i) − m f ( x (i) ) f " ( x (i) ) f ( x) =0 f !( x) f ( x) = 0 Improvements Both have the same solu;on x 1. Modiο¬ed Equa;on to solve: Objec;ve is to ο¬nd the root of u(x)=0 f ( x) u ( x) = =0 f !( x) x (i+1) = x (i) − = = 2. Modiο¬ed Equa;on to solve: x (i) − x (i) − u ( x (i) ) u" ( x (i) ) f ( x (i) ) / f " ( x (i) ) 2 # f " ( x (i) ) f " ( x (i) ) − f ( x (i) ) f "" ( x (i) )% / # f " ( x (i) )% $ & $ & f ( x (i) ) f " ( x (i) ) # f " ( x (i) ) f " ( x (i) ) − f ( x (i) ) f "" ( x (i) )% $ & F ( x) = f 2 ( x) = 0 fn ( x1, x2 , x3 .......xn ) = 0 E (j i+1) = x (j i+1) − x (j ) i E1( 100 ) = 0.01 E2( = 0.02 E3( = 0.002 100 ) tol 100 ) ∂g1 ∂g1 ∂g1 i (i ) (i ) g1 ( x ) = g1 ( x ) + |x ( i ) x1 − x1 + |x ( i ) x2 − x2 +.... + |x ( i ) xn − xn( ) ∂x1 ∂x2 ∂xn ( (i ) t 1 (i+1) 1 x =x E1( i+1) ( ) ( ) ∂g1 ∂g1 ∂g1 i (i ) (i ) t t + |x ( i ) x1 − x1 + |x ( i ) x2 − x2 +.... + |x ( i ) xnt − xn( ) ∂x1 ∂x2 ∂xn ( = ) ( ) ( ∂g1 ∂g1 ∂g1 i i i |x ( i ) E1( ) + |x ( i ) E2( ) +.... + |x ( i ) En( ) ∂x1 ∂x2 ∂xn ) ) (i+1) Ej ∂g j ∂g j ∂g j i (i ) (i ) = |x ( i ) E1 + |x ( i ) E2 +.... + |x ( i ) En( ) ∂x1 ∂x2 ∂xn " ∂g j ∂g j ∂g j % + +... + $ ' |x ( i ) ≤ 1 ∂x2 ∂xn & # ∂x1 for j=1 to n Very Stringent Condi;on Newton Raphson Method: Multivariable f j ( x) = 0 x⇒x (i) ∂f j ∂f j ∂f j i+1 i (i+1) (i ) (i+1) (i ) fj x = fj x + |x ( i ) x1 − x1 + |x ( i ) x2 − x2 +..... + |x ( i ) xn( ) − xn( ) ∂x1 ∂x2 ∂xn 0 "Δx (i+1) % $ 1 ' In Matrix form: $Δx2(i+1) ' # x (i+1) − x (i) & $ ' 1 1 !' % ( $ % (i+1) i) ( ( $Δx (i+1) ' # & x − x ∂f ∂f ∂f # n & (i) 2 2 ( j j j % − fj x = % ....... ( |x ( i ) % ( ∂xn ' $ ∂x1 ∂x2 ! % ( % x (i+1) − x (i) ( n ' $ n ( (i+1) ) ( ) (i) ( ( ) ) ( ( ) ( ( ) ) ( ) for j=1 to n ) Jacobian Matrix (J) x Improvements x (i+1) x (i+1) = = x x (i) (i) (i+1) = x (i) ( ) − J −1 f x −1 T % (i) " T − $( J J ) J ' f x # & ( ) −1 T % (i) " T − $( J J + β I ) J ' f x # & ( ) (i) if Singular NUMERICAL METHODS IN CHEMICAL ENGINEERING CLL-­β113 Solution of non-­βLinear Equations Root Finding of Polynomials Prof. Jaya* Sarkar Roots of Polynomial -­β4 -­β2 0 5 20 0 15 5 -­β4 10 0 -­β5 2 x 0 -­β4 -­β2 -­β5 0 2 x -­β10 3 f (x) = x − 7x + 6 = ( x −1) ( x − 2 ) ( x + 3) = 0 x = 1, 2, −3 Real Unique Roots 3 -­β2 -­β5 0 2 -­β10 5 4 f(x) 25 10 10 f(x) 30 f(x) 15 2 f (x) = x + x − 5x + 3 2 4 x -­β15 4 -­β20 -­β25 f (x) = x 3 − 3x 2 + x − 3 = ( x −1) ( x + 3) = 0 = ( x 2 +1) ( x − 3) = 0 x = 1,1, −3 Repeated Roots x = −i, i, 3 Complex Roots Roots of Polynomial: Newton Raphson Method P3 (x) = x 3 − 7x + 6 = ( x −1) ( x − 2 ) ( x + 3) = ( x −1) P2 (x) P3(x) 15 itn 1 2 3 4 10 x(i) 0 0.857142857 0.988449848 0.999902397 -­β5 20 0 2 4 x 15 itn 10 5 -­β10 -­β5 0 x -­β5 0 5 x(i) f(x) f`(x) 1 1 "4 3 2.33333333 1.33333333 2 2.33333333 1.77777778 7 2.07936508 0.25396825 3 2.07936508 0.40312421 6.23809524 2.01474211 0.06462297 4 2.01474211 0.0739279 6.04422634 2.00251095 0.01223116 5 2.00251095 0.01256107 6.00753286 2.00042007 0.00209089 6 2.00042007 0.00210051 6.0012602 2.00007006 0.00035001 7 2.00007006 0.00035028 6.00021017 2.00001168 5.8378E"05 10 5 -­β10 0 -­β5 x = 1, 2, −3 Real Unique Roots x(i+1) Error P1(x) -­β2 x(i+1) Error 6 -­β7 0.857142857 0.857142857 0.629737609 -­β4.795918367 0.988449848 0.131306991 0.046599285 -­β4.068900694 0.999902397 0.011452549 0.00039044 -­β4.000585589 0.999999993 9.75957E-­β05 P2(x) -­β4 f`(x) P2 (x) = x 2 + x − 6 = (x − 2)P1 (x) 5 0 f(x) -­β5 0 x 5 P1 (x) = x + 3 Roots of Polynomial: Newton Raphson Method x i+1 i = x −m f ( xi ) f "( xi ) 2 x − (a + ib) x − (a − ib) = x − rx − s ( )( ) Deflate the polynomial by 2 Pn (x) ⇒ Pn−2 (x) ⇒ Pn−4 (x) ⇒ ......... ⇒ P2 (x) if n is Even Pn (x) ⇒ Pn−2 (x) ⇒ Pn−4 (x) ⇒ ......... ⇒ P1 (x) if n is Odd Bairstow's Method Pn ( x ) = a0 + a1 x + a2 x 2 + a3 x 3 +......... + an x n Q ( x ) = x 2 − rx − s Quadra*c Is this a factor? Pn ( x ) = Pn−2 ( x ) Q(x) + R(x) Pn−2 ( x ) = b2 + b3 x + b4 x 2 ........ + bn x n−2 R ( x ) = b0 + b1 ( x − r ) Bairstow's Method Pn ( x ) = Pn−2 ( x ) Q(x) + R(x) a0 + a1 x + a2 x 2 + a3 x 3 +......... + an x n = ( b2 + b3 x + b4 x 2 ........ + bn x n−2 ) × ( x 2 − rx − s ) + #$b0 + b1 ( x − r )%& a0 + a1 x + a2 x 2 + a3 x 3 +............. + an−2 x n−2 + an−1 x n−1 + an x n b2 x 2 + b3 x 3 + b4 x 4 ...... + bn−2 x n−2 + bn−1 x n−1 + bn x n = − b2 s − b2 rx − b3rx 2 − b4 rx 3 − b5rx 4 ..... − bn−1rx n−2 − bn rx n−1 + 0 − b3sx − b4 sx 2 − b5 sx 3 − b6 sx 4 ...... − bn sx n−2 + 0 + ( b0 − b1r ) + b1 x +0 Bairstow's Method n x : an = bn x n−1 n x n : bn = an n−1 x n−1 : bn−1 = an−1 + bn r x : bn = an : an−1 = bn−1 − bn r x : bn−1 = an−1 + bn r x n−2 : an−2 = bn−2 − bn−1r − bn s x n−2 : bn−2 = an−2 + bn−1r + bn s ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! x2 : a2 = b2 − b3r − b4 s x2 : b2 = a2 + b3r + b4 s x1 : a1 = b1 − b2 r − b3s x1 : b1 = a1 + b2 r + b3s x0 : a0 = b0 − b1r − b2 s x0 : b0 = a0 + b1r + b2 s x i : bi = ai + bi+1r + bi+2 s ......i = n - 2..to..0 Bairstow's Method R ( x ) = b0 + b1 ( x − r ) x n : bn = an x n−1 : bn−1 = an−1 + bn r b0 ( r, s ) ⇒ 0 i x : bi = ai + bi+1r + bi+2 s b1 ( r, s ) ⇒ 0 ......i = n - 2..to..0 0 ∂b1 ∂b1 b1 ( r + Δr, s + Δs ) = b1 ( r, s ) + Δr + Δs ∂r ∂s 0 ∂b0 ∂b0 b0 ( r + Δr, s + Δs ) = b0 ( r, s ) + Δr + Δs ∂r ∂s " ∂b1 $ $ ∂r $ ∂b0 $# ∂r ∂b1 % '"Δr % "−b1 ( r, s ) % ∂s ' ' $ '=$ ∂b0 '#Δs & $#−b0 ( r, s )'& ∂s '& "Δr % "−b1 ( r, s ) % ' [ M ]$ ' = $ #Δs & $#−b0 ( r, s )'& " % "Δr % −1 −b1 ( r, s ) ' $ ' = [M ] $ #Δs & $#−b0 ( r, s )'& Bairstow's Method x n : cn = bn x n−1 : cn−1 = bn−1 + cn r x i : ci = bi + ci+1r + ci+2 s ......i = n - 2..to..1 " ∂b1 $ $ ∂r $ ∂b0 $# ∂r ∂b1 % " % ' ∂s '"Δr % = $−b1 ( r, s ) ' $ ' ∂b0 '#Δs & $#−b0 ( r, s )'& ∂s '& c −b0 + 1 b1 −b1 − c3Δs c2 Δs = , Δr = c c2 c2 − 1 c3 c2 !c2 # "c1 c3 $!Δr $ !−b1 ( r, s ) $ & &# & = # c2 %"Δs % #"−b0 ( r, s )&% r (i+1) = r (i) + Δr s (i+1) = s (i) + Δs Δr ε a,r = 100% r Roots Δs ε a,s = 100% s r ± r 2 + 4s x= 2 Bairstow's Method 1. Pn-­β2 is a third order polynomial or greater. Bairstow's method is repeated for the quoEent for ο¬nding new values of r and s. 2. The quoEent is quadraEc. Roots can be evaluated 2 r ± r + 4s directly. x= 2 3. The quoEent is ο¬rst order polynomial, the remaining x = −r / s single root can be evaluated as P5 (x) = x 5 − 3.5x 4 + 2.75x 3 + 2.125x 2 − 3.875x +1.25 P5(x) a5 a4 a3 a2 1 -­β3.5 2.75 2.125 -­β3.875 a0 1.25 P5(x) 8 a1 6 4 2 0 -­β1.5 -­β1 -­β0.5 -­β2 -­β4 -­β6 -­β8 0 0.5 1 1.5 2 2.5 x 3 Real Roots: x1=-­β1, x2=0.5 x3=2 P5 (x) = x 5 − 3.5x 4 + 2.75x 3 + 2.125x 2 − 3.875x +1.25 P5(x) a5 1 a4 -­β3.5 a3 2.75 a2 2.125 a1 -­β3.875 a0 1.25 b5 = a5 b4 = a4 + b5r b3 = a3 + b4 r + b5 s b2 = a2 + b3r + b4 s itn r 1 2 3 4 5 6 s -­β1.00 -­β0.64 -­β0.51 -­β0.50 -­β0.50 -­β0.50 -­β1.00 0.14 0.47 0.50 0.50 0.50 itn c5 1 2 3 4 5 6 b4 -­β4.50 -­β4.14 -­β4.01 -­β4.00 -­β4.00 -­β4.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 dels 1.138109017 0.331624608 0.030468695 -­β0.00020233 1.03876E-­β08 -­β1.67709E-­β14 ( b5 c4 -­β5.50 -­β4.79 -­β4.52 -­β4.50 -­β4.50 -­β4.50 delr 0.35583014 0.133056764 0.011426623 -­β0.000313592 6.52645E-­β08 -­β1.08671E-­β14 2 x = −0.5 ± −0.5 + 4 × 0.5 b3 c3 10.75 8.78 8.05 8.00 8.00 8.00 b2 6.25 5.56 5.27 5.25 5.25 5.25 c2 -­β4.88 -­β8.34 -­β8.69 -­β8.75 -­β8.75 -­β8.75 Errs= 824.0656852 70.5984393 6.091274153 0.040466059 2.07753E-­β06 #DIV/0! ) 2 0.38 -­β2.03 -­β2.45 -­β2.50 -­β2.50 -­β2.50 b1 -­β10.50 -­β1.80 -­β0.15 0.00 0.00 0.00 c1 -­β16.38 4.79 8.08 8.37 8.38 8.38 Err_r 55.23855773 26.03274392 2.286758475 0.062718311 1.30529E-­β05 #DIV/0! x1 = 0.5, x2 = −1 b0 11.38 2.13 0.17 0.00 0.00 0.00 b1 = a1 + b2 r + b3s b0 = a0 + b1r + b2 s c5 = b5 c4 = b4 + c5r c3 = b3 + c4 r + c5 s c2 = b2 + c3r + c4 s c1 = b1 + c2 r + c3s c −b0 + 1 b1 −b1 − c3Δs c2 Δs = , Δr = c1 c2 c2 − c3 c2 ( x = r ± r 2 + 4s )2 2 3 b5 1.00 a3 a2 a1 a0 1 -­β4 5.25 -­β2.5 P3(x) 2 b3 5.25 b2 -­β2.50 P3(x) P3 ( x ) = b2 + b3 x + b4 x + b5 x b4 -­β4.00 0 -­β2 -­β1 -­β2 -­β4 -­β6 -­β8 -­β10 -­β12 -­β14 -­β16 -­β18 0 1 2 3 x Real Roots: x1=-­β1, x2=0.5 x3=2 P3 (x) = x 3 − 4x 2 + 5.25x − 2.5 P3 ( x ) = b2 + b3 x + b4 x 2 + b5 x 3 P3(x) itn a3 1 a2 -­β4 r s b3 1 0.00 5.00 1.00 2 24.67 93.42 3 a1 5.25 b2 a0 -­β2.5 b2 = a2 + b3r b1 b0 dels delr -­β4.00 10.25 -­β22.50 1.00 -­β4.00 88.42 24.67 3.584459459 0.264049955 1.00 20.67 608.44 16936.41 1.00 45.33 1820.08 1445.09 -­β45.30 -­β70.04163723 -­β0.029443207 -­β20.63 1538.50 1.00 -­β24.63 2051.95 -­β80234.30 1.00 -­β45.26 4524.33 -­β2283.16 -­β5.11 88.70166669 0.006859424 4 -­β25.74 -­β744.65 1.00 -­β29.74 26.09 21471.67 1.00 -­β55.48 709.46 510.76 9.68 -­β31.79737754 -­β0.041372997 c3 = b3 5 -­β16.06 -­β233.89 1.00 -­β20.06 93.64 3185.91 1.00 -­β36.13 440.05 180.68 7.59 -­β21.33269308 -­β0.142716826 c2 = b2 + c3r 6 -­β8.47 -­β53.21 1.00 -­β12.47 57.66 172.60 1.00 -­β20.94 181.80 54.93 5.38 -­β17.75781197 3.126486167 7 -­β3.09 1.72 1.00 -­β7.09 28.91 -­β104.11 1.00 -­β10.19 62.13 17.68 4.57 11.94047118 0.235791492 8 1.48 19.40 1.00 -­β2.52 20.92 -­β20.41 1.00 -­β1.04 38.77 -­β20.95 -­β0.04 -­β14.49929367 0.022664987 9 1.45 -­β1.56 1.00 -­β2.55 0.00 1.48 1.00 -­β1.11 -­β3.16 0.37 0.34 0.209251221 -­β0.284808763 10 1.78 -­β1.18 1.00 -­β2.22 0.11 0.33 1.00 -­β0.44 -­β1.85 -­β0.03 0.19 -­β0.016737978 -­β0.152346768 11 1.97 -­β1.22 1.00 -­β2.03 0.03 0.04 1.00 -­β0.06 -­β1.31 -­β0.03 0.03 -­β0.01612642 -­β0.025990154 12 2.00 -­β1.25 1.00 -­β2.00 0.00 0.00 1.00 0.00 -­β1.25 0.00 0.00 -­β0.000526834 3.52232E-­β05 13 2.00 -­β1.25 1.00 -­β2.00 0.00 0.00 1.00 0.00 -­β1.25 0.00 0.00 -­β9.69272E-­β10 -­β6.18632E-­β08 ( x = 2 ± 2 2 − 4 ×1.25 P1 ( x ) = b2 + b3 x )2 c3 b3 = a3 c2 c1 15.25 x3 = (1+ 0.5i), x4 = (1− 0.5i) x5 = −b2 b3 = 2 Errs= Err_r b1 = a1 + b2 r + b3s b0 = a0 + b1r + b2 s c1 = b1 + c2 r + c3s c −b0 + 1 b1 −b1 − c3Δs c2 Δs = , Δr = c1 c2 c2 − c3 c2 ( x = r ± r 2 + 4s )2 NUMERICAL METHODS IN CHEMICAL ENGINEERING CLL-­β113 Regression Analysis and Curve Fitting Least Square Method Prof. Jaya* Sarkar Curve Fitting üοΌ Data is given at discrete values along a continuum • Growth rate as a function of concentration: C 0.5 0.8 1.5 2.5 4 X 1.1 2.4 5.3 7.6 8.9 π(π₯) π(π₯) π(π₯) π₯ Did not attempt to connect the points but characterizes general upward trend . Curve fitting which does this is called ‘Regression’ π₯ Used straight line segments or linear interpolation to connect the points. Fails when the underlying curve is highly curve linear or data is widely placed π₯ Captures meandering suggested by data π(π₯) π(π₯) π₯ π₯ Øο When data is precise as obtained from steam tables. Øο Density ρ , viscosity η as a function of temperature. Øο Heat capacity Cp as a function of Temperature and Pressure ↓ The approach is to fit a curve that passes directly through each point. Øο Converts discrete data into analytical form such that any in between points within the range can be interpolated. Linear Regression Data: (x1,y1) (x2,y2) (x3,y3) (x4,y4) ……(xN,yN) Model: y=ao+a1 x Predicted: Inadequate Criteria Best fit line p a s s e s through two points Any straight line passing through the mid point also minimizes the error so it gets cancelled. Another criteria can be to minimize the sum of absolute values of the discrepancies 1 2 Any of the straight line lying between straight lines 1 & 2 passing through the 4 points will satisfy this, we will not end up with a UNIQUE solution. Error Minimization Criteria This gives undue advantage to a point which is an outlier with a large error. 1 x i 1 2 3 4 5 6 7 28 y i 0.5 2.5 2.0 4.0 3.5 6.0 5.5 24 a1 0.8393 x2 i x I y i ypredicted 1.00 0.50 0.91 4.00 5.00 1.75 9.00 6.00 2.59 16.00 16.00 3.43 25.00 17.50 4.27 36.00 36.00 5.11 49.00 38.50 5.95 140 119.5 a0 0.0714 7.0 6.0 5.0 y No of Data Point 1 2 3 4 5 6 7 4.0 3.0 2.0 Data 1.0 Predicted 0.0 0 2 4 x 6 8 Quantification of Error of Linear Regression Standard Variation for the Regression Line Standard Error of the Estimate Standard Derivation for the data Sy = St = N −1 ( y − y) 2 i N −1 r: Correlation Coefficient Qua*ο¬ca*on of Errors No of Data Point 1 2 3 4 5 6 7 St x i 1 2 3 4 5 6 7 28 Sr y i 0.5 2.5 2.0 4.0 3.5 6.0 5.5 24 ypredicted 0.91 1.75 2.59 3.43 4.27 5.11 5.95 24 (yi-­βybar)2 8.58 0.86 2.04 0.33 0.01 6.61 4.29 22.71 Standard Error of the Estimate (yi-­βypredicted)2 0.17 0.56 0.35 0.33 Standard Derivation for the data 0.59 2 0.80 yi − y S t 0.20 Sy = = N −1 N −1 2.99 ( r2 22.71 2.99 0.87 Sy/x Sy r 0.77 1.95 0.93 r2: Coefficient of Determination ) Least Square Method y i 0.5 2.5 2.0 4.0 3.5 6.0 5.5 24 y2 i 0.25 6.25 4.00 16.00 12.25 36.00 30.25 105 x I y i 0.50 5.00 6.00 16.00 17.50 36.00 38.50 119.5 xpredicted 0.97 3.04 2.52 4.59 4.07 6.66 6.14 y x i 1 2 3 4 5 6 7 28 b1 = n∑ xi yi − ∑ xi ∑ yi 6.5 5.5 4.5 3.5 2.5 1.5 0.5 -­β0.5 0 5.5 4.5 3.5 Data y-­βPredicted 1.5 0.5 -­β0.5 0 1 2 3 4 x 5 6 7 8 b0 = x − a1 y b1 b0 1.0346 0.4528 2 Data y-­βPredicted x-­βPredicted 6.5 2.5 ( ) n∑ y − ∑ yi 2 i y y No of Data Point 1 2 3 4 5 6 7 x = b0 + b1 y 6.5 5.5 4.5 3.5 2.5 1.5 0.5 -­β0.5 2 4 x 6 8 Data x-­βPredicted 0 2 4 x 6 8 NUMERICAL METHODS IN CHEMICAL ENGINEERING CLL-­β113 Regression Analysis and Curve Fitting Multi-­βlinear Regression Prof. Jaya* Sarkar No of Data Point 1 2 3 4 5 6 7 a1 0.8393 x i 1 2 3 4 5 6 7 28 y i x2 i y2 i x I y i ypredicted xpredicted 0.5 1.00 0.25 0.50 0.91 0.97 2.5 4.00 6.25 5.00 1.75 3.04 2.0 9.00 4.00 6.00 2.59 2.52 x = b + b y 0 1 4.0 16.00 16.00 16.00 3.43 4.59 n∑ xi yi − ∑ xi ∑ yi 3.5 25.00 12.25 17.50 4.27 4.07 b1 = 2 2 n∑ yi − (∑ yi ) 6.0 36.00 36.00 36.00 5.11 6.66 5.5 49.00 30.25 38.50 5.95 6.14 b0 = x − a1 y 24 140 105 119.5 a0 b1 b0 a0(P)=-­βb0/b1 a1(P)=1/b1 0.0714 1.0346 0.4528 -­β0.4377 0.9666 y Data y-­βPredicted x-­βPredicted 0 2 4 x 6.5 5.5 4.5 3.5 y y 6.5 5.5 4.5 3.5 2.5 1.5 0.5 -­β0.5 2.5 Data y-­βPredicted 1.5 0.5 -­β0.5 0 1 2 3 4 x 5 6 7 8 6.5 5.5 4.5 3.5 2.5 1.5 0.5 -­β0.5 6 8 Data x-­βPredicted 0 2 4 x 6 8 Pure,cemet,mortar 50/50(5 50/50(10 50/50(15 50/50(20 Pure,cemet,mortar 50/50(5 50/50(10 50/50(15 50/50(20 Polymer( Water( Compressive, Flexural, cement,ratio, cement,ratio, Strength, Strength, (x1) (x2) (MPa),(y1) (MPa)(y2) 0 0.4 50.63 7.39 5 0.4 45.31 8.59 10 0.4 35.63 9.30 15 0.4 22.21 7.30 20 0.4 27.18 6.40 0 0.5 42.40 7.11 5 0.5 27.87 7.37 10 0.5 26.30 6.90 15 0.5 29.60 6.70 20 0.5 24.27 5.10 40.00-­β60.00 20.00-­β40.00 0.00-­β20.00 60.00 Compress ive 40.00 Strength (MPa) 20.00 0.00 0 5 Flexural Strength 10.00 (MPa) 8.00-­β10.00 6.00-­β8.00 4.00-­β6.00 8.00 6.00 10 0.5 15 20 4.00 2.00 0.00 0 5 10 Polymer Cement Ra*o 0.5 15 20 Water-­β 0.4 Cement Ra*o 0.4 Solve by Gauss EliminaHon/Gauss Seidel Method = Pure cemet mortar 50/50-­β5 50/50-­β10 50/50-­β15 50/50-­β20 Pure cemet mortar 50/50-­β5 50/50-­β10 50/50-­β15 50/50-­β20 N=10 Polymer-­β cement raHo (x) 0 5 10 15 20 0 5 10 15 20 100 Water-­β Compressiv cement e Strength raHo (u) (MPa) (y) 0.4 0.4 0.4 0.4 0.4 0.5 0.5 0.5 0.5 0.5 4.5 x2 u2 xu yx yu 0 0.16 0 0 20.252 25 0.16 2 226.55 18.124 100 0.16 4 356.3 14.252 225 0.16 6 333.15 8.884 400 0.16 8 543.6 10.872 0 0.25 0 0 21.2 25 0.25 2.5 139.35 13.935 100 0.25 5 263 13.15 225 0.25 7.5 444 14.8 400 0.25 10 485.4 12.135 24.27 331.4 1500 2.05 45.00 2791.35 147.60 50.63 45.31 35.63 22.21 27.18 42.40 27.87 26.30 29.60 y = 71.1333−1.0453x − 61.200u "N $ $∑ x $ i $∑ u # i ∑ x ∑u %'"a % "$∑ y %' $ ' ∑ x x ∑u x ''$a ' = $$∑ y x '' $ ' ∑ x u ∑u u '&#a & $#∑ y u '& i i i i i i i i i i 0 1 2 i i i i i !10 100 4.5$!a0 $ !331.4 $ # &# & # & 100 1500 45 a = 2791.35 # &# 1 & # & #"4.5 45 2.05 &%#"a2 &% #"147.6 &% !a0 $ !71.1333 $ # & # & a = −1.0453 # 1& # & #"a2 &% #"−61.200 &% Actual 40.00-­β60.00 60.00 40.00 y 20.00 0.00 0 u\x 0 5 10 15 20 0.4 50.63 45.31 35.63 22.21 27.18 0.5 42.40 27.87 26.30 29.60 24.27 20.00-­β40.00 0.00-­β20.00 5 10 Predicted 0.5 u x 15 20 u\x 0.4 0.5 0 5 10 15 20 46.65 41.43 36.20 30.97 25.75 40.53 35.31 30.08 24.85 19.63 y = 71.1333−1.0453x − 61.200u 0.4 60.00 40.00 y 20.00 0.00 0 40.00-­β60.00 20.00-­β40.00 5 0.00-­β20.00 x 10 0.5 15 u 20 0.4 No of Data Point 1 2 3 4 5 6 7 a1 0.8393 x i 1 2 3 4 5 6 7 28 y i 0.5 2.5 2.0 4.0 3.5 6.0 5.5 24 a0 0.0714 !e1 $ !1 1 $ !0.5 $ # & # & # & #e2 & #1 2 & #2.5 & #e3 & #1 3 & #2.0 & # & # &!a0 $ # & #e4 & + #1 4 &#a & = # 4.0 & #e & #1 5 &" 1 % #3.5 & 5 # & # & # & #e6 & #1 6 & #6.0 & #"e &% #"1 7 &% #"5.5 &% 7 e + XΦ = Y !e1 $ # & #e2 & + #e3 & # & #! & # "e N & % Y = XΦ + e NUMERICAL METHODS IN CHEMICAL ENGINEERING CLL-­β113 Regression Analysis and Curve Fitting Functional and non-­βlinear Regression Prof. Jaya* Sarkar !e1 $ # & #e2 & + #e3 & # & #! & # "e N & % Y = XΦ + e Φ N Standard Error used Functional Regression Exponential Model Lineariza1on ln ( y) = ln (α1 ) + β1 x Y = a0 + a1 x Example: Popula1on growth, Radioac1vity Decrease, Arrhenius Law Power Law Model Lineariza1on ln ( y) = ln (α 2 ) + β2 ln ( x ) Y = a0 + a1 X n−1 Example: non-­βNewtonian ο¬uid ο¬ow µ = mγ Y = a0 + a1 X Saturation Growth Rate Lineariza1on 1 1 1 = + β3 y α3 x Y = a0 + a1 X Example: Enzyma1c kine1cs
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )