NUMERICAL METHODS COVERED IN THIS BOOK

TABLE 1.1 Devices and types of balances that are commonly used in the four major areas of engineering. For each case, the conservation law on which the balance is based is specified. Field Organizing Principle Mathematical Expression Device Force balance: Mechanical engineering Conservation of momentum Upward force Downward force x ⫽ 0 ⫽ downward force ⫺ upward force m d 2 x dt 2 Machine Current balance: Voltage balance: Around each loop ⌺ emf’s ⫺ ⌺ voltage drops for resistors ⫽ 0 ⌺ ␰ ⫺ ⌺ iR ⫽ 0 For each node ⌺ current i ⫽ 0 Electrical engineering Conservation of energy Conservation of charge ⫹i 2 ⫺i 3 ⫹i 1 i 1 R 1 i 3 R 3 i 2 R 2 ␰ ⫹ ⫺ Circuit Chemical engineering Conservation of mass Over a unit of time period ⌬mass ⫽ inputs ⫺ outputs Mass balance: Reactors Force balance: At each node ⌺ horizontal forces F H ⫽ 0 ⌺ vertical forces F V ⫽ 0 Civil engineering Conservation of momentum Structure ⫹F V ⫺F V ⫹F H ⫺F H Input Output 1.3 NUMERICAL METHODS COVERED IN THIS BOOK 15 ⌬t Slope ⫽ ft i , y i y e Part 6 : Differential equations Given solve for y as a function of t dy dt ⌬y ⫽ ⌬t ⬇ f t, y c Part 4 : Curve fitting d Part 5 : Integration and differentiation Integration: Find the area under the curve Differentiation: Find the slope of the curve Regression Interpolation a Part 2 : Roots and optimization Roots: Solve for x so that fx ⫽ 0 Optimization: Solve for x so that f x ⫽ 0 b Part 3 : Linear algebraic equations Given the a’s and the b’s, solve for the x’s a 11 x 1 ⫹ a 12 x 2 ⫽ b 1 a 21 x 1 ⫹ a 22 x 2 ⫽ b 2 Solution Roots Optima x x 1 x x x t fx x 2 fx fx y dydx I y i⫹ 1 ⫽ y i ⫹ f t i , y i ⌬t FIGURE 1.6 Summary of the numerical methods covered in this book. Part Two deals with two related topics: root finding and optimization. As depicted in Fig. 1.6a, root location involves searching for the zeros of a function. In contrast, optimiza- tion involves determining a value or values of an independent variable that correspond to a “best” or optimal value of a function. Thus, as in Fig. 1.6a, optimization involves identify- ing maxima and minima. Although somewhat different approaches are used, root location and optimization both typically arise in design contexts. Part Three is devoted to solving systems of simultaneous linear algebraic equations Fig. 1.6b. Such systems are similar in spirit to roots of equations in the sense that they are concerned with values that satisfy equations. However, in contrast to satisfying a single equation, a set of values is sought that simultaneously satisfies a set of linear algebraic equations. Such equations arise in a variety of problem contexts and in all disciplines of en- gineering and science. In particular, they originate in the mathematical modeling of large systems of interconnected elements such as structures, electric circuits, and fluid networks. However, they are also encountered in other areas of numerical methods such as curve fit- ting and differential equations. As an engineer or scientist, you will often have occasion to fit curves to data points. The techniques developed for this purpose can be divided into two general categories: regression and interpolation. As described in Part Four Fig. 1.6c, regression is employed where there is a significant degree of error associated with the data. Experi- mental results are often of this kind. For these situations, the strategy is to derive a sin- gle curve that represents the general trend of the data without necessarily matching any individual points. In contrast, interpolation is used where the objective is to determine intermediate val- ues between relatively error-free data points. Such is usually the case for tabulated infor- mation. The strategy in such cases is to fit a curve directly through the data points and use the curve to predict the intermediate values. As depicted in Fig. 1.6d, Part Five is devoted to integration and differentiation. A physical interpretation of numerical integration is the determination of the area under a curve. Integration has many applications in engineering and science, ranging from the determination of the centroids of oddly shaped objects to the calculation of total quan- tities based on sets of discrete measurements. In addition, numerical integration formu- las play an important role in the solution of differential equations. Part Five also covers methods for numerical differentiation. As you know from your study of calculus, this involves the determination of a function’s slope or its rate of change. Finally, Part Six focuses on the solution of ordinary differential equations Fig. 1.6e. Such equations are of great significance in all areas of engineering and science. This is because many physical laws are couched in terms of the rate of change of a quantity rather than the magnitude of the quantity itself. Examples range from population-forecasting models rate of change of population to the acceleration of a falling body rate of change of velocity. Two types of problems are addressed: initial-value and boundary-value problems.

1.4 CASE STUDY IT’S A REAL DRAG

1.4 CASE STUDY 17 Background. In our model of the free-falling bungee jumper, we assumed that drag depends on the square of velocity Eq. 1.7. A more detailed representation, which was originally formulated by Lord Rayleigh, can be written as F d = − 1 2 ρv 2 AC d v 1.17 where F d ⫽ the drag force N, ␳ ⫽ fluid density kgm 3 , A ⫽ the frontal area of the object on a plane perpendicular to the direction of motion m 2 , C d ⫽ a dimensionless drag coef- ficient, and v ⫽ a unit vector indicating the direction of velocity. This relationship, which assumes turbulent conditions i.e., a high Reynolds number, allows us to express the lumped drag coefficient from Eq. 1.7 in more fundamental terms as C d = 1 2 ρ AC d 1.18 Thus, the lumped drag coefficient depends on the object’s area, the fluid’s density, and a dimensionless drag coefficient. The latter accounts for all the other factors that contribute to air resistance such as the object’s “roughness”. For example, a jumper wearing a baggy outfit will have a higher C d than one wearing a sleek jumpsuit. Note that for cases where velocity is very low, the flow regime around the object will be laminar and the relationship between the drag force and velocity becomes linear. This is referred to as Stokes drag. In developing our bungee jumper model, we assumed that the downward direction was positive. Thus, Eq. 1.7 is an accurate representation of Eq. 1.17, because v ⫽ ⫹1 and the drag force is negative. Hence, drag reduces velocity. But what happens if the jumper has an upward i.e., negative velocity? In this case, v ⫽–1 and Eq. 1.17 yields a positive drag force. Again, this is physically correct as the pos- itive drag force acts downward against the upward negative velocity. Unfortunately, for this case, Eq. 1.7 yields a negative drag force because it does not include the unit directional vector. In other words, by squaring the velocity, its sign and hence its direction is lost. Consequently, the model yields the physically unrealistic result that air resistance acts to accelerate an upward velocity In this case study, we will modify our model so that it works properly for both downward and upward velocities. We will test the modified model for the same case as Example 1.2, but with an initial value of v0 ⫽⫺40 ms. In addition, we will also illustrate how we can extend the numerical analysis to determine the jumper’s position. Solution. The following simple modification allows the sign to be incorporated into the drag force: F d = − 1 2 ρv|v| AC d 1.19

1.4 CASE STUDY continued

or in terms of the lumped drag: F d = −c d v|v| 1.20 Thus, the differential equation to be solved is dv dt = g − c d m v|v| 1.21 In order to determine the jumper’s position, we recognize that distance travelled, x m, is related to velocity by d x dt = −v 1.22 In contrast to velocity, this formulation assumes that upward distance is positive. In the same fashion as Eq. 1.12, this equation can be integrated numerically with Euler’s method: x i + 1 = x i − vt i t 1.23 Assuming that the jumper’s initial position is defined as x0 ⫽ 0, and using the parame- ter values from Examples 1.1 and 1.2, the velocity and distance at t ⫽ 2 s can be computed as v 2 = −40 + 9.81 − 0.25 68.1 − 4040 2 = −8.6326 ms x 2 = 0 − −402 = 80 m Note that if we had used the incorrect drag formulation, the results would be ⫺32.1274 ms and 80 m. The computation can be repeated for the next interval t ⫽ 2 to 4 s: v 4 = −8.6326 + 9.81 − 0.25 68.1 − 8.63268.6326 2 = 11.5346 ms x 4 = 80 − −8.63262 = 97.2651 m The incorrect drag formulation gives –20.0858 ms and 144.2549 m. The calculation is continued and the results shown in Fig. 1.7 along with those obtained with the incorrect drag model. Notice that the correct formulation decelerates more rapidly because drag always diminishes the velocity. With time, both velocity solutions converge on the same terminal velocity because eventually both are directed downward in which case, Eq. 1.7 is correct. However, the impact on the height prediction is quite dramatic with the incorrect drag case resulting in a much higher trajectory. This case study demonstrates how important it is to have the correct physical model. In some cases, the solution will yield results that are clearly unrealistic. The current exam- ple is more insidious as there is no visual evidence that the incorrect solution is wrong. That is, the incorrect solution “looks” reasonable.