Presentation is loading. Please wait.

Presentation is loading. Please wait.

Case Study #1 Finding Roots of Equations ~ CE402 Numerical Methods for Engineers Dr. Fritz Fiedler ~ Andy Abrams David Crosby Zack Munstermann.

Similar presentations


Presentation on theme: "Case Study #1 Finding Roots of Equations ~ CE402 Numerical Methods for Engineers Dr. Fritz Fiedler ~ Andy Abrams David Crosby Zack Munstermann."— Presentation transcript:

1 Case Study #1 Finding Roots of Equations ~ CE402 Numerical Methods for Engineers Dr. Fritz Fiedler ~ Andy Abrams David Crosby Zack Munstermann

2 Introduction Why find roots of equations? Why find roots of equations? Equations are used to model physical systems Equations are used to model physical systems Knowing the roots of these equations helps us understand the physical system Knowing the roots of these equations helps us understand the physical system How do we find the roots? How do we find the roots? Analytically Analytically Numerically Numerically

3 Graphing Graphing the equation over a useful range can identify several points of interest Graphing the equation over a useful range can identify several points of interest Rough estimate of the roots Rough estimate of the roots Continuity Continuity Local minima and maxima Local minima and maxima Graphing is simple, yet rough Graphing is simple, yet rough It is often used to define functions for initial guesses in other methods. It is often used to define functions for initial guesses in other methods.

4 Bisection Method The bisection method is a “bracketing method” The bisection method is a “bracketing method” Initial guesses must surround the root. Initial guesses must surround the root. Function must be continuous near the root Function must be continuous near the root Bracketing values Xu and Xl are chosen Bracketing values Xu and Xl are chosen New root estimated by Xr = (Xl + Xu)/2 New root estimated by Xr = (Xl + Xu)/2 If f(Xr)f(Xl) < 0 then Xr = Xu…continue… If f(Xr)f(Xl) < 0 then Xr = Xu…continue… If f(Xr)f(Xl) > 0 then Xr = Xl…continue… If f(Xr)f(Xl) > 0 then Xr = Xl…continue…

5 Bisection Method: continued Bracketing values Xu and Xl are chosen Bracketing values Xu and Xl are chosen New root estimated by Xr = (Xl + Xu)/2 New root estimated by Xr = (Xl + Xu)/2 If f(Xr)f(Xl) < 0 then Xr = Xu…continue… If f(Xr)f(Xl) < 0 then Xr = Xu…continue… If f(Xr)f(Xl) > 0 then Xr = Xl…continue… If f(Xr)f(Xl) > 0 then Xr = Xl…continue… If f(Xr)f(Xl) = 0 then Xr = root…stop. If f(Xr)f(Xl) = 0 then Xr = root…stop. Limitations of the bisection method Limitations of the bisection method Relatively inefficient Relatively inefficient Must know equation well Must know equation well

6 Newton Raphson Method The Newton-Raphson method is an “open method” The Newton-Raphson method is an “open method” Need only one initial guess Need only one initial guess Must know derivative of function Must know derivative of function Initial guess of root Xi is chosen Initial guess of root Xi is chosen New root estimated by Xr = Xi – f(Xi)/f’(Xi) New root estimated by Xr = Xi – f(Xi)/f’(Xi) If error of Xr is acceptable, stop. If error of Xr is acceptable, stop. If error is too large, Xi = Xr…continue… If error is too large, Xi = Xr…continue…

7 Newton-Raphson Method: continued Constraints on N.R. Constraints on N.R. Good initial guess (convergence) Good initial guess (convergence) Derivative must be easily evaluated Derivative must be easily evaluated Derivative must be continuous and non-zero near root Derivative must be continuous and non-zero near root Problems from inflection points and local extremes near root Problems from inflection points and local extremes near root

8 Example To compare these methods we will consider water flowing in a rectangular open channel To compare these methods we will consider water flowing in a rectangular open channel Flow governed by Manning’s equation Flow governed by Manning’s equation Where: Q = volumetric flow rate (m3/s) B = channel width (m) B = channel width (m) H = height of water in channel (m) H = height of water in channel (m) n = Manning’s coefficient of roughness n = Manning’s coefficient of roughness R = hydraulic radius (m) R = hydraulic radius (m) S = channel slope S = channel slope

9 Example: continued In the design of this channel, we wish to find depth of flow and flow velocity for a range of channel widths In the design of this channel, we wish to find depth of flow and flow velocity for a range of channel widths V = Q/(BH) First we graphed the equation for a given set of parameters First we graphed the equation for a given set of parameters Used bisection and N.R. to solve for depth of flow for a range of channel widths Used bisection and N.R. to solve for depth of flow for a range of channel widths

10 Example: continued Graphing: S = 0.0002 B = 20 m n = 0.03 Q = 100 m3/s Range: 4< H < 5 Root in this case (by inspection) is approximately 4.82 m

11 Example: continued Bisection method: S = 0.0002 n = 0.03 Q = 100 m3/s Range: 5m < B < 35m

12 Example: continued Newton-Raphson: S = 0.0002 n = 0.03 Q = 100 m3/s Range: 5m < B < 35m

13 Conclusions Results of the two methods being relatively the same shows that they are convergent on the real solution Results of the two methods being relatively the same shows that they are convergent on the real solution Differences between the two Differences between the two N.R. much more efficient (4:1 iterations) N.R. much more efficient (4:1 iterations) N.R. more accurate in this case N.R. more accurate in this case N.R. easier to program N.R. easier to program

14 Questions?


Download ppt "Case Study #1 Finding Roots of Equations ~ CE402 Numerical Methods for Engineers Dr. Fritz Fiedler ~ Andy Abrams David Crosby Zack Munstermann."

Similar presentations


Ads by Google