mathematical models for engineering problems and - minho kim

32
Mathematical Models for Engineering Problems and Differential Equations fall, 2010 University of Seoul School of Computer Science Minho Kim

Upload: others

Post on 17-Mar-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Mathematical Models for Engineering Problemsand Differential Equations

fall, 2010

University of SeoulSchool of Computer Science

Minho Kim

Table of contents

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Background

I Objective: To find the roots of the equation f(x) = 0.I Example: Find θ when AS and r are given inAS = 1

2r2(θ − sin θ).

I f(x) is nonlinear.I No analytic solution exists.

I How can we find an approximate solution (numericalsolution) that is close to the exact one?

I Numerical methods – bracketing methods and open methods→ pros and cons?

Overview

I Brackting methodsI Bisection methodI Regula falsi method

I Open methodsI Newton’s methodI Secant methodI Fixed-point method

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Estimation of Errors

Let f(xTS) = 0 and f(xNS) = ε. In other words, xTS is the truesolution and xNS is a numerical solution.

I True error TrueError = xTS − xNS

I Tolerance in f(x)ToleranceInf = |f(xTS)− f(xNS)| = |0− ε| = |ε|

I Tolerance in the solution (for bracketing methods)Tolerance =

∣∣ b−a2

∣∣ when xNS = a+b2 .

I True relative error TrueRelativeError =∣∣∣xTS−xNS

xTS

∣∣∣I Estimated relative error (for iterative methods)

EstimatedRelativeError =

∣∣∣∣x(n)NS−x

(n−1)NS

x(n−1)NS

∣∣∣∣

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Bisection Method: Overview

I A bracketing methodI Used when, in [a, b],

I f(x) is continuous andI f(a)f(b) < 0 (f(a) and f(b) have opposite signs) thereforef(x) = 0 has a solution.

Bisection Method: Procedure

1. Choose an interval [a, b] such that f(a)f(b) < 0. (How?)

2. Compute the first estimate x1NS = a+b2 (midpoint of the

interval). If the tolerance or error bound is satisfied, stop.(How to choose the “termination criteria”?)

3. Determine which of two subintervals, [a, x1NS ] and [x1NS ], hasthe solution.

4. Set the subinterval as the new interval [a, b] and go back tothe step 2.

→ Try Example 3-1.

Bisection Method: Additional Notes

I This method always converges to the answer, provided a rootexists in the initial interval.

I This method may fail if f(x) does not cross the x axis.

I This method converges slowly. (compared to other methods)

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Regula Falsi Method: Overview

I Means “rule of false [position]” in Latin.

I A.k.a. “false position and linear interpolation method”

I A bracketing methodI Used when, in [a, b],

I f(x) is continuous andI f(a)f(b) < 0 (f(a) and f(b) have opposite signs) thereforef(x) = 0 has a solution.

→ same as the bisection method

Regula Falsi Method: Procedure

1. Choose the initial interval [a, b] such that f(a)f(b) < 0.

2. Compute the first estimate x1NS . (What is the formula ofx1NS?) If the termination criteria is met, stop.

3. Find which line intersects the x-axis between the lineconnecting (a, f(a))− (x1NS , f(x

1NS)) and the one connecting

(x1NS , f(x1NS))− (b, f(b)).

4. Select the subinterval containing the solution and go back tostep 2.

Regula Falsi Method: Additional Notes

I Always converges provided a root exists in [a, b].

I If the function is concave up/down, only one point approachesthe root. (Why?) Several modified versions are availablewhere both points move at the same time. (See Problem 3.18on p.87)

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Newton’s Method: Overview

I An open methodI Used when

I f(x) is continuous and differentiable andI f(x) = 0 has a solution near a given point.

Newton’s Method: Procedure

1. Choose a point x1 as an initial guess.

2. Computes xi+1 from the previous guess xi by finding thex-intercept of the tangent line of f(x) at xi. (What is theformula of xi+1?)

3. Repeat step 2 until the termination criteria is met.

→ Program 3-2 on p.64→ Try Example 3-2.

Newton’s Method: Error Estimate

I Tolerance cannot be used. (Why?)

I Which error estimates can be used?

Newton’s Method: Notes

I Converges fast, but fails to converge sometimes. (When?)

I Sometimes the expression for the derivative is not available.(What can we do in this case?)

I Effect of the starting point → Example 3-3

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Secant Method: Overview

I An open method

I Used when f(x) is continuous.

I Can be thought of as an approximation of Newton’s method,(Why?) but does not need to evaluate f ′(x).

Secant Method: Procedure

1. Choose two initial points, x1 and x2, near the solution.

2. Compute the first estimate, x3, as the x-intercept of thesecant built by two points. (What is the formula?) Stop if thetermination criteria is met.

3. Repeat step 2 using the last two points, xi−1 and xi.

→ Program 3-3 on p.69

Secant Method: Notes

I May or may not converge.

I While Newton’s method converges faster, it may take moretime to compute due to the evaluation of f ′(x).

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Fixed-Point Iteration Method: Overview

I An open method

I Used when f(x) is continuous.

I Solve “f(x) = 0” by converting it to the form x = g(x).(How?)

I The intersection of two plots, y = x and y = g(x), is thesolution. (Why?)

Fixed-Point Iteration Method: Procedure

1. Start by taking a value of x near the fixed point (solution) asthe first guess, x1.

2. Substitute xi in g(x) to get the next guess xi+1.

3. Repeat step 2.

Fixed-Point Iteration Method: Notes

I g(x) is called the ‘iteration function’.

I Does not always converge, even when the starting point isclose to the solution.

I Choosing g(x).I Is it unique for a given equation?I If not unique, which g(x) works?I How many g(x)s work?I Is there at least one g(x) that works for any equation?

Fixed-Point Iteration Method: Notes (cont’d)

I When does the method converge?

The fixed-point iteration method converges if in the neighborhoodof the fixed point the derivative of g(x) has an absolute value thatis smaller than 1 (also called Lipschitz continuous):

|g′(x)| < 1

→ p.72

I Which error estimates can be used?

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations

Outline

Solving Nonlinear EquationsBackgroundEstimation of Errors in Numerical SolutionsBisection MethodRegula Falsi MethodNewton’s MethodSecant MethodFixed-Point Iteration MethodUse of MATLAB Build-In Functions for Solving NonlinearEquationsEquations with Multiple SolutionsSystems of Nonlinear Equations