This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Numerical
Differentiation Finite Difference Formuia: comes from a sim—
ple approximation based on computing the sIQpe between two points (t§f(t)), (t+At,f(t—i—At)),
that is the secant line f(t + At) — f(t)
At Taking the limit of the secant line as At —+ O
we get the definition of the derivative of f at
15. am): Hm f(t+At)—f(t) dt At—>O At If we choose At to be afixed non zero value
then we can construct a first order forward dif—
ference approximation to the derivative: df(t) __ f(t+At) —f(t)
dt " ‘ At + E(f(t)pAt) That is, the difference (f(t+At)—f(t)) divided
by At approximates the derivative when At is
smali. The total error E is the combined error from
truncation and roundoff: E : Emund “l” Etrunc First we obtain the truncation error Emma from
Taylor’s theorem, first by taking a Taylor ex
pansion (with the assumption that f is differ—
entiable over the domain of consideration, that is all the derivatives we are considering within
this context exist):
ay(t) £5£2d2f(t)_+_zkf3d3f(ﬁ fﬁ+Aﬂ=ﬂ0+AFE_ jfdﬂ grdﬁ This is recognized as the Taylor series expan
sion of f(t) about t. A useful alternate form of this equation is de
rived using Taylor’s theorem that guarantees
that there exists some value c for which the
following is true: §____‘ #6) At2d2f(c)
f<t+Aiif<t>+At7r “2i— alt? wheretwAtgcgt—l—At. Subtract f(t) from both sides and divide by At f(t + At) — fa) ___ dfCt) Atd2f(c) At dt 2! dt2 Despite We do not have the information of
what 0 is, it is enough for us to be able to
but a bound on the truncation error, that is
the truncation error is thus of order At. Rearranging w __ f(t+At) f(t)
dt _ At Now so far we have assumed that f(t) can be
calculated exactly. Once we evaluate expres
sions for the derivatives roundoff error occurs
so that ﬁt) = F00 + €(t) where F(t) is the approximated value given by
the computer and e(t) measures the error from
the value of f(t). Thus the round off error for
for the term W can be written e(t + At) — e(t)
At Thus the total error E : Emu.an ~l— Emma is
given by : w + At) — ed) __ gid’é’ﬂc) E
At 2 dt2 In order to obtain a maximum size of the error
we bound the maximum value of the roud—off
and the derivative: (question to class: why
would we want to find the maximum size of
the error?) {€(t + S 67"
S i — 6(t)l er
2
M 2 max d “18(0)
CE [tn,tn+1] E S 67" + err + At 2
Z 93: + MA; As At gets large the error grows ~ (ie. as At ) due to the truncation error: MAt"
2 As At gets small the error is dominated by the
round—off error (ie. which grows as &) due to
the round—off error: 2 6;“
At We are interested in minimizing the total error
so we will Choose a At in our implementations
to minimize the error. _ .— 26f)a
8(At) " At? + I M“ ~, This impiies that the At which minimizes the
error shouid be: At 2 [VI For a computer round—off error of N 10“16 we
would ideally like to use At N 10—8when using
this first order forward difference formula. ...
View
Full
Document
 Fall '11
 Dr.A.Wacher
 Numerical Analysis, Derivative

Click to edit the document details