4.8.22 · D3 · Maths › Numerical Methods › ODE solvers — Euler's method (derivation, global error)
Intuition Yeh page kyun exist karti hai
Parent note ne Euler's method derive kiya tha aur uska error law bataya tha. Yeh page woh mushkil kaam karti hai: hum method ko har tarah ke input se haath se chalate hain — badhte solutions, ghatte wale, negative slopes, ek slope jo zero hai, ek itna bada step ki method bigad jaata hai, aur ek real-world word problem. Agar tum yeh sab follow kar sako, toh koi bhi exam version tumhe surprise nahi kar sakta.
Poori page ke liye ek rule, parent se: ==New = Old + step × slope-at-old==, yaani
y n + 1 = y n + h f ( x n , y n ) , x n + 1 = x n + h .
Koi bhi number se pehle, ek reminder ki har symbol ka kya matlab hai, taaki kuch bina explain ke use na ho:
Definition Woh chaar symbols jo hum har example mein use karenge
x n — current horizontal position (socho: hum road par kitna chal chuke hain).
y n — waahan solution ki height ka humara current estimate (hum sochte hain curve kahan hai).
h — step size : woh fixed horizontal distance jitna hum har baar jump karte hain.
f ( x n , y n ) — slope theek wahan jahan hum khade hain , jo differential equation hamare haath mein deta hai.
"Slope" yahan matlab hai rise per unit run — har unit horizontal travel mein kitne units height milti hai. Ise apne run h se multiply karo aur tumhe rise milti hai, h f . Woh rise y n mein add karo: bas itna hi poora method hai.
Definition Ek aur symbol jo hum milenge: growth rate
λ
Hamare kuch examples mein special shape y ′ = λ y hoti hai — slope bas ek constant λ ("lambda") hai jo current height se multiply hoti hai. Ise linear test equation kehte hain, aur hum ise isliye use karte hain kyunki iska true solution exactly y = y 0 e λ x hai, toh hum Euler ko ek known answer se check kar sakte hain.
Agar λ < 0 toh true solution 0 ki taraf decay karta hai (jaise cooling ya radioactive decay).
Agar λ > 0 toh woh grow karta hai.
f = λ y ko Euler update mein daalo toh milta hai y n + 1 = y n + hλ y n = ( 1 + hλ ) y n . Toh har step simply height ko number 1 + hλ se multiply karta hai. Woh ek number — ise stability factor kaho — sab kuch decide karta hai: agar ∣1 + hλ ∣ < 1 toh estimates sach ki tarah shrink hote hain; agar ∣1 + hλ ∣ ≥ 1 toh woh decay karne se mana karte hain aur blow up ho sakte hain. Hum dono dekhenge.
Yeh topic jo bhi problem throw kar sakta hai woh in cells mein se ek (ya blend) hai. Table mein cell, kya cheez use distinct banati hai, aur neeche konsa example use cover karta hai — yeh sab likha hai.
Cell
Kya cheez use special banati hai
Covered by
A. Growing solution, positive slope
f > 0 , y chadh raha hai, errors ek-taraf hain (undershoot)
Example 1
B. Decaying solution, negative slope
f < 0 , y ek floor ki taraf gir raha hai
Example 2
C. Step-halving / order check
global error ∝ h empirically verify karo
Example 3
D. Degenerate: slope = 0 at a point
f = 0 ⇒ ek flat step, y us step ke liye unchanged
Example 4
E. Limiting / unstable: h too large
$
1+h\lambda
F. Autonomous non-linear
f sirf y par depend karta hai, lekin non-linearly
Example 6
G. Real-world word problem
physics → IVP → Euler translate karo
Example 7
H. Exam twist: back-solve for h or y 0
answer diya hua hai, input dhundho
Example 8
Ab hum har cell chalte hain. Poori tarah, derivation aur error law parent topic se aate hain aur Taylor Series Expansion par based hain.
y ′ = x + y , y ( 0 ) = 1 , h = 0.1 se y ( 0.3 ) nikalo
Forecast: true solution 2 e x − x − 1 upar ki taraf curve karta hai (woh convex hai). Euler seedhi tangents follow karta hai, isliye use har step mein true curve ke neeche aana chahiye. Andaza: humara y ( 0.3 ) true ≈ 1.4 se thoda kam hoga.
Step 1 — shuru. x 0 = 0 , y 0 = 1 . Slope f ( 0 , 1 ) = 0 + 1 = 1 .
Kyun? ODE hi slope-machine hai ; current point use karo.
y 1 = 1 + 0.1 ⋅ 1 = 1.1 , x 1 = 0.1
Step 2. Slope f ( 0.1 , 1.1 ) = 0.1 + 1.1 = 1.2 .
Kyun? Naye point par slope phir se measure karo — road bend ho gayi, toh purana slope stale hai.
y 2 = 1.1 + 0.1 ⋅ 1.2 = 1.22 , x 2 = 0.2
Step 3. Slope f ( 0.2 , 1.22 ) = 0.2 + 1.22 = 1.42 .
Kyun? Wahi rule teesri baar — agle step se pehle freshly landed point ( x 2 , y 2 ) par hamesha f re-evaluate karo.
y 3 = 1.22 + 0.1 ⋅ 1.42 = 1.362 , x 3 = 0.3
Verify: true value 2 e 0.3 − 0.3 − 1 = 1.39972 . Humara 1.362 use se neeche hai (error ≈ 0.038 ), bilkul forecast ke anusaar ek convex curve ke liye. ✓
Neeche ka figure hamare teen orange Euler points ko teal true curve ke against plot karta hai. Dekho ki orange polyline har x par teal curve ke neeche baithti hai, aur x = 0.3 par plum arrow gap measure karta hai — yeh accumulated undershoot hai jo forecast ne predict kiya tha. Kyunki true curve upar ki taraf bend karti hai, seedhe tangent steps sirf corner cut kar sakte hain aur kam pad sakte hain.
y ′ = − y , y ( 0 ) = 2 , h = 0.2 se y ( 0.4 ) nikalo
Yahan f = − y hai, yaani growth rate λ = − 1 wali linear test equation.
Forecast: true solution 2 e − x 0 ki taraf girta hai aur neeche se convex hai. Negative slope ka matlab hai ki har step height subtract karta hai. Andaza: 2 e − 0.4 ≈ 1.34 ke aas-paas koi value, aur (kyunki curve convex hai) Euler thoda neeche baithega.
Step 1. f ( 0 , 2 ) = − 2 . y 1 = 2 + 0.2 ( − 2 ) = 1.6 at x 1 = 0.2 .
Kyun? Slope negative hai, isliye rise h f = − 0.4 actually ek fall hai.
Step 2. f ( 0.2 , 1.6 ) = − 1.6 . y 2 = 1.6 + 0.2 ( − 1.6 ) = 1.28 at x 2 = 0.4 .
Kyun? Naye, chhoti height y 1 = 1.6 par slope phir se measure karo; chhoti height ek shallower fall deti hai (− 1.6 instead of − 2 ), toh curve level off ho rahi hai.
Verify: true 2 e − 0.4 = 1.34064 . Euler 1.28 deta hai, neeche (error ≈ 0.061 ). Yahan method stable hai kyunki stability factor ∣1 + hλ ∣ = ∣1 + 0.2 ( − 1 ) ∣ = 0.8 < 1 — estimates 0 ki taraf shrink karte hain bilkul sach ki tarah. ✓ (Ise Example 5 se contrast karo, jahan wahi idea fail hoti hai.)
y ′ = x + y , y ( 0 ) = 1 , x = 0.2 par h = 0.1 vs h = 0.05 ke liye final error compare karo
Forecast: parent ne prove kiya tha ki global error = O ( h ) . Toh h halve karne se error roughly halve honi chahiye. Ratio ≈ 0.5 predict karo.
h = 0.1 ke saath (2 steps): Example 1 ki pehli do lines se, y ( 0.2 ) = 1.22 . True 2 e 0.2 − 1.2 = 1.24281 . Error E 0.1 = 0.02281 .
h = 0.05 ke saath (4 steps):
y 1 = 1 + 0.05 ( 0 + 1 ) = 1.05 at 0.05
f = 0.05 + 1.05 = 1.1 , y 2 = 1.05 + 0.05 ( 1.1 ) = 1.105 at 0.10
f = 0.10 + 1.105 = 1.205 , y 3 = 1.105 + 0.05 ( 1.205 ) = 1.16525 at 0.15
f = 0.15 + 1.16525 = 1.31525 , y 4 = 1.16525 + 0.05 ( 1.31525 ) = 1.2310125 at 0.20
Error E 0.05 = 1.24281 − 1.23101 = 0.01180 .
Verify: ratio E 0.05 / E 0.1 = 0.01180/0.02281 = 0.517 ≈ 2 1 . First order confirm. ✓
Exactly 0.5 kyun nahi? O ( h ) law ek leading-order statement hai; tiny higher-order terms use exact half se thoda hata deti hain. Jab h → 0 toh ratio 0.5 ke paas aa jaata hai.
y ′ = x 2 − 1 , y ( 0 ) = 0.5 , h = 1 se y ( 2 ) nikalo
Yeh woh case hai jo log galat karte hain: kisi step par slope bilkul zero hoti hai, toh y bilkul nahi hilta.
Forecast: x = 1 par slope 1 2 − 1 = 0 hai. Toh x = 1 se shuru hone wala step bilkul flat hoga — y us step mein wahi rahega. Dhyan rakhna.
Step 1. f ( 0 , 0.5 ) = 0 2 − 1 = − 1 . y 1 = 0.5 + 1 ⋅ ( − 1 ) = − 0.5 at x 1 = 1 .
Girne ki wajah? Slope negative thi, isliye height giri.
Step 2. f ( 1 , − 0.5 ) = 1 2 − 1 = 0 . y 2 = − 0.5 + 1 ⋅ 0 = − 0.5 at x 2 = 2 .
Unchanged kyun? ==Zero slope ⇒ zero rise ⇒ y n + 1 = y n .== Step horizontal hai.
Verify: exactly solve karo: y = 3 x 3 − x + 0.5 , toh y ( 2 ) = 3 8 − 2 + 0.5 = 1.16 6 . Euler ka crude h = 1 − 0.5 deta hai — bahut zyada off kyunki h bahut bada hai, lekin flat step ki mechanics correct hai: y sach mein nahi badla jab f = 0 tha. ✓ (Degenerate inputs Euler ko nahi todti; woh bas ek flat segment produce karti hain.)
Figure do orange steps trace karta hai. Pehla segment neeche slope karta hai (slope − 1 ); doosra, plum mein mota draw kiya gaya hai, bilkul horizontal hai kyunki waahan f = 0 hai — yeh visual proof hai ki zero slope ek flat step produce karta hai jahan y 2 = y 1 . Picture ko left se right padhna hi calculation hai .
y ′ = − 2 y , y ( 0 ) = 1 , h = 1.5 lo, y ( 3 ) nikalo
Yeh growth rate λ = − 2 wali linear test equation hai.
Forecast: true solution e − 2 x smoothly ≈ 0 ki taraf decay karta hai. Lekin stability factor hai 1 + hλ = 1 + 1.5 ( − 2 ) = − 2 , aur ∣ − 2∣ = 2 > 1 . Jo numbers size mein 1 se bade kisi cheez se multiply hote hain woh grow karenge aur sign flip karenge . Forecast: oscillating, exploding values — true decay ke bilkul ulta.
Step 1. y 1 = 1 + 1.5 ( − 2 ) ( 1 ) = 1 − 3 = − 2 at x = 1.5 .
Step 2. y 2 = − 2 + 1.5 ( − 2 ) ( − 2 ) = − 2 + 6 = 4 at x = 3 .
Verify: har step stability factor 1 + hλ = − 2 se multiply karta hai: 1 → − 2 → 4 , yaani y n = ( − 2 ) n . True e − 6 = 0.00248 . Euler 4 tak pahunch jaata hai — yeh ek stability failure hai, sirf accuracy error nahi. ✓
Ilaaj: ∣1 + hλ ∣ < 1 chahiye, yaani ∣1 − 2 h ∣ < 1 ⇒ 0 < h < 1 . Koi bhi h < 1 correctly decay karta hai; h = 1.5 use violate karta hai. Yeh precisely Numerical Stability aur Backward Euler & Implicit Methods ka gateway hai, jo yahan kisi bhi h ke liye stable rehte hain.
Figure smooth teal decay curve e − 2 x (gently 0 ki taraf ja rahi hai) ko orange Euler points se contrast karta hai jo 1 → − 2 → 4 tak jump karte hain. Plum annotation culprit ko flag karta hai — size 2 > 1 wala stability factor — aur axis par straddling orange zig-zag ek unstable run ki tell-tale sign-flipping dikhata hai. Jab tumhare numbers alternate sign karte hain aur badhte hain, yahi picture ho rahi hai.
Common mistake "Example 5 mein error ka matlab sirf answer ke paas chhota
h lo."
Kyun sahi lagta hai: O ( h ) kehta hai chhota h ⇒ chhota error.
Fix: stability threshold ke neeche, haan. Upar it, iteration diverge karta hai chahe accuracy law kuch bhi predict kare — accuracy aur stability alag guarantees hain.
y ′ = y 2 , y ( 0 ) = 1 , h = 0.1 se y ( 0.2 ) nikalo
Yahan f y ke square par depend karta hai — ek non-linear slope machine. (True solution y = 1 − x 1 x = 1 par blow up karta hai; hum safely uske left rehte hain.)
Forecast: y 2 fast badhta hai jab y badhta hai, toh slopes accelerate karte hain. Euler, pehle ki chhoti slope use karke, true steep climb ko undershoot karega.
Step 1. f ( 0 , 1 ) = 1 2 = 1 . y 1 = 1 + 0.1 ( 1 ) = 1.1 at 0.1 .
Square kyun? Bas f evaluate karo: ( y 0 ) 2 = 1 .
Step 2. f ( 0.1 , 1.1 ) = 1. 1 2 = 1.21 . y 2 = 1.1 + 0.1 ( 1.21 ) = 1.221 at 0.2 .
Kyun? Naye height y 1 = 1.1 par f re-evaluate karo; badi height ko square karne se steeper slope milti hai (1.21 > 1 ), toh climb accelerate ho rahi hai.
Verify: true 1 − 0.2 1 = 1.25 . Euler 1.221 deta hai, neeche (error ≈ 0.029 ), forecast ke anusaar. ✓ Non-linearity recipe mein kuch nahi badlati — tum bas current point f mein daalo.
Worked example Ek cup coffee
9 0 ∘ C par ek 2 0 ∘ C wale room mein rakhi hai. Newton's law of cooling deta hai d t d T = − 0.1 ( T − 20 ) , jahan t minutes mein hai. h = 10 min use karke t = 20 min par temperature estimate karo.
Translate: f ( t , T ) = − 0.1 ( T − 20 ) , T 0 = 90 . Negative sign ka matlab hai yeh room temperature ki taraf cool hoti hai.
Forecast: true cooling 20 + 70 e − 0.1 t hai; t = 20 par woh 20 + 70 e − 2 ≈ 29. 5 ∘ hai. Coarse h = 10 ke saath, Euler over-cool karta hai (slope shuru mein sabse badi, ek lambe step mein apply hoti hai) — 29.5 se neeche value expect karo.
Step 1. f ( 0 , 90 ) = − 0.1 ( 90 − 20 ) = − 7 . T 1 = 90 + 10 ( − 7 ) = 2 0 ∘ at t = 10 .
Itna drastic kyun? Shuru ki slope steep hai aur hum ne use poore 10 minute pakde rakha.
Step 2. f ( 10 , 20 ) = − 0.1 ( 20 − 20 ) = 0 . T 2 = 20 + 10 ( 0 ) = 2 0 ∘ at t = 20 .
Flat kyun? 2 0 ∘ par hum exactly room temperature tak pahunch jaate hain, toh slope 0 hai — ek degenerate step (Cell D phir, naturally aa rahi hai!).
Verify: Euler 2 0 ∘ kehta hai; truth 29. 5 ∘ . Error ≈ 9. 5 ∘ — bada kyunki h = 10 coarse hai aur stability margin ∣1 + hλ ∣ = ∣1 + 10 ( − 0.1 ) ∣ = ∣0∣ = 0 estimate ko ek hi jump mein floor tak le jaata hai. Units check: temperature poori tarah ∘ C mein rehti hai. ✓ Chhota h (maan lo h = 2 ) smooth 29. 5 ∘ ko kaafi behtar track karega.
y ′ = x + y , y ( 0 ) = 1 ke liye, size h ka ek Euler step y 1 = 1.15 par land karta hai. h nikalo.
Forecast: hum recipe jaante hain, toh use ulta karo. Shuru mein slope f ( 0 , 1 ) = 1 hai, toh y 1 = 1 + h ⋅ 1 . Agar y 1 = 1.15 hai, toh h 0.15 hona chahiye.
Step 1. Update likho: y 1 = y 0 + h f ( x 0 , y 0 ) = 1 + h ( 1 ) .
Kyun? Ek step, slope jaani hui — h mein ek linear equation.
Step 2. Solve karo 1 + h = 1.15 ⇒ h = 0.15 .
Verify: plug back karo: 1 + 0.15 ( 1 ) = 1.15 . ✓ Yeh "reverse" questions test karte hain ki kya tum update ko sach mein ek equation samajhte ho, black box nahi.
Recall Konsa cell sabse mushkil tha — aur kyun?
Cell E (instability). Har doosra cell sirf accuracy error produce karta hai, jo h ke zariye O ( h ) law se control hoti hai. Cell E ek qualitative failure produce karta hai: numbers ek aisi truth se diverge karte hain jo decay kar rahi hai. Lesson: h ko accuracy aur stability dono constraints satisfy karni chahiye.
Mnemonic Compute karne se pehle scenario checklist
"Sign, Zero, Size." f ka Sign check karo (chadh raha hai ya gir raha hai?), koi bhi Zero slope spot karo (flat step), aur confirm karo ki tumhara Size of h ∣1 + hλ ∣ < 1 rakhta hai (stable). Teen nazrein is page ke har trap se bachati hain.
Positive slope wala Euler estimate ek convex true curve ke against — upar ya neeche? Neeche (tangents ek convex curve ko undercut karte hain).
y ′ = − y ke liye, konsa h Euler ko stable rakhta hai?Koi bhi h jahan ∣1 − h ∣ < 1 ho, yaani 0 < h < 2 .
f = 0 wala step y ke saath kya karta hai?Kuch nahi — y n + 1 = y n , ek flat horizontal step.
h halve karne se global error roughly kitne factor se badalta hai?Lagbhag 2 1 (first-order, O ( h ) ).
y 1 = y 0 + h f diya aur y 1 known hai, h kaise nikalen?Linear equation h = ( y 1 − y 0 ) / f ( x 0 , y 0 ) solve karo.
Parent topic — derivation & error law jo in examples mein use hote hain
Taylor Series Expansion — har example ko milne wala local O ( h 2 ) term ka source
Runge-Kutta Methods — upar dekhe gaye errors ko drastically kam kar deta (O ( h 4 ) )
Backward Euler & Implicit Methods — Example 5 mein kisi bhi h ke liye stable rehta hai
Numerical Stability — ∣1 + hλ ∣ < 1 test jo Examples 2, 5, 7 mein use hota hai
Lipschitz Continuity — Example 3 ke peeche error bound guarantee karta hai
Finite Difference Approximations — yahan har step ka forward-difference view
Euler update new = old + h times slope
Cell A growing undershoot
Cell D flat step y unchanged
accuracy error only order h
Cell E instability diverges