1 / 21

MATH 2140 Numerical Methods

MATH 2140 Numerical Methods. Instructor: Dr. Phillips Agboola. Faculty of Engineering Mechanical Engineering Department. Introduction. 1.1 BACKGROUND

mjerry
Télécharger la présentation

MATH 2140 Numerical Methods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATH 2140 Numerical Methods Instructor: Dr. Phillips Agboola Faculty of Engineering Mechanical Engineering Department

  2. Dr. Mohamed Elshazly

  3. Dr. Mohamed Elshazly

  4. Dr. Mohamed Elshazly

  5. Introduction • 1.1 BACKGROUND • Numerical methods are mathematical techniques used for solving mathematical problems that cannot be solved or are difficult to solve analytically. • An analytical solution is an exact answer in the form of a mathematical expression in terms of the variables associated with the problem that is being solved. • A numerical solution is an approximate numerical value (a number) for the solution. • Although numerical solutions are an approximation, they can be very accurate. • In many numerical methods, the calculations are executed in an iterative manner until a desired accuracy is achieved. Dr. Mohamed Elshazly

  6. For example, Fig. 1-1 shows a block of mass m being pulled by a force F applied at an angle θBy applying equations of equilibrium, the relationship between the force and the angle is given by: Dr. Mohamed Elshazly

  7. Solving Nonlinear Equations • 3.1 BACKGROUND • Equations need to be solved in all areas of science and engineering. An equation of one variable can be written in the form: • A solution to the equation (also called a root of the equation) is a numerical value of x that satisfies the equation. • Graphically, as shown in Fig. 3-1, the solution is the point where the function f(x) crosses or touches the x-axis. • An equation might have no solution or can have one or several (possibly many) roots. Dr. Mohamed Elshazly

  8. For example, the area of a segment As of a circle with radius r (shaded area in Fig. 3-2) is given by: To determine the angle θif As and r are given, Eq. (3.2) has to be solved for θ. Obviously, θcannot be written explicitly in terms of As and r, and the equation cannot be solved analytically. Dr. Mohamed Elshazly

  9. A numerical solution of an equation f(x) = 0 is a value of x that satisfies the equation approximately. • This means that when x is substituted in the equation, the value of f(x) is close to zero, but not exactly zero. • For example, to determine the angle θfor a circle with r = 3 m and As = 8 m2, Eq. (3.2) can be written in the form: Dr. Mohamed Elshazly

  10. A plot of f(θ) (Fig. 3-3) shows that the solution is between 2 and 3. • Substituting θ= 2.4 rad in Eq. (3.3) gives f(θ) = 0.2396, and the solution θ= 2.43 rad gives f(θ) = 0.003683. • Obviously, the latter is a more accurate, but not an exact, solution. • It is possible to determine values of θthat give values of f(θ) that are closer to zero, but it is impossible to determine a numerical value of e for which f(θ) is exactly zero. • When solving an equation numerically, one has to select the desired accuracy of the solution. Dr. Mohamed Elshazly

  11. 3.3 BISECTION METHOD • The bisection method is a bracketing method for finding a numerical solution of an equation of the form f(x) = 0 when it is known that within a given interval [a, b], f(x) is continuous and the equation has a solution. • When this is the case, f(x) will have opposite signs at the endpoints of the interval. As shown in Fig. 3-6, if f(x) is continuous and has a solution between the points x = a and x = b , then either f(a) > 0 and f(b) < 0 or f(a) < 0 and f(b) > 0. • In other words, if there is a solution between x =a and x = b, then f(a)f(b) < 0 Dr. Mohamed Elshazly

  12. Dr. Mohamed Elshazly

  13. Algorithm for the bisection method • 1. Choose the first interval by finding points a and b such that a solution exists between them. This means that f(a) and f(b) have different signs such that f(a)f(b) < 0. The points can be determined by examining the plot of f(x) versus x. • 2. Calculate the first estimate of the numerical solution xNs1 by: • 3. Determine whether the true solution is between a and xNS1, or between xNs1and b. This is done by checking the sign of the product f(a) · f(xNsi) : • If f(a) · f(xNsi) < 0, the true solution is between a and xNsi· • If f(a) · f(xNsi) > 0, the true solution is between xNsi and b. • 4. Select the subinterval that contains the true solution (a to x NSI, or • xNsi to b) as the new interval [a, b], and go back to step 2. • Steps 2 through 4 are repeated until a specified tolerance or error • bound is attained. Dr. Mohamed Elshazly

  14. Dr. Mohamed Elshazly

  15. SOLUTION • To find the approximate location of the solution, a plot of the function: • f(x) = 8-4.5(x- sinx) • is made by using the fplot command of MATLAB. The plot (Fig. 3-8), shows that the solution is between x = 2 and x = 3. The initial interval is chosen as a = 2 and b = 3 . Dr. Mohamed Elshazly

  16. Dr. Mohamed Elshazly

  17. Example-1 Find the root of:

  18. Example-1

  19. EXAMPLE-2

  20. EXAMPLE -3

  21. EXAMPLE-3

More Related