Computers in civil engineering 53 081 spring 2003
This presentation is the property of its rightful owner.
Sponsored Links
1 / 19

Computers in Civil Engineering 53:081 Spring 2003 PowerPoint PPT Presentation


  • 52 Views
  • Uploaded on
  • Presentation posted in: General

Computers in Civil Engineering 53:081 Spring 2003. Lecture #6. Roots of Equations (Chapter 5 of 3rd Edition of C 2 ). Solve for x please …. 4x=8 (x-1)(x+1)=0 e -x =x cos(x)cosh(x)+1=0. Problem Formulation. Find roots of equations in form: f(x)=0.

Download Presentation

Computers in Civil Engineering 53:081 Spring 2003

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Computers in civil engineering 53 081 spring 2003

Computers in Civil Engineering53:081 Spring 2003

Lecture #6

Roots of Equations(Chapter 5 of 3rd Edition of C2)


Solve for x please

Solve for x please …

  • 4x=8

  • (x-1)(x+1)=0

  • e-x=x

  • cos(x)cosh(x)+1=0


Problem formulation

Problem Formulation

Find roots of equations in form:f(x)=0

(We can put any of our one-equation engineering problems into this form)Question: What do we mean by roots?

Question: Why do we need to find the roots of such equations?

Answer: Example of uniform flow in open channel


Computers in civil engineering 53 081 spring 2003

Uniform Flow

Colebrook-White Formula

T(y)=surface width

y

A(y)=area

P(y) = wetted perimeter


Continue

Continue...

In many instances Q, So, etc. are known, and one wants to solve for y. In other words: given Q and channel geometry, solve:

f(y) = 0

Problem: Explicit solution does not exist! (especially since A(y) and P(y) are also functions)

Solution:Numerically find root of equation, e.g. find value of depth y such that the equation is satisfied.

(Note that you can move Q to the right side and say 0=f(y). What value of y causes f(y) to be zero?)


Outline

Outline

By definition f(xr) = 0

  • Single roots

  • Multiple roots

  • Systems of equations

    fi(x1,x2,...,xn)=0 for i = 1,...,n


Graphical method

Graphical Method

  • Plot function and observe zero crossing- ALWAYS do this first!

  • Useful for finding initial conditions of systematic methods

f(x)

x


Example

Example

Consider the function:

i.e.

or


The graphical approach

The Graphical Approach

1.0

0.5

f(x)

0.0

0.2

0.4

0.6

0.8

-0.5

-1.0

x


General discussion

General Discussion

  • Bracketing Methods

    • Require two initial guesses that bracket the true root

  • Open Methods

    • Require only one initial guess

  • Special case: multiple roots. For example:

Two roots at 1


Bracketing methods

Bracketing Methods

  • Bisection Method

  • False-Position Method (Regula-Falsi)


Possible situations

Possible Situations

f(x)

f(x)

f(xu)

f(xl)

x

x

f(xl)f(xu) < 0 Odd number of roots in bracket

f(xl)f(xu) > 0 No root in bracket

f(x)

f(x)

x

x

f(xl)f(xu) > 0 Even number of roots in bracket

f(xl)f(xu) < 0 Odd number of roots in bracket


Difficult situations

Difficult Situations

(f(xl)f(xu)<0 but even number of roots

f(x)

f(x)

f(xlu)

x

x

f(xl)


The bisection method

The Bisection Method

1.Choose lower xl and upper xu bounds.

2.Check if f(xl) f(xu) < 0. If not, go to 1.

3.Estimate root by xr = 0.5(xl+xu)

4.Check which interval contains the root.

If f(xl) f(xr) < 0 set xu = xr and go to 5.

If f(xl) f(xr) > 0 set xl = xr and go to 5.

If f(xl) f(xr) = 0 stop. (is this possible?)

5.Is the required accuracy met?

If yes: Stop.

If not: Go to 3.


Example bisection method

Example: Bisection Method

f(x)

4

1

0

x

2

3

xl

xu


Termination criteria

Termination Criteria

Iteratively estimate error:

In the present context:

Where is the prescribed stopping criterion.


Example f x e x x

Example: f(x) = e-x -x

1.0

By definition f(xr) = 0

0.5

f(x)

0.0

0.2

0.4

0.6

0.8

-0.5

-1.0

xu

xl

x


Termination criteria1

Termination Criteria

Iterationxr|t|% |a|%

10.511.8

20.7532.233.3

30.625 10.2 20.0

40.56250.819 11.1

50.593754.69 5.3

(The root is approximately at 0.567)


Computers in civil engineering 53 081 spring 2003

Roots of Equations … to be continued(Chapter 5 of 3rd Edition of C2)


  • Login