Sie sind auf Seite 1von 43

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

CVE240AppliedMathematicsforCivilEngineers
3(306)
(
)
Week 10 : Numerical method for solving the nonlinear equation

Instructor
ChainarongAthisakul,Ph.D.

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

MaterialsandResources
http://www.cekmutt.com
http://www ce kmutt ac th/cac
http://www.ce.kmutt.ac.th/cac
CivilAcademicClub

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

http://www.cekmutt.com
http://www.ce
kmutt.com
Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Numerical method for solving


q
the nonlinear equation

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Numerical method for solving


q
the nonlinear equation
This topic is very useful and easy to learn
Thistopicisveryusefulandeasytolearn.

Enjoy
htt //i
http://isaacskids.wordpress.com/page/2/
kid
d
/
/2/

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Whatisalinearequation?

Wh k
Whoknows?
?

http://lookatmyhappyrainbow.blogspot.com/2011/04/thinking.html

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Whatisalinearequation?
Alinearequationisapolynomialequationofdegree1.
slope
p

y = mx + c

acommonform
Slopeintercept form
Slopeinterceptform
Yintercept

Ax + By + c = 0

ageneralform

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Whatisanonlinearequation?

Whoknows?

http://www.neoclipart.com/5811clipartofpeoplethinking.html

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

http://www.icoachmath.com/math dictionary/Nonlinear Equations.html


http://www.icoachmath.com/math_dictionary/Nonlinear_Equations.html

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Moreexamplesofnonlinearequation
Whocangivemoreexamples?

Linear
Degreeofpolynomialgreaterthan1.
Ifthedegreeofthepolynomialequationis
If
the degree of the polynomial equation is
lessthan1,itisalsoanonlinearequation.
Note: Degree of polynomial have to be integer.
Note:Degreeofpolynomialhavetobeinteger.
Chainarong Athisakul,Ph.D.

10

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Moreexamplesofnonlinearequation
Whocangivemoreexamples?

Chainarong Athisakul,Ph.D.

11

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Moreexamplesofnonlinearequation
Whocangivemoreexamples?

Trigonometric
Trigonometric
functions
Chainarong Athisakul,Ph.D.

Exponential
Exponentialfunctions
functions

Logarithmic
Logarithmicfunctions
functions

y = bx
12

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Canyoufindtherootoftheequations?

y = f (x)
RootofEq.=SolutionofEq.
thevalueofxthatgivesy=0

http://www.slideshare.net/mafevm/chapter3rootsofequations

Chainarong Athisakul,Ph.D.

13

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Rootofthelinearequations
f h li
i

y = ax + b

F
Forexample,
l y = 5x
5 10 = 0
Canyoufindtherootofthisequation?
y
q

Chainarong Athisakul,Ph.D.

14

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

y = ax + b

Rootofthelinearequations
f h li
i
F
Forexample,
l y = 5x
5 10 = 0

Canyoufindtherootofthisequation?
y
q
Therootofthisequationis x = 2

Very easy

y=5x10
40
30
20
10
0
-6

-4

-2

-10 0

10

-20
-30
-40
http://free.clipartof.com/details/5FreeSummerClipartIllustrationOfAHappySmilingSun

Chainarong Athisakul,Ph.D.

15

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Rootofthequadraticequations
f h
d i
i

y = ax 2 + bx + c

F
Forexample,
l y=3
3x 2 + 5x
5 +2=0
Canyoufindtherootofthisequation?
y
q
LinearorNonlinear?

Chainarong Athisakul,Ph.D.

16

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Rootofthequadraticequations
f h
d i
i

y = ax 2 + bx + c

F
Forexample,
l y=3
3x 2 + 5x
5 +2=0
Canyoufindtherootofthisequation?
y
q
Byfactoringmethod,
y
g

y = 3x 2 + 5x + 2 = ( 3x + 2 )( x + 1) = 0

2
x = , 1
3

Byquadraticformula,
2
2
b b 2 4ac 5 5 4 ( 3 )( 2 ) 5 25 24
x=
=
=
= , 1
2a
2 ( 3)
6
3

Chainarong Athisakul,Ph.D.

17

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Rootofthecubicequations
f h
bi
i
y = x 3 + a1 x 2 + a2 x + a3

Canyoufindtherootofthisequation?
y
q
Byfactoringmethod,
y = x 3 + 2x 2 x 2 = ( x 1)( x + 1)( x + 2 )

Synthetic division
()

Therootsofthisequationare
x = 1,1,2

However,iftherootscannotbesolvedanalytically.
Howcanwedo?
Chainarong Athisakul,Ph.D.

18

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

SSynthetic
h i division
di i i
()

http://schooltutoring.com/help/understandingsyntheticdivision/
Chainarong Athisakul,Ph.D.

19

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Iftheequationsareasthefollowings
Canyoufindtherootof
these equations?
theseequations?

(.. )

Chainarong Athisakul,Ph.D.

20

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Method for solving the nonlinear equation


Methodforsolvingthenonlinearequation.
NonlinearEquation
Nonlinear
Equation
Solver

Graphical
Method

Bracketing
M th d
Methods
Bisection
Falseposition
False position

Chainarong Athisakul,Ph.D.

Open
M th d
Methods
Fixedpointiteration
NewtonRaphson
Newton Raphson
Secant

21

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Graphical Method

Chainarong Athisakul,Ph.D.

22

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

A
Acasestudy:Example1
t d E
l 1
Upward
p
force of
air resistance

Aparachutistofmass68.1kg
h
f
k
jumpsoutofaballoon.
Determinethedragcoefficientc
g
neededfortheparachutistto
have a velocity of 40 m/s after
haveavelocityof40m/safter
freefallingfortimet=10s.

Downward pull of
gravity

Chainarong Athisakul,Ph.D.

23

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

D i th
Derivethemathematicalmodel
th
ti l
d l

Thisslideisnotamainideaofthissubject.
Youcanskipthisslide.

Chainarong Athisakul,Ph.D.

24

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

D i th
Derivethemathematicalmodel
th
ti l
d l

Iftheupwardforceofairresistanceisnot
considered,theaccelerationaisequalto
the gravitational constant g
thegravitationalconstantg.

Thisslideisnotamainideaofthissubject.
Youcanskipthisslide.

Chainarong Athisakul,Ph.D.

25

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

D i th
Derivethemathematicalmodel
th
ti l
d l

Thisslideisnota
mainideaofthis
j
subject.
Youcanskipthis
slide.

Chainarong Athisakul,Ph.D.

26

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

D i th
Derivethemathematicalmodel
th
ti l
d l

Thisslideisnotamainidea
ofthissubject.
p
Youcanskipthisslide.

Chainarong Athisakul,Ph.D.

27

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)


Aparachutistofmass68.1kgjumpsoutofaballoon.
pa ac ut st o ass 68 g ju ps out o a ba oo
Determinethedragcoefficientcneededfortheparachutisttohaveavelocity
of40m/safterfreefallingfortimet=10s.

Acasestudy:

t
gm
v=
1 e m

Upward
p
force of
air resistance

Nonlinearproblem

Subtractingthedependentvariablevfrombothsides
c
t
gm
f (c) =
1 e m v = 0

Nonlinearfunction

t=10s,g=9.8m/s2 ,v=40m/s,m=68.1kg

Downward pull of
gravity

Chainarong Athisakul,Ph.D.

f (c) =

667.38
667
38
0 146843 c
1 e 0.146843
(
) 40 = 0
c

28

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

f (c) =

667.38
1 e 0.146843c ) 40 = 0
(
c

C=?

How can we solve this equation?


Howcanwesolvethisequation?

Letstrythismethod.

Chainarong Athisakul,Ph.D.

29

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Graphical
hi l Method
h d

f (c) =

667.38
1 e 0.146843c ) 40 = 0
(
c

Variousvaluesofccanbesubstitutedintotherighthandsideofthisequationtocompute.

Thesepointsareplottedinthefigure.Theresulting
curvecrossesthecaxisbetween12and16.
Visualinspectionoftheplotprovidesaroughestimate
oftherootof14.75.

Chainarong Athisakul,Ph.D.

30

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Solutionofthiscasestudy:
Thevalidityofthegraphicalestimatecanbecheckedbysubstitutingitintotheequationof
theproblem.

closetozero
l

Thesolutionisapproximatedtobe14.75.
Chainarong Athisakul,Ph.D.

31

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Chainarong Athisakul,Ph.D.

32

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Remarkonthegeneralcases: Thegraphicalmethod

Thereareanumberofwaysinwhichrootscanoccurinanintervalprescribedbyalowerboundandan
Th
b
f
i hi h
t
i
i t
l
ib d b l
b
d d
upperbound.

Asinglerootis
bracketedbynegative
and positive values of
andpositivevaluesof
f(x).

Noroot

xl

xu

Iff(xl)andf(xu)havethe
samesigns,thereare
eithernorootsoran
evennumberofroots
betweenthevalues.

xl

xu
Iff(xl)andf(xu)have
oppositesigns,thereare
anoddnumberofroots
i th i t
intheinterval.
l

Tworootsoccur

xl

xu

Chainarong Athisakul,Ph.D.

Threerootsoccur

33

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Remark on the special cases:


Remarkonthespecialcases:

Chainarong Athisakul,Ph.D.

34

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

EExample2
l 2
Useofcomputergraphicstolocateroots

Chainarong Athisakul,Ph.D.

35

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

E
Example2
l 2
f(x)=sin10x+cos3x
2.5
2
1.5
1
0.5
0
0

0.5
05
1
1
1.5
5
2
2.5
f(x)=sin10x+cos3x

Apossible
doubleroot
mayoccursat
thisinterval
(4.24.3).

We will zoom in on this region


Wewillzoominonthisregion.
Chainarong Athisakul,Ph.D.

36

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

E
Example2
l 2
0.1

0
4.2

4.22

4.24

4.26

4.28

4.3

0.1

Therearetwodistinctrootsataboutx=4.23andx=4.26.
Graphicalmethodarenotprecise.
Ifthesolutionwithhigherprecisionisrequired,theanothertechniqueshastobechosen
If
h
l i
i h hi h
ii i
i d h
h
h i
h
b h
instead.

Chainarong Athisakul,Ph.D.

37

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Bracketing Method
Thebisectionmethod
Thefalsepositionmethod

.. , 2538, ,

.. , 2537, 1
Steven C. Chapra, Raymond P. Canale, 2010, Numerical
Numerical Methods for Engineers,
Engineers , McGrawHill

Chainarong Athisakul,Ph.D.

38

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Chainarong Athisakul,Ph.D.

39

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

The Bisection Method


.. , 2538, ,


..

,
2537,
2537

1
1

Steven C. Chapra, Raymond P. Canale, 2010, Numerical Methods for Engineers, McGrawHill

Chainarong Athisakul,Ph.D.

40

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Considerthefollowingsteps

x
Therootofequation
(the required solution)
(therequiredsolution)

Chainarong
Athisakul,Ph.D.
41

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Step1:Trytwoinitialguesses.
According
A
di to
t the
th graphical
hi l method,
th d we have
h
observed that f(x) changed sign on opposite
sides of the root. In general, if f(x) is real and
continuous in the interval from XL to XR and
f(XL) and f(XR) have opposite signs, that is,
f ( xR ) f ( xL ) < 0

Thereisatleastonerealroot
There
is at least one real root
betweenXLandXR.

Chainarong
Athisakul,Ph.D.
42

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Step2:Checkiff(XR).f(XL)<0.

Therearenorootsinthisinterval.
Trynewinterval.
ChooselowerXLandupper
Choose
lower XL and upper
XRguessesfortherootsuch
thatthefunctionchanges
signovertheinterval.
f ( xR ) f ( xL ) < 0

Thisconditionhastobechecked.

Chainarong
Athisakul,Ph.D.
43

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Step3:Computethemeanvalue(Xm).
xM =

xL + xR
2

Themidpointoftheintervalisapproximated
tobetheroot.

Chainarong
Athisakul,Ph.D.
44

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Step4:
St
4
Checktheabsolutevalueof
f(Xm),whichmustlessthanthe
pp g
( )
stoppingtolerance().
f ( xM ) <

Iftrue,stop.
The root is Xm
TherootisXm.

Ifthisconditionisnottrue,follownext
If
this condition is not true follow next
step.

Chainarong Athisakul,Ph.D.

=0.0005

45

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Therearetwopossiblecaseforthevalueoff(XM).
N XL
NewXL

NewXR

Step5:

.. ,

TRUE
SetXR=XM
Chainarong Athisakul,Ph.D.

f ( Xm ) f ( XR ) > 0

False
SetXL=XM
46

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

f ( xR )
xL

f ( xL )

xR

..

f ( Xm ) f ( XR ) > 0

False
SetXL=XM
Chainarong Athisakul,Ph.D.

47

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Step6:repeatstep3untilthevalueoff(XM)reachthestoppingtolerance.

N t it ti
Nextiteration
NewXR
f ( xR )

f ( xR )

f ( xM )

xL

xL

xm
f ( xL )

f ( xL )

xR

R
Repeatstep3.
t t 3
..

f ( Xm ) f ( XR ) > 0

TRUE
SetXR=XM
Chainarong
Athisakul,Ph.D.
48

xR

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

xM =

xL + xR
2

Themidpointoftheintervalis
approximated to be the root.
approximatedtobetheroot.

Youcanskipthisslide.

XM

XR XR XM

Chainarong
Athisakul,Ph.D.
49

XM


XL
XL XM

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Youcanskipthisslide.
p
Chainarong Athisakul,Ph.D.

50

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example3

Findingtherootofthefunction f ( x ) = e (2 x) 1 = 0
UsetheinitialguessesofXL=0andXR=2.Dotheiterativeprocess
untiltherelativeerrorfallsbelow1x105 .
i

XL

XR

Xm=(XL+XR)/2

x /4

F(XR)

F(Xm)

F(XR)*F(Xm)

Chainarong
Athisakul,Ph.D.
51

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example3

Findingtherootofthefunction f ( x ) = e (2 x) 1 = 0
UsetheinitialguessesofXL=0andXR=2.Dotheiterativeprocess
untiltherelativeerrorfallsbelow1x105 .
i

XL

XR

Xm=(XL+XR)/2

F(XR)

-1

x /4

F(Xm)

F(XR)*F(Xm)

-0.221199217 0.221199217

F(XL)

The initial guesses of XL and XR


satisfy the condition
f ( xR ) f ( xL ) < 0

Thiscolumnisnotusedinthe
calculationprocess.Itisused
toclarifythebisection
method.

Chainarong
Athisakul,Ph.D.
52

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example3
x /4
(2 x) 1 = 0
Findingtherootofthefunction f x = e
Use the initial guesses of XL = 0 and XR = 2 Do the iterative process until the relative error falls
UsetheinitialguessesofXL=0andXR=2.Dotheiterativeprocessuntiltherelativeerrorfalls
below1x105 .

( )

i
1
2
3

XL
0
0
0.5

XR
2
1
1

Xm=(XL+XR)/2
F(XR)
1
-11
0.5
-0.221199217
0.75
-0.221199217

F(Xm)
-0.221199217
0.221199217
0.323745354
0.036286398

F(XR)*F(Xm)
0.221199217
-0.07161222
-0.00802652

F(XL)
1
1
0.323745354

f ( Xm ) >
D h i
Dotheiterativeprocess.
i

f ( Xm ) f ( XR ) > 0

TRUE
SetXR=XM
Chainarong
Athisakul,Ph.D.
53

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example3
x /4
(2 x) 1 = 0
Findingtherootofthefunction f x = e
Use the initial guesses of XL = 0 and XR = 2 Do the iterative process until the relative error falls
UsetheinitialguessesofXL=0andXR=2.Dotheiterativeprocessuntiltherelativeerrorfalls
below1x105 .

( )

i
1
2
3

XL
0
0
0.5

XR
2
1
1

Xm=(XL+XR)/2
F(XR)
1
-11
0.5
-0.221199217
0.75
-0.221199217

F(Xm)
-0.221199217
0.221199217
0.323745354
0.036286398

f ( Xm ) f ( XR ) > 0

False
SetXL=XM

Chainarong
Athisakul,Ph.D.
54

F(XR)*F(Xm)
0.221199217
-0.07161222
-0.00802652

F(XL)
1
1
0.323745354

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

XL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

XR

Xm=(XL+XR)/2

f ( x ) = e x /4 (2 x) 1 = 0
F(XR)

F(Xm)

F(XR)*F(Xm)

F(XL)

0
0
0.5
0 75
0.75
0.75
0.75
0.78125
0.78125
0.78125
0.78125
0.783203
0.783203
0.783203
0.783447
0 783569
0.783569

2
1
1
1
0.875
0.8125
0.8125
0.796875
0.7890625
0.78515625
0.78515625
0.784179688
0.783691406
0.783691406
0 783691406
0.783691406

1
0.5
0.75
0 875
0.875
0.8125
0.78125
0.796875
0.7890625
0.78515625
0.78320313
0.78417969
0.78369141
0.78344727
0.78356934
0 78363037
0.78363037

-1
-0.221199217
-0.221199217
-0.221199217
0 221199217
-0.096037105
-0.030790747
-0.030790747
-0.014194703
-0.005853573
-0.001672195
-0.001672195
-0.000625723
-0.000102317
-0.000102317
-00.000102317
000102317

-0.221199217
0.323745354
0.036286398
-0.096037105
0 096037105
-0.030790747
0.002516404
-0.014194703
-0.005853573
-0.001672195
0.000421201
-0.000625723
-0.000102317
0.000159428
2.85518E-05
-33.68836E
68836E-05
05

0.221199217
-0.07161222
-0.00802652
0 021243332
0.021243332
0.002957054
-7.7482E-05
0.000437066
8.30897E-05
9.78832E-06
-7.0433E-07
1.04633E-06
6.40222E-08
-1.6312E-08
-2.9213E-09
3 77383E-09
3.77383E
09

1
1
0.323745354
0 036286398
0.036286398
0.036286398
0.036286398
0.002516404
0.002516404
0.002516404
0.002516404
0.000421201
0.000421201
0.000421201
0.000159428
2 85518E-05
2.85518E
05

16 0.783569

0.783630371

0.78359985

-3.68836E-05

-4.16612E-06

1.53662E-10

2.85518E-05

Rootofthisequation

Chainarong
Athisakul,Ph.D.
55

Theiterativeprocessstopwhentheabsolutevalue
off(XM)lessthanthestoppingtolerance.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Algorithm
1.
2.
3.
3
4.
5.
6
6.

Trytwoinitialguesses.
y
g
Checktheconditionoff(XR).f(XL)<0.Iftheconditionistrue,follownext
step.Iftheconditionisfalse,trynewinitialguesses.
C l l t th
Calculatethemeanvalue.
l
Checktheabsolutevalueoff(Xm),whichmustlessthanthestopping
tolerance().
( )
Checktheconditionoff(XM).f(XL)>0.Iftheconditionistrue,setXR=XM.
Iftheconditionisfalse,setXL=XM
R
Repeatstep3untiltheabsolutevalueoff(XM)lessthanthestopping
t t 3 til th b l t
l
f f(XM) l
th th t
i
tolerance().

Chainarong Athisakul,Ph.D.

56

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Youcanskipthisslide.
p
Chainarong
Athisakul,Ph.D.
57

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Youcanskipthisslide.
p
Chainarong
Athisakul,Ph.D.
58

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Youcanskipthisslide.
p
Chainarong
Athisakul,Ph.D.
59

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example4
x
Findingtherootofthefunction 3 xe = 1
Use the initial guesses of XL = 0 25 and XR = 0 26 Do the iterative process until the relative
UsetheinitialguessesofXL=0.25andXR=0.26.Dotheiterativeprocessuntiltherelative
errorfallsbelow1x107 .
i

XL
1

Chainarong
Athisakul,Ph.D.
60

XR
0.25

Xm=(XL+XR)/2
0.26

F(XR)

F(Xm)

F(XR)*F(Xm)

CVE
240 Applied Mathematics for Civil Engineers 3(3-0-6)
Example4
x
Findingtherootofthefunction 3 xe = 1
Use the initial guesses of XL = 0 25 and XR = 0 26 Do the iterative process until the relative
UsetheinitialguessesofXL=0.25andXR=0.26.Dotheiterativeprocessuntiltherelative
errorfallsbelow1x107 .
i

XL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

0.25
0.255
0 2575
0.2575
0.2575
0.2575
0.2575
0.2575
0.257578125
0.257617188
0.257617188
0.257626953
0.257626953
0.257626953
0 257626953
0.257626953
0.257627563
0.257627563
0.257627563

XR
0.26
0.26
0 26
0.26
0.25875
0.258125
0.2578125
0.25765625
0.25765625
0.25765625
0.257636719
0.257636719
0.257631836
0.257629395
0 257628174
0.257628174
0.257628174
0.257627869
0.257627716

Xm=(XL+XR)/2
Xm
(XL+XR)/2
0.255
0.2575
0 25875
0.25875
0.258125
0.2578125
0.25765625
0.257578125
0.257617188
0.257636719
0.257626953
0.257631836
0.257629395
0.257628174
0 257627563
0.257627563
0.257627869
0.257627716
0.25762764

F(XR)
0.011605468
0.011605468
0 011605468
0.011605468
0.005484338
0.002428918
0.000902493
0.000139602
0.000139602
0.000139602
4.42552E-05
4.42552E-05
2.04191E-05
8.50118E-06
2 54222E 06
2.54222E-06
2.54222E-06
1.05248E-06
3.07611E-07

F(Xm)
F(XR) F(Xm)
F(XR)*F(Xm)
-0.01279686
-0.000148514
-0.000623076
-7.23109E-06
0 005484338
0.005484338
6 36483E 05
6.36483E-05
0.002428918
1.3321E-05
0.000902493
2.19208E-06
0.000139602
1.2599E-07
-0.000241764
-3.37506E-08
-5.10878E-05
-7.13195E-09
4.42552E-05
6.1781E-09
-3.41673E-06
-1.51208E-10
2.04191E-05
9.03653E-10
8.50118E-06
1.73587E-10
2.54222E-06
2.16118E-11
-4.37258E-07
4 37258E 07
-1.1116E-12
1 1116E 12
1.05248E-06
2.67563E-12
3.07611E-07
3.23754E-13
-6.48235E-08
-1.99404E-14

Chainarong
Athisakul,Ph.D.
61

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

True error
Trueerror

Chainarong Athisakul,Ph.D.

62

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

The true percent relative error


Thetruepercentrelativeerror.

Chainarong Athisakul,Ph.D.

63

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Iftheexactvaluecannotbeobtained,analternativeisto
If
th
t l
t b bt i d
lt
ti i t
normalizetheerrorusingthebestavailableestimateofthe
truevalue,thatis,totheapproximationitself,asin

Theapproximatepercentrelativeerror
Chainarong Athisakul,Ph.D.

64

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

The false-position method


.. , 2538, ,

Steven C. Chapra, Raymond P. Canale, 2010, Numerical Methods for Engineers, McGrawHill
Berlin
Berlin Chen, Numerical Methods (Lecture note),

Chainarong Athisakul,Ph.D.

65

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Ashortcomingofthebisectionmethodis
that,individingtheintervalfromXLto
XRintoequalhalves,noaccountistaken
ofthemagnitudesoff(XL)andf(XR).

Thebisectionmethod
..

Chainarong Athisakul,Ph.D.

Th f l
Thefalsepositionmethod
iti
th d


..

Thefalsepositionmethodisanalternative
methodthatincludesthevalueoff(XL)and
f( ) i
f(XR)incomputationalprocess.
i
l

66

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Thefalsepositionmethod

Anestimateofroot

Thenextguessisdeterminedby
connectingtheendpointswitha
straightline.Theintersectionofthis
line with the x axis represents an
linewiththexaxisrepresentsan
improvedestimateoftheroot.


..

Thefactthatthereplacementofthecurvebyastraightlinegivesafalsepositionoftherootisthe
originofthename,methodoffalseposition.

It i l
Itisalsocalledthelinearinterpolationmethod.
ll d th li
i t
l ti
th d

Chainarong Athisakul,Ph.D.

67

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Thefalsepositionmethod

Anestimateofroot

Th i il t i l
Thesimilartriangles

..

Chainarong Athisakul,Ph.D.

68

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

ComputationalProcedure

..

Chainarong Athisakul,Ph.D.

69

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

ComputationalProcedure

Chainarong Athisakul,Ph.D.

70

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

ComputationalProcedure

..
Chainarong Athisakul,Ph.D.

71

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Example5
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

2
3
4
5
6
7
8
9
10
11
12

Chainarong Athisakul,Ph.D.

72

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Example5
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

-1

-0.22119922

0.22119922

Step 1
Step1
The initial guesses of XL and XR
satisfy the condition

Step0

f ( xR ) f ( xL ) < 0

Chainarong Athisakul,Ph.D.

73

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Example5
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

-1

-0.22119922

0.22119922

If

Else

Chainarong Athisakul,Ph.D.

74

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Example5
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

-1

-0.22119922

0.22119922

Chainarong Athisakul,Ph.D.

75

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Example5
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

-1

-0.22119922

0.22119922

-0.22119922

0.81886721

-0.03752081

0.00829957

0 8188672
0.8188672

-0.03752081
0 03752081

0 78925377
0.78925377

-0.00605813
0 00605813

0 00022731
0.00022731

0.7892538

-0.00605813

0.78450116

-0.00097026

5.878E-06

0.7845012

-0.00097026

0.78374073

-0.00015519

1.5058E-07

0.7837407

-0.00015519

0.78361912

-2.4818E-05

3.8516E-09

0.7836191

-2.4818E-05

0.78359967

-3.9687E-06

9.8495E-11

0 7835997
0.7835997

-3.9687E-06
3 9687E 06

0 78359656
0.78359656

-6.3463E-07
6 3463E 07

2 5187E 12
2.5187E-12

0.7835966

-6.3463E-07

0.78359606

-1.0148E-07

6.4406E-14

10

0.7835961

-1.0148E-07

0.78359598

-1.6228E-08

1.6469E-15

11

0.783596

-1.6228E-08

0.78359597

-2.5951E-09

4.2114E-17

12

0.783596

-2.5951E-09

0.78359597

-4.1498E-10

1.0769E-18

Rootofthisequation
Chainarong Athisakul,Ph.D.

76

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Ineveryiterative,XRhasbeenreplacedbyX1,whiletheXLhasmaintainedthesamevalue.

Chainarong Athisakul,Ph.D.

77

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)


x
4

Example6 Determinetherootof f ( x ) = e ( 2 x ) 1 = 0
GivenXL=0andXR=2.
i

XL

XR

Chainarong Athisakul,Ph.D.

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

78

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)


x
4

Example6 Determinetherootof f ( x ) = e ( 2 x ) 1 = 0
i

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

-1

0.28402542 -0.28402542

0.28402542

-1

1.22119922

0.05685742 -0.05685742

1.2211992

0.05685742

-1

1.26309759

0.01052964 -0.01052964

1 2630976
1.2630976

0 01052964
0.01052964

-1
1

1 27077605
1.27077605

0 00192146 -0.00192146
0.00192146
0 00192146

1.2707761

0.00192146

-1

1.27217454

0.00034968 -0.00034968

1.2721745

0.00034968

-1

1.27242896

6.3607E-05

-6.3607E-05

1.272429

6.3607E-05

-1

1.27247524

1.1569E-05

-1.1569E-05

1.2724752

1.1569E-05

-1

1.27248365

2.1042E-06

-2.1042E-06

1 2724837
1.2724837

2 1042E 06
2.1042E-06

-1
1

1 27248518
1.27248518

3 827E 07
3.827E-07

-3.827E-07
3 827E 07

10

1.2724852

3.827E-07

-1

1.27248546

6.9605E-08

-6.9605E-08

11

1.2724855

6.9605E-08

-1

1.27248551

1.266E-08

-1.266E-08

12

1.2724855

1.266E-08

-1

1.27248552

2.3025E-09

-2.3025E-09

Ineveryiterative,XLhasbeenreplacedbyX1,whiletheXRhasmaintainedthesamevalue.
Chainarong Athisakul,Ph.D.

79

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Insomecases,thefalse
positionmethodperforms
ii
h d
f
poorly.

Chainarong Athisakul,Ph.D.

80

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Chainarong Athisakul,Ph.D.

81

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Chainarong Athisakul,Ph.D.

82

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Note Xr =X1
Note
= X1
subscript

Note Xr =X1

subscript
subscript

Chainarong Athisakul,Ph.D.

83

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

XL

XR

F(XL)

F(XR)

X1

F(X1)

F(X1)*F(XR)

0.5

-0.03333

2.87500
8

-0.02174

-0.01087
8

Note Xr =X1,Xu
, =Xr
subscript
Chainarong Athisakul,Ph.D.

84

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

H
Homework
k
Figureshowsauniformbeamsubjecttoa
l
linearlyincreasingdistributedload.Theequation
l
d
b dl d h
fortheresultingelasticcurveis

y=

wo
x 5 + 2 L2 x 3 L4 x )
(
120 EIL

Usebisectiontodeterminethepointof
maximumdeflection(thatisthevalueofx
wheredy/dx
h
d /d =0).Thensubstitutethisvalue
0) Th
b i
hi
l
intotheaboveequationtodeterminethe
valueofthemaximumdeflection.
Usethefollowingparametervaluesinyour
computation:L=600cm.,E=50,000kN/cm
p
,
,
/ 2
I=30,000cm4 ,andwo =2.5kN/cm.

Chainarong Athisakul,Ph.D.

CVE 240 Applied Mathematics for Civil Engineers 3(3-0-6)

Chainarong
Athisakul,Ph.D.
86

85

Das könnte Ihnen auch gefallen