KKKM3043: PENGIRAAN BERANGKA (NUMERICAL COMPUTATIONS) ROOTS OF EQUATIONS Dr. Nashrah Hani Jamadon Motivation • Remember that in order to solve ! 𝑓 𝑥 = 𝑎𝑥 + 𝑏𝑥 + 𝑐 = 0, You need to use the quadratic formula? −𝑏 ± 𝑏 ! − 4𝑎𝑐 𝑥= 2𝑎 𝑥 = roots How about ! a𝑥 + " 𝑏𝑥 + # 𝑐𝑥 + $ 𝑑𝑥 + 𝑒𝑥 + 𝑓 = 0 sin 𝑥 + 𝑥 = 0 Þ𝑥 =? Þ𝑥 =? NON-COMPUTER METHODS TO DETERMINE ROOTS •When it crosses the x-axis, such value represents the x (the root) value when ƒ(x) =0 •Although graphical method is useful in obtaining rough estimation values of roots, it is still limited due to lack of precision NON-COMPUTER METHODS TO DETERMINE ROOTS • Solution? Use trial and error method • This technique consists of guessing a value of x and evaluate whether ƒ(x) is zero. If it is not, repeat the step again • If not (as is almost always the case), another guess is made • The process is repeated until a guess is obtained that results in an f(x) that is close to zero ROOTS OF EQUATIONS AND ENGINEERING PRACTICE Dependent variable = ƒ (independent variable, parameters, forcing functions) Fundamental practise Energy balance Newton’s laws of motion Heat balance Mass balance Force balance Dependent variable Independent variable Parameters Changes in the kinetic and potential-energy states of system Time & position Thermal properties, mass of material & system geometry Time & position Mass of material, system geometry, drag coefficient, etc Time & position Thermal properties of material and geometry of system Time & position Chemical behavior of material, mass transfer coefficient, geometry of system Time & position Strength of material, structural properties, geometry of system Acceleration, velocity or location Temperature Concentration or quantity of mass Magnitude & direction of forces Roots of equations by BRACKETING METHODS •Two initial guesses for the root are required •The guesses must be in ‘bracket’ or be on either side of the root METHODS IN BRACKETING METHODS 1) GRAPHICAL 2) BISECTION 3) FALSE-POSITION st 1 method: GRAPHICAL METHOD • A simple method to estimate the root of equation ƒ(x) = 0, is to make a plot of the function and observe where it crosses the x-axis Example: By using the graphical method, determine the drag coefficient, c needed for a parachutist with the mass of 68.1 kg to have a velocity of 40 m/s after a free-falling at time of 10 s. Take note the acceleration due to gravity is 9.81 m/s2 Solution: Use the formula: f(c) = !" # 1−𝑒 $ ! " % − v (Eq.1) Make a table with different values of drag coefficient, c that give you different values of ƒ(c). c ƒ(c) For example; 4 34.190 8 17.712 12 6.114 16 -2.230 20 -8.368 What we know: the c-axis between values of 12 • Crosses and 16 using a graph paper, the root may be • By estimated to be 14.75 the true root value is 14.8011 • However, (when f(c) = 0) order to estimate the validity of this • In estimated root, insert into Eq.1: 𝑔𝑚 % f(c) = 1−𝑒 𝑐 & ( ' −v 𝑔𝑚 f(c) = 1 − 𝑒! 𝑐 9.81 68.1 f 14.75 = 14.75 9.81 68.1 v= 14.75 1− 1− " # $ −v %&.() ! *+.% %, 𝑒 %&.() ! *+.% %, 𝑒 − 40 = 0.10 = 40.1 m/s Estimation value The answer (if the estimated root, c=14.75), the final difference is 0.100 (v = 40.1 – 40.0) which is close to zero (0) • Graphical method is somehow a limited practise due to such method is not that precise • However, this method is still reliable to predict rough values of roots • There are various forms of graphs. Therefore, the location of roots may varies. GRAPHICAL METHOD (roots) Example 5.2 𝑓 𝑥 = sin 10𝑥 + cos 3𝑥 Compute with excel