4.8.14 · HinglishNumerical Methods

Error analysis of finite differences

1,350 words6 min readRead in English

4.8.14 · Maths › Numerical Methods


HUM KYA approximate kar rahe hain?


KAISE: truncation error ko scratch se derive karo

Sab kuch Taylor's theorem se aata hai ke baare mein:

Forward difference

Yeh step kyun? subtract karo aur se divide karo — exactly wohi jo formula karta hai. To Yeh kyun matter karta hai: leading error hai → first order accurate. Exact remainder (Lagrange form) hai kisi ke liye.

Central difference

Dono expansions likho: Subtract kyun karo? Even-power terms (, ) cancel ho jaate hain, sirf odd wale bachte hain: se divide karo: Yeh kyun matter karta hai: cancellation term ko khatam kar deta hai → second order. ko half karne se truncation error ~4 guna kam ho jaata hai.


KAISE: rounding error kahan se aata hai

Machine exactly store nahi karta; wo store karta hai, jahan aur (double precision machine epsilon) hai.

Central formula ke liye, computed numerator mein tak error hota hai jahan hai, isliye: kyun? Hum ek aisa roundoff divide karte hain jo shrink nahi hota ek tiny se → yeh blow up ho jaata hai. Yahi catastrophic cancellation hai: aur almost equal hote hain, isliye subtract karne par significant digits kho jaate hain.

Optimal step — minimize karke derive karo

Differentiate kyun? ka minimum wahan hai jahan . Us point par machine precision nahi! Forward difference ke liye , milta hai.

Figure — Error analysis of finite differences

Worked examples


Common mistakes


Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho tum ek pahaad ki dhaalan naap rahe ho do kadam door jaake dekh kar kitna upar gaye. Bade kadam ek rough answer dete hain (tum pahaad ka curve miss kar lete ho) — yahi truncation error hai. Tiny kadam perfect hone chahiye... lekin tumhara ruler sirf itne hi digits padh sakta hai, isliye jab dono heights almost same hoti hain, tab unka tiny difference mostly measurement ka kachra hota hai — yahi rounding error hai. Ek "just right" step size hoti hai, na bahut badi, na bahut chhoti. Apne point ke aas-paas kadam rakhna (ek aage, ek peeche) sirf aage kadam rakhne se zyada clever hai, kyunki dono sides ke errors cancel ho jaate hain.


Active recall

Forward difference ka leading truncation error kya hai?
, yaani .
Central difference ka leading truncation error kya hai?
, yaani .
Central difference forward se zyada accurate kyun hai?
mein se subtract karne par even-power Taylor terms (, ) cancel ho jaate hain, jisse term hat jaata hai.
Central difference ke liye rounding error ke saath kaise scale karta hai?
ki tarah — yeh ke saath badhta hai (catastrophic cancellation + chhote se division).
Central difference ke liye optimal step kya hai?
double precision mein.
"Chhota hamesha behtar hai" galat kyun hai?
Total error U-shaped hota hai; se neeche rounding error dominate karta hai aur total error badhta hai.
scheme ke liye half karne par error kitne factor se badalta hai?
Error guna ho jaata hai (kyunki ).
Yahan catastrophic cancellation kya hai?
Do lagbhag-equal function values subtract karne par significant digits kho jaate hain, relative error reh jaata hai.
Central difference ke liye double precision mein best achievable accuracy kya hai?
, poori machine precision nahi.

Connections

  • Taylor's Theorem — har truncation term ke peeche yahi engine hai.
  • Forward and Backward Difference Operators
  • Central Difference Operator
  • Floating Point Arithmetic and Machine Epsilon
  • Catastrophic Cancellation
  • Richardson Extrapolation — leading truncation term cancel karke order boost karta hai.
  • Numerical Differentiation
  • Order of Accuracy

Concept Map

approximated by

expand f x plus h

subtract, divide by h

subtract expansions

even terms cancel

truncation error

truncation error

shrinks as h to 0

grows as h to 0

causes

scales as eps over h

minimize E prime h equals 0

True derivative f prime x

Finite difference quotient

Taylor theorem

Forward difference O h

Central difference O h2

Second order accuracy

Truncation error

Total error E h

Rounding error

Machine epsilon

Catastrophic cancellation

Optimal step h